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

Allow users to add an issue/PR to a board in a different organization #142

Merged
merged 3 commits into from
Jul 21, 2022

Conversation

timrogers
Copy link
Contributor

At present, this Action only supports adding an issue or pull request to a project in the same organization as the issue or pull request itself.

This removes that limitation. If the issue/pull request and project have different owners, then instead of directly creating a project item, we will instead create a "draft issue" which will be added to the board.

Fixes #74.

Note that there are pre-existing failing tests in this branch which fail even before my code changes - see #140 for details.

@timrogers timrogers requested a review from a team as a code owner June 30, 2022 12:58
@mattcosta7
Copy link
Contributor

This removes that limitation. If the issue/pull request and project have different owners, then instead of directly creating a project item, we will instead create a "draft issue" which will be added to the board.

I don't believe this would be the right way to handle these cases, since draft issues aren't linked to their underlying content, so the actual issue/pr isn't linked directly.

I don't know, offhand, the origin of this limitation - but I think it's much more likely we'd want a holistic improvement to this in projects instead of attempting to workaround it in a non-intuitive way that might also be confusing.

Draft issues are also non-unique so this could potentially create multiple draft issues with the same content, for instance if a user applies a label, unapplies it, and then reapplies it 2 drafts for the same issue will have been created

@timrogers
Copy link
Contributor Author

@mattcosta7 Thanks for taking the time to review this PR. That's really interesting! I wasn't aware of those limitations - I just saw that you could paste the URL of an external issue into a project board and the title (etc.) showed up, and I thought that would do the trick 😓

Would you be open to having this as some kind of advanced, optional case - perhaps configured with a boolean option which defaults to "off"? Being able to manage external issues using this workflow would be really valuable to me.

If it's a no (which I understand), then I'll fork this and create my own similar action which offers this functionality, but makes the trade-offs clear.

@timrogers timrogers force-pushed the timrogers/draft-issue branch from 1e050d8 to 379a03c Compare June 30, 2022 13:49
@mattcosta7
Copy link
Contributor

@mattcosta7 Thanks for taking the time to review this PR. That's really interesting! I wasn't aware of those limitations - I just saw that you could paste the URL of an external issue into a project board and the title (etc.) showed up, and I thought that would do the trick 😓

Would you be open to having this as some kind of advanced, optional case - perhaps configured with a boolean option which defaults to "off"? Being able to manage external issues using this workflow would be really valuable to me.

If it's a no (which I understand), then I'll fork this and create my own similar action which offers this functionality, but makes the trade-offs clear.

We can take a look. urls do resolve when pasted - I'm not sure offhand whether the graphql api handles this, but if so, that makes sense, and wouldn't have the limitations I discussed!

@timrogers
Copy link
Contributor Author

We can take a look. urls do resolve when pasted - I'm not sure offhand whether the graphql api handles this, but if so, that makes sense, and wouldn't have the limitations I discussed!

I have tested this out extensively, and the URLs do resolve if you use the "create draft issue" GraphQL mutation. You seem to get the exact same result as pasting a URL onto the board.

@timrogers timrogers force-pushed the timrogers/draft-issue branch from 379a03c to 42cc560 Compare June 30, 2022 14:29
At present, this Action only supports adding an issue or pull
request to a project in the *same organization* as the issue or
pull request itself.

This removes that limitation. If the issue/pull request and
project have different owners, then instead of directly
creating a project item, we will instead create a "draft issue"
which will be added to the board.

Fixes actions#74.
@timrogers timrogers force-pushed the timrogers/draft-issue branch from 42cc560 to ebd4dc5 Compare July 15, 2022 10:26
@timrogers
Copy link
Contributor Author

@mattcosta7 Just to a reminder to take a look at this when you have a chance ❤️ Thank you so much!

@mattcosta7
Copy link
Contributor

mattcosta7 commented Jul 21, 2022

@mattcosta7 Just to a reminder to take a look at this when you have a chance ❤️ Thank you so much!

hey @timrogers sorry - had a really hectic week

I think we'll take this as is for now. We'll eventually remove this in favor of a more direct way to manage cross-org work, but for now unblocking this makes sense to me

Really appreciate the diligence here!

@mattcosta7 mattcosta7 merged commit a9f041d into actions:main Jul 21, 2022
@mattcosta7
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

Add elements from repositories under different org / owner
2 participants