-
Notifications
You must be signed in to change notification settings - Fork 48
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
Retrigger bodhi update via dist-git PR comment #1654
Conversation
This is due to different job_config_trigger_types (pull_request/commit) in retrigerring bodhi via dist-git PR.
Build failed. ✔️ pre-commit SUCCESS in 3m 58s |
Thanks for finding time to implement this! I will have a closer look at the PR later. But as for the question:
Since there is no real Celery in the tests, we call some methods which would Celery do => call the |
9f13ee4
to
1baf016
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 1m 58s |
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 tried your changes locally with podman-compose
.
I have this error and maybe it could be somehow related with the tests (but I am not sure)
worker | File "/usr/local/lib/python3.10/site-packages/packit_service/worker/handlers/bodhi.py", line 175, in pre_check
worker | if self.koji_build_event_data.state != KojiBuildState.complete:
worker | File "/usr/local/lib/python3.10/site-packages/packit_service/worker/handlers/bodhi.py", line 118, in koji_build_event_data
worker | self._koji_build_event_data = self._build_koji_event_data()
worker | File "/usr/local/lib/python3.10/site-packages/packit_service/worker/handlers/bodhi.py", line 111, in _build_koji_event_data
worker | return self._build_from_koji_api()
worker | File "/usr/local/lib/python3.10/site-packages/packit_service/worker/handlers/bodhi.py", line 96, in _build_from_koji_api
worker | nvr = DistGit.get_latest_build_in_tag(
worker | TypeError: DistGit.get_latest_build_in_tag() missing 1 required positional argument: 'self'
I have not fixed it because I am not really sure that it could be helpful.
I may be wrong (and maybe I am missing something else) but I think that in the commit named Feat(bodhi hangler): Get last koji build from koji api
we expect a KojiBuildEvent
even if in this case we are reacting to a PullRequestCommentPagureEvent
which has not the needed Koji data.
Should we take the last built Koji
package from the db instead?
I'll take it in points:
|
https://github.com/packit/packit-service/blob/main/CONTRIBUTING.md#running-packit-service-locally is a good start EDIT: I'm using docker-compose with podman (I've been hitting one problem recently, but there are workarounds) |
Sorry, I did not realize you were trying to build a I think you don't need to do that; here you can see that the list of Koji builds is optional. As regarding the debug, I have instrumented
|
Yes, I know that if I'll set the
Unfortunately yes. But at least I am trying to use at least But if you have an idea how to get around it without searching for the data in the way I do it then I am open to suggestions 😇 And thanks for sharing your debugging workflow! 👍 |
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.
thanks for the implementation! will you be able to finish this (I only added 2 notes) or should we help you somehow? Also, we do not have any reporting in case pre-check fails (e.g.when the person who commented doesn't have permissions), I am wondering whether we should solve this here or do it together for retriggering Koji builds by comment where this is missing as well
nvr = DistGit.get_latest_build_in_tag( | ||
downstream_package_name=self.project.repo, dist_git_branch=dist_git_branch | ||
) | ||
|
||
session = ClientSession(baseurl=KOJI_BASEURL) | ||
build = session.getBuild(buildInfo=nvr) |
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 think that we could refactor the packit get_latest_build_in_tag
method to return the whole build dictionary and not only nvr here and then we would not need to call the Koji API here the second time
f"Bodhi update will be re-triggered via dist-git PR comment by user {user}." | ||
) | ||
|
||
if not self.project.has_write_access(user=user): |
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.
we just discussed with Franta and Tomas that here we should check both whether the user is a packager and has write access to the repo, so here we need to call the is_packager
(
def is_packager(self, user): |
We have discussed with Jirka that we will probably meet next Thursday to finish this. (And that we can help if needed.) |
I would open a followup to that :) so we can get this merged finally |
Feat(bodhi): Retrigger bodhi update via dist-git PR command I have rebased the Jirka K. work and I have used Mixins to manage Koji data needed to create a new bodhi update. This comes from #1654 Fixes #1541 Merge after packit/packit#1764 call is_packager as aked by Laura: #1654 (comment) Note: since I am using this method if for any reason the actor is None then the body update will succeed, I don't know if this could be a problem. RELEASE NOTES BEGIN Packit now allows to re-trigger Bodhi update via dist-git PR comment /packit create-update. RELEASE NOTES END Reviewed-by: Tomas Tomecek <[email protected]> Reviewed-by: Laura Barcziová <None> Reviewed-by: Maja Massarini <None>
I'm sorry it took so long. I couldn't find the time to come back to this issue recently 😞
note: OGR doesn't have
has_write_access
method. Not yet. I am going to implement it :)also help needed 😁:
test_bodhi_update_retrigger_via_dist_git_pr_comment
won't pass because because theCreateBodhiUpdateHandler.run
method is not called. Even though thetask.bodhi_update
task gets the signature of the Celery task. This means that theJobHandler.get_signature
method is executed and according to its documentation therun_bodhi_update
task should be run, but this obviously does not happen. Any idea why?Fixes #1541
Merge after org#742 packit#1729
RELEASE NOTES BEGIN
Packit now allows to re-trigger Bodhi update via dist-git PR comment
/packit create-update
.RELEASE NOTES END