@@ -22,9 +22,11 @@ def generate_release_comment(
22
22
release_url : str ,
23
23
pypi_url : str ,
24
24
docker_image : Optional [str ] = None ,
25
+ is_production : bool = True ,
26
+ package_name : str = "quilt-mcp-server" ,
25
27
) -> str :
26
28
"""Generate the release status comment body."""
27
- is_prod = "-dev-" not in version
29
+ # Use the is_production flag passed explicitly
28
30
29
31
body = f"## 🚀 Release Status for v{ version } \n \n "
30
32
body += "### 📦 Package Locations\n \n "
@@ -39,19 +41,19 @@ def generate_release_comment(
39
41
body += "```\n "
40
42
41
43
body += "\n ### 📥 Installation\n "
42
- if is_prod :
44
+ if is_production :
43
45
body += "```bash\n "
44
46
body += "# Install from PyPI\n "
45
- body += f"pip install quilt-mcp-server =={ version } \n "
47
+ body += f"pip install { package_name } =={ version } \n "
46
48
body += "# or\n "
47
- body += f"uv add quilt-mcp-server =={ version } \n "
49
+ body += f"uv add { package_name } =={ version } \n "
48
50
body += "```\n "
49
51
else :
50
52
body += "```bash\n "
51
53
body += "# Install from TestPyPI\n "
52
- body += f"pip install -i https://test.pypi.org/simple/ quilt-mcp-server =={ version } \n "
54
+ body += f"pip install -i https://test.pypi.org/simple/ { package_name } =={ version } \n "
53
55
body += "# or\n "
54
- body += f"uv add --index https://test.pypi.org/simple/ quilt-mcp-server =={ version } \n "
56
+ body += f"uv add --index https://test.pypi.org/simple/ { package_name } =={ version } \n "
55
57
body += "```\n "
56
58
57
59
return body
@@ -258,6 +260,8 @@ def main():
258
260
release_url = args .release_url ,
259
261
pypi_url = args .pypi_url ,
260
262
docker_image = args .docker_image ,
263
+ is_production = args .is_production ,
264
+ package_name = args .package_name ,
261
265
)
262
266
263
267
if args .dry_run :
@@ -267,13 +271,7 @@ def main():
267
271
268
272
# PRIMARY GOAL: Update release notes if release-id is provided
269
273
if args .release_id :
270
- if not args .github_token :
271
- print ("Error: GitHub token required to update release notes" , file = sys .stderr )
272
- return 1
273
-
274
- if not args .repo :
275
- print ("Error: Repository required to update release notes" , file = sys .stderr )
276
- return 1
274
+ # All required parameters are already validated by argparse
277
275
278
276
# Format content for release notes (add separator)
279
277
release_notes_content = f"\n ---\n \n { status_content } "
@@ -294,15 +292,15 @@ def main():
294
292
# SECONDARY GOAL: Post PR comment if possible (failure = graceful continue)
295
293
pr_number = args .pr_number
296
294
297
- if not pr_number and args .sha and args . github_token :
295
+ if not pr_number and args .sha :
298
296
# Try to find PR from SHA
299
297
pr_number = find_pr_for_sha (
300
298
github_token = args .github_token ,
301
299
repo = args .repo ,
302
300
sha = args .sha ,
303
301
)
304
302
305
- if pr_number and args . github_token and args . repo :
303
+ if pr_number :
306
304
# Attempt to post PR comment
307
305
pr_success = post_comment_to_pr (
308
306
github_token = args .github_token ,
0 commit comments