-
Notifications
You must be signed in to change notification settings - Fork 55
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
add function for adding assignees to issues #589
add function for adding assignees to issues #589
Conversation
Build failed.
|
40d1945
to
7e8c07b
Compare
Build failed.
|
Build failed.
|
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 PR, the code looks really good!
Regarding the tests, the code looks good but we need to generate the yaml files with the responses.
- As you might know from the contribution guide, If you run the tests locally, you need to provide github/gitlab/pagure tokens via env.var. and run the tests. This will touch the real services and save the responses to the yaml files. Those files need to be committed as well so we don't need to use secrets and touch the real services in CI. (Basically, it records the communication and removes the sensitive values.)
- Since it touches the real services, your account need to have the permissions to do assigning -- e.g. on GitHub, I can give you
triage
permission if you want. - I can also generate the response files for you. (I understand it's tricky for the first time.)
Thanks!
@lachmanfrantisek Do I just use my own personal access tokens for github/gitlab/pagure? |
@KPostOffice yes, but I think you need write access to the repository to set assignees... I think there is some test I have created before that used user-agnostic repository... lemme have a look... |
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. |
Build succeeded.
|
@lachmanfrantisek PTAL |
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!
Just one small suggestion, otherwise LGTM.
Can you please do rebase
instead of merge
so we have only one new commit that sits on top of the current main
branch? (Let me know if you need some help with that.)
Thank you for working on this!
ogr/services/gitlab/issue.py
Outdated
a = self._raw_issue.__dict__.get("assignee_ids") or [] | ||
for assignee in assignees: | ||
users = self.project.service.gitlab_instance.users.list( # type: ignore | ||
username=assignee | ||
) | ||
if not users: | ||
raise GitlabAPIException(f"Unable to find '{assignee}' username") | ||
uid = str(users[0].id) | ||
if uid not in a: | ||
a.append(str(users[0].id)) | ||
|
||
self._raw_issue.assignee_ids = a |
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.
Can we have a better name for the assignee list, please?
92b74b0
to
7f04a00
Compare
Build succeeded.
|
@lachmanfrantisek I addressed both comments. It should push on top of master nicely now. |
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.
Nice, thanks for the contribution!
Build failed (gate pipeline).
|
7f04a00
to
89c5e9b
Compare
Build succeeded.
|
Build succeeded (gate pipeline).
|
Closes: #586