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

Command to move issue to a new repository #18117

Closed
sftim opened this issue Jun 30, 2020 · 18 comments · Fixed by #23153
Closed

Command to move issue to a new repository #18117

sftim opened this issue Jun 30, 2020 · 18 comments · Fixed by #23153
Assignees
Labels
area/prow Issues or PRs related to prow kind/feature Categorizes issue or PR as related to a new feature. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience.

Comments

@sftim
Copy link
Contributor

sftim commented Jun 30, 2020

What would you like to be added:
GitHub lets you transfer an issue to another repository. I think this requires the GraphQL API.

Approvers with the appropriate access should be able to use a command to trigger moving an issue to a different repository.

Why is this needed:

Sometimes, people open great issues but in the wrong repository (eg documentation issues that ought to live in k/website in k/kubernetes, or issues about the built-in help for kubectl, which is mirrored onto the website, that should actually live in k/kubectl).

Rather than tell those people that the great issue they've filed is in the wrong place, we can add tools to help the person doing triage move it there.

At the moment you need write access on both repositories to do the transfer, so there are few people with the privileges to implement moves. Involving test-infra automation can add richer access controls and broaden the number of people able to take part in this aspect of triage.

@sftim sftim added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 30, 2020
@BenTheElder BenTheElder added the area/prow Issues or PRs related to prow label Jun 30, 2020
@prasadkatti
Copy link

Another common use case would be k/website to k/minikube.

@sftim
Copy link
Contributor Author

sftim commented Jul 11, 2020

An example of an issue I'd nominate for move: kubernetes/website#22465

@spiffxp
Copy link
Member

spiffxp commented Sep 11, 2020

It looks like this isn't possible via the v3 api, would have to be done via the v4 graphql api, it's unclear to me whether different plugins could be written against different api's

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 10, 2020
@sftim
Copy link
Contributor Author

sftim commented Dec 18, 2020

I'd like to see this implemented, but it wouldn't be used very often.

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 17, 2021
@sftim
Copy link
Contributor Author

sftim commented Jan 30, 2021

Another example of an issue where Prow-facilitated moves could be useful: kubernetes/kubernetes#98368

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 30, 2021
@spiffxp
Copy link
Member

spiffxp commented Feb 1, 2021

/sig contributor-experience
/assign @rikatz
mentioned a proposal to write such a plugin in #sig-contribex https://kubernetes.slack.com/archives/C1TU9EB9S/p1611252110007400

proposal: https://docs.google.com/document/d/1uqKI5QEAh2fnq7LRRz-2Mhf-jInIpuiAUnPow36jCVU/edit?usp=sharing

@k8s-ci-robot k8s-ci-robot added the sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. label Feb 1, 2021
@rikatz
Copy link
Contributor

rikatz commented Feb 1, 2021

Thanks Aaron

/assign @dougsland (Doug is going to work on this with me)

@rikatz
Copy link
Contributor

rikatz commented Feb 1, 2021

/assign @dougsland

@rikatz
Copy link
Contributor

rikatz commented Mar 19, 2021

OK, so I've started to look into the viability of this. Unfortunately Github does not support Issue move on their API. The Update endpoint only allows to update the title, body but not the owner or the repo.

I'm not sure if the GraphQL already supports this, should take a look, but AFAIK the Prow Github Client uses the rest/v3 API. Maybe this need to be an external plugin.

Doing some call debugging, I've seen that the process is basically:

  • On an issue, call a POST with the "/transfer" endpoint (let's say github.com/myorg/myrepo/issues/1/transfer)
  • On the request body, pass an authenticity_token (need to check if this can be an OAUTH, or what is this), the internal issue ID encoded in base64 (issue_id=MDU6SXNzdWU4MzYwMjczNzc= which means "05:Issue836027377" and the repository_id the same way

So here is the fun part: The meaning of "05:Issue836027377" is: the next field have 5 characters after ":" (Issue string) and then its internal issue ID (not the Number), so when moving, we should know the internal Issue ID, and the destination repo ID.

I'm not sure if we may have this sort of logic internally on some plugin, or if we should wait some API to rise (although the feature is from 2018, I guess).

I will continue to explore some options on this.

Oh, also one issue can be moved only between repos on the same org

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 17, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 17, 2021
@eddiezane
Copy link
Member

/remove-lifecycle rotten

Looks like the GraphQL API does allow this.

https://docs.github.com/en/graphql/reference/mutations#transferissue

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 5, 2021
@eddiezane
Copy link
Member

Oh and here is how hub implements it!

https://github.com/github/hub/pull/2363/files

@eddiezane
Copy link
Member

@eddiezane
Copy link
Member

I started working on this in #23153

/assign

@rikatz
Copy link
Contributor

rikatz commented Aug 6, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prow Issues or PRs related to prow kind/feature Categorizes issue or PR as related to a new feature. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants