Skip to content
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

backport-create-issue: copy 'Assignee' of original issue to backports #46395

Merged
merged 1 commit into from May 31, 2022

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented May 25, 2022

following up on discussion from today's leadership call about who's responsible for preparing backport PRs. i think it would be useful to copy the 'Assignee' field from the original tracker issue, so that person is aware that backports are needed

TODO: actually test that this works, both for tracker issues with/without an Assignee field

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

Copy link
Member

@epuertat epuertat left a comment

Choose a reason for hiding this comment

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

Nice!

@idryomov
Copy link
Contributor

TODO: actually test that this works, both for tracker issues with/without an Assignee field

Yeah, hopefully (python-)redmine doesn't insist on a real user id if the optional assigned_to_id key is provided. This maxtepkeev/python-redmine@99298ee gives hope that it doesn't and the unassigned case is handled implicitly.

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

yes!

@cbodley
Copy link
Contributor Author

cbodley commented May 26, 2022

Yeah, hopefully (python-)redmine doesn't insist on a real user id if the optional assigned_to_id key is provided.

thanks, i wasn't entirely sure that it would copy Noneness

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley force-pushed the wip-backport-create-issue-assigned-to branch from 16d9b88 to d445e02 Compare May 27, 2022 17:57
@cbodley
Copy link
Contributor Author

cbodley commented May 27, 2022

apparently not:

Traceback (most recent call last):
  File "/home/cbodley/ceph/src/script/backport-create-issue", line 344, in <module>
    iterate_over_backports(redmine, issues, dry_run=args.dry_run)
  File "/home/cbodley/ceph/src/script/backport-create-issue", line 299, in iterate_over_backports
    update_relations(r, issue, dry_run)
  File "/home/cbodley/ceph/src/script/backport-create-issue", line 226, in update_relations
    assigned_to_id=issue.assigned_to_id,
  File "/home/cbodley/ceph/build/venv/lib/python3.10/site-packages/redminelib/resources/standard.py", line 152, in __getattr__
    return super(Issue, self).__getattr__(attr)
  File "/home/cbodley/ceph/build/venv/lib/python3.10/site-packages/redminelib/resources/base.py", line 197, in __getattr__
    raise exceptions.ResourceAttrError
redminelib.exceptions.ResourceAttrError: Resource doesn't have the requested attribute

for an assigned issue, i had to use issue.assigned_to.id to get its id. for an unassigned issue, trying to access issue.assigned_to throws this same ResourceAttrError

@cbodley
Copy link
Contributor Author

cbodley commented May 27, 2022

i created 2 dummy tracker issues under the rgw project:

the script succeeded for both:

(venv) cbodley@localhost ~/ceph/build $ ../src/script/backport-create-issue 55781
WARNING:root:Missing issues will be created in Backport tracker of the relevant Redmine project
INFO:root:Redmine key was read from '~/.redmine_key'; using it
INFO:root:Processing issue list ->55781<-
INFO:root:Processing 1 issues with status Pending Backport
INFO:root:https://tracker.ceph.com/issues/55781 added backport to quincy https://tracker.ceph.com/issues/55784
INFO:root:Processed 1 issues
(venv) cbodley@localhost ~/ceph/build $ ../src/script/backport-create-issue 55780
WARNING:root:Missing issues will be created in Backport tracker of the relevant Redmine project
INFO:root:Redmine key was read from '~/.redmine_key'; using it
INFO:root:Processing issue list ->55780<-
INFO:root:Processing 1 issues with status Pending Backport
INFO:root:https://tracker.ceph.com/issues/55780 added backport to quincy https://tracker.ceph.com/issues/55786
INFO:root:Processed 1 issues

and the resulting backport issues have the correct Assignee:

@cbodley cbodley marked this pull request as ready for review May 27, 2022 18:07
@cbodley cbodley changed the title [RFC] backport-create-issue: copy 'Assignee' of original issue to backports backport-create-issue: copy 'Assignee' of original issue to backports May 27, 2022
@cbodley cbodley merged commit 266da4a into ceph:main May 31, 2022
@cbodley cbodley deleted the wip-backport-create-issue-assigned-to branch May 31, 2022 15:17
@cbodley
Copy link
Contributor Author

cbodley commented Aug 4, 2022

cc @djgalloway

does anyone know where the automated backport-create-issue script runs? it doesn't seem to have gotten this update yet. can we figure out how to update it?

@epuertat
Copy link
Member

epuertat commented Aug 4, 2022

cc @djgalloway

does anyone know where the automated backport-create-issue script runs? it doesn't seem to have gotten this update yet. can we figure out how to update it?

@cbodley If I'm not wrong @batrick set up a cron job (but I don't know where). Maybe that's checking out master instead of main?

Given Github Actions allow for scheduled/cron jobs, what about putting the BackportBot under .github/workflows?

@batrick
Copy link
Member

batrick commented Aug 4, 2022

cc @djgalloway
does anyone know where the automated backport-create-issue script runs? it doesn't seem to have gotten this update yet. can we figure out how to update it?

@cbodley If I'm not wrong @batrick set up a cron job (but I don't know where). Maybe that's checking out master instead of main?

I'm running on the teuthology VM. I had a cronjob that did get fetch and checkout of master. It's now updated to main.

Given Github Actions allow for scheduled/cron jobs, what about putting the BackportBot under .github/workflows?

I'm okay with it. If you're familiar with it, do you mind setting that up? I can give you the login details of backportbot over gchat.

@epuertat
Copy link
Member

epuertat commented Aug 5, 2022

@batrick @cbodley I drafted this PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants