Skip to content

Update the epilog of the help comment#3124

Open
betulependule wants to merge 4 commits into
packit:mainfrom
betulependule:help-comment-epilog-update
Open

Update the epilog of the help comment#3124
betulependule wants to merge 4 commits into
packit:mainfrom
betulependule:help-comment-epilog-update

Conversation

@betulependule
Copy link
Copy Markdown
Contributor

@betulependule betulependule commented May 13, 2026

This PR introduces some small edits to the epilog of the help comment.

  1. The epilog no longer references .packit.yaml and instead, uses a more generic term.
  2. The note referencing /packit-ci is now only added when the user uses /packit help on Pagure. Many users of Packit don't know what Fedora CI even is, so mentioning it on GitHub and Gitlab made little sense.

I've tested the fixes on a local deployment, but am not currently able to test it after applying the latest refactoring changes as I am hitting a Temporary failure in name resolution. I'll re-test it once I am able to.

TODO:

  • Test on local deployment

Not sure if this is relevant enough to be mentioned in the blog post. If yes, here are the release notes below. Ignore this otherwise:

RELEASE NOTES BEGIN

In instances where the help comment (created in response to /packit help) would reference the need for a configuration file, Packit now uses a generic term, reflecting support for all valid configuration file names and replacing the previous specific mention of .packit.yaml. The help comment also no longer references /packit-ci commands on GitHub and Gitlab as these commands are not relevant to users on these platforms.

RELEASE NOTES END

There are multiple supported file names of Packi config files.
The help message has been edited to reflect this fact.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the help comment constants and the logic for generating help messages in worker handlers, introducing modular constants and conditional notes for Pagure projects. The review feedback recommends improving the visual formatting of help messages with additional newlines, using f-strings for string concatenation, and adding a safety check for null comment values to prevent potential runtime errors.

Comment thread packit_service/constants.py Outdated
Comment thread packit_service/constants.py Outdated
" - *Mastodon*: @packit@fosstodon.org\n"
)
HELP_COMMENT_DOCS = "**Documentation**: \n - {docs_url}"
HELP_COMMENT_EPILOG = "{note}" + HELP_COMMENT_CONTACT + HELP_COMMENT_DOCS
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For better readability and consistency with modern Python practices, consider using an f-string for concatenation and formatting.

Suggested change
HELP_COMMENT_EPILOG = "{note}" + HELP_COMMENT_CONTACT + HELP_COMMENT_DOCS
HELP_COMMENT_EPILOG = f"{note}{HELP_COMMENT_CONTACT}{HELP_COMMENT_DOCS}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This wouldn't work as note would be undefined in this context

Comment thread packit_service/worker/handlers/forges.py Outdated
@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

With the previous implementation, when a user would use the `/packit help`
command, the epilog would mention the Fedora CI `/packit-cit help`
command, which would confuse users who do not know what Fedora CI
even is. The note is now only added when the `/packit help` command
is used in the context of Pagure.
The implementation is now more readable.

Assisted-By: Claude Sonnet 4.5 noreply@anthropic.com
@betulependule betulependule force-pushed the help-comment-epilog-update branch from d26a691 to 6a319a2 Compare May 13, 2026 10:20
@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

This should never happen in the current implementation, but add
this prevention in case this error is ever introduced due to changes
in the codebase.
@centosinfra-prod-github-app
Copy link
Copy Markdown
Contributor

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants