-
Notifications
You must be signed in to change notification settings - Fork 56
Trigger packit only for specific package in monorepo #2850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger packit only for specific package in monorepo #2850
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: packit_service/worker/jobs.py
Did you find this useful? React with a 👍 or 👎 |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 53s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 58s |
d09f661 to
20aa8b5
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 55s |
3f4d48e to
9d9bb32
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 03s |
9d9bb32 to
8bf7bb0
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 58s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 50s |
eb79df6 to
59420ee
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 53s |
mfocko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, mostly formatting remarks… there's also one thing with the common options shared at the top-level, but I might be wrong there 👀
packit_service/worker/jobs.py
Outdated
| parser.add_argument("--all-branches", action="store_true") | ||
| parser.add_argument("--with-pr-config", action="store_true") | ||
| parser.add_argument("--resolve-bug") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those aren't common for all Packit commands, are they? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's an issue… though the question is what should happen when you use an option that's not supported by some command, e.g., --resolve-bug is definitely not supported by /packit build…
Probably error > silent-ignore, but not sure about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they aren't common for all commands. I think it should be fixed in the later commits, where I made a subparser for each command, so that these arguments are defined only for the commands that support them.
| args = parser.parse_args(commands) | ||
| return {"command": args.command, "monorepo_package": args.package} | ||
| except argparse.ArgumentError: | ||
| except SystemExit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exit? 👀 that's from the argparse I presume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was really surprised. I was expecting to get argparse.TypeError when the parser encountered an error, but the except argparse.TypeError clause got skipped when running tests and tests failed with SystemExit.
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 32s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
mfocko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one suggestion for a smaller improvement
11026b5 to
769378a
Compare
|
/gemini review |
There was a problem hiding this 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 introduces support for a --package parameter in PR comments to target specific packages in a monorepo, using argparse for comment parsing. The implementation is solid, but I have a few suggestions to improve code clarity, maintainability, and correctness. Specifically, I've pointed out an incorrect type hint and docstring, some dead code that can be removed, and an opportunity to refactor duplicated code.
769378a to
108df99
Compare
|
Build failed. ❌ pre-commit FAILURE in 1m 44s |
|
/gemini review |
|
Build failed. ✔️ pre-commit SUCCESS in 1m 48s |
|
recheck |
|
Build failed. ✔️ pre-commit SUCCESS in 1m 45s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 45s |
|
hi @betulependule , is this ready for review? |
Hi, yes, it should be. |
mfocko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly stylistic (language, not even Python…), LGTM
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
a9b2dd9 to
d998e63
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
d998e63 to
8fc54de
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 48s |
8fc54de to
04a71b5
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 46s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 44s |
25786a9 to
69b6943
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 44s |
mfocko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Packit-service now supports the `--package` parameter in PR comments to specify package for which to run jobs. One test was added to test this functionality. The argparse module is now used for parsing comments. By default, argparse seems to ignore newlines in the epilog string used when generating help message, resulting in a messy help message. RawTextHelpFormatter ensures the message (specifically, the epilog part) is formatted properly. This going to be needed when argparse is utilized by `/packit help` command in the future. A collection of simple tests were also added to test the comment parsers.
In previous implementation, using the `--package` parameter in a non-monorepo project would result in this parameter being ignored no matter the value given. With this new approach, using the `--package` parameter incorrectly in a non-monorepo project will result in all jobs being filtered out instead. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
69b6943 to
94d8adf
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 45s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 47s |
Packit-service now supports the
--packageparameter in PR comments to specify package for which to run jobs. One test was added to test the functionality of this argument. As argparse is now used to parse comments, a collection of tests has also been added to test the functionality of the parsers.TODO:
packit/packit.dev.There is some commented monorepo-related code in
process_fedora_ci_jobs. It's not used, but might be useful in future.Fixes #2467
Related to
Merge before #1073
RELEASE NOTES BEGIN
Packit-service now supports the
--packageparameter, which can be used when retriggering jobs in monorepositories. The parameter is intended to specify the package, for which to run specified jobs.RELEASE NOTES END