Skip to content

Conversation

@yatharth
Copy link
Contributor

@yatharth yatharth commented Dec 23, 2025

No description provided.

Copy link
Contributor Author

Comment on lines +281 to +309
if not typer.confirm("Would you like to post a public announcement about this release?", default=False):
info("Skipping public announcement.")
return

# Generate default template message
_pypi_url = f"https://pypi.org/project/{package.value}/"
template = textwrap.dedent(
f"""\
📦 **{package.value} v{version}** [released]({_pypi_url})!
- Added support for [blah]
- Bug fix for [blah]
"""
)

# Open editor for user to compose message
info("Opening editor to compose public announcement...")
edited_message = typer.edit(template)

# Bail if message is empty.
if edited_message is None or len(edited_message.strip()) == 0:
info("No message composed. Skipping public announcement.")
return

# In dry-run mode, show what would be posted.
if dry_run:
info("Would post following message to public Discord:")
print(edited_message)
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dry-run check occurs after user prompts, causing unnecessary user interaction in dry-run mode. When dry_run=True, users are still prompted with typer.confirm() (line 281) and typer.edit() (line 298) before the dry-run check at line 306. This means dry-run mode requires full user interaction despite not posting anything.

In typical dry-run workflows, no user interaction should be required. The function should check dry_run at the beginning and skip all interactive prompts:

if dry_run:
    info("Would prompt for public Discord announcement (skipped in dry-run mode)")
    return

# Continue with interactive prompts...
if not typer.confirm(...):
    ...
Suggested change
if not typer.confirm("Would you like to post a public announcement about this release?", default=False):
info("Skipping public announcement.")
return
# Generate default template message
_pypi_url = f"https://pypi.org/project/{package.value}/"
template = textwrap.dedent(
f"""\
📦 **{package.value} v{version}** [released]({_pypi_url})!
- Added support for [blah]
- Bug fix for [blah]
"""
)
# Open editor for user to compose message
info("Opening editor to compose public announcement...")
edited_message = typer.edit(template)
# Bail if message is empty.
if edited_message is None or len(edited_message.strip()) == 0:
info("No message composed. Skipping public announcement.")
return
# In dry-run mode, show what would be posted.
if dry_run:
info("Would post following message to public Discord:")
print(edited_message)
return
if dry_run:
info("Would prompt for public Discord announcement (skipped in dry-run mode)")
return
if not typer.confirm("Would you like to post a public announcement about this release?", default=False):
info("Skipping public announcement.")
return
# Generate default template message
_pypi_url = f"https://pypi.org/project/{package.value}/"
template = textwrap.dedent(
f"""\
📦 **{package.value} v{version}** [released]({_pypi_url})!
- Added support for [blah]
- Bug fix for [blah]
"""
)
# Open editor for user to compose message
info("Opening editor to compose public announcement...")
edited_message = typer.edit(template)
# Bail if message is empty.
if edited_message is None or len(edited_message.strip()) == 0:
info("No message composed. Skipping public announcement.")
return
# In dry-run mode, show what would be posted.
info("Would post following message to public Discord:")
print(edited_message)
return

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants