Skip to content

Commit f87f04c

Browse files
Improve content of help message (#3113)
Improve content of help message The previous version of help messages referred to the --package parameter, which is not supported in Fedora CI and should not be included in the corresponding help message. Also, the notes in the epilog of the message weren't worded the best way. This is now fixed. Reviewed-by: gemini-code-assist[bot] Reviewed-by: Matej Focko Reviewed-by: Alžběta Kučerová
2 parents b2ee04c + 3170326 commit f87f04c

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

packit_service/constants.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,19 @@
3434
"**Documentation**: \n - {docs}"
3535
)
3636
HELP_NOTE = (
37-
"If using Fedora CI, refer to `/packit-ci help` instead. "
38-
"Refer to `/packit-ci-stg help` if using the staging instance."
37+
"`/packit` commands interact with the opt-in packit jobs "
38+
"(e.g. `propose-downstream`, `pull-from-upstream`). "
39+
"If you are looking for help on Fedora CI jobs "
40+
"(e.g. `scratch-build`, `test rpminspect`, etc.), "
41+
"refer to `/packit-ci` or `/packit-ci-stg`."
3942
)
4043
HELP_NOTE_FEDORA_CI = (
41-
"For default Packit behaviour, refer to `/packit help` instead. "
42-
"Refer to `/packit-stg help` if using the staging instance."
44+
"`/packit-ci` commands interact with Fedora CI jobs "
45+
"(e.g. `scratch-build`, `test rpminspect`, etc.). "
46+
"If you are looking for help on the opt-in packit jobs "
47+
"(e.g. `propose-downstream`, `pull-from-upstream`), "
48+
"refer to `/packit` or `/packit-stg`. "
49+
"These assume a `.packit.yaml` configuration file is present in the repo."
4350
)
4451

4552
KOJI_PRODUCTION_BUILDS_ISSUE = "https://pagure.io/releng/issue/9801"

packit_service/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,13 @@ def _create_base_parser(
241241
description: str | None = None,
242242
epilog: str | None = None,
243243
) -> argparse.ArgumentParser:
244-
parser = argparse.ArgumentParser(
244+
return argparse.ArgumentParser(
245245
prog=prog,
246246
description=description,
247247
epilog=epilog,
248248
formatter_class=RawTextHelpFormatter,
249249
add_help=False,
250250
)
251-
parser.add_argument("--package", help="specific package from monorepo to run job for")
252-
return parser
253251

254252

255253
def get_comment_parser(
@@ -258,6 +256,7 @@ def get_comment_parser(
258256
epilog: str | None = None,
259257
) -> argparse.ArgumentParser:
260258
parser = _create_base_parser(prog, description, epilog)
259+
parser.add_argument("--package", help="specific package from monorepo to run job for")
261260

262261
subparsers = parser.add_subparsers(
263262
dest="command",

packit_service/worker/jobs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,8 @@ def parse_comment(
273273
try:
274274
args = parser.parse_args(commands)
275275
check_target = getattr(args, "check_target", None)
276-
return ParsedComment(
277-
command=args.command, package=args.package, check_target=check_target
278-
)
276+
package = getattr(args, "package", None)
277+
return ParsedComment(command=args.command, package=package, check_target=check_target)
279278
except SystemExit:
280279
# tests expect invalid syntax comments be ignored
281280
logger.debug(

0 commit comments

Comments
 (0)