-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Project Management: Prompt user to link GitHub account to WordPress.org profile #21221
Conversation
Size Change: +7.06 kB (0%) Total Size: 866 kB
ℹ️ View Unchanged
|
The API usage looks correct, however, the API will throw a Please also make sure the request comes with a clear UserAgent that our systems team can differentiate from other random clients to avoid unintentional blocking/rate-limiting. |
This is great! I'd use a few contractions -- they'll make it sound a little friendlier/less formal -- and tighten up a sentence here and there, but nothing big:
|
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 working on this, @aduth! Can you confirm where this prompt will show up? Reading through the code, it looks like it will be added inline as a comment. Do automated comments notify the person like normal issue/pull request activity?
const author = payload.pull_request.user.login; | ||
if ( payload.ref !== 'refs/heads/master' ) { | ||
debug( | ||
'add-first-time-contributor-label: Commit is not to `master`. Aborting' |
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.
Would it make sense to display the prompt regardless of branch? If they are opening a PR, it shows they are interested in contributing. Why not catch them the first time regardless of branch?
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.
Would it make sense to display the prompt regardless of branch? If they are opening a PR, it shows they are interested in contributing. Why not catch them the first time regardless of branch?
Unfortunately, it's not possible, related to this point from the original comment:
due to permission constraints of GitHub Actions, labels cannot be applied by actions if the originating repository is a fork of Gutenberg.
A commit pushed to a branch originating from a fork would fall under these restrictions.
It works for commits to master, since it's within the source repository, committed by someone with permissions to push to master.
It will show up as a comment by
Yes, it's as if a real human commented on the pull request. |
Thanks. Reflecting on this, I think I may refactor to remove the https://nodejs.org/api/https.html#https_https_get_url_options_callback Maybe a
Will do!
Thanks for the copy review, @michelleweber ! I'll make these adjustments.
What @noisysocks said 😄 I believe it should appear identically as in the bot comment above, #21221 (comment) . Aside from the content itself, that is. |
… firstTimeContributor
Updated in eb1dff6 (with additional revisions in 83ef4d6, 26ddea3).
Added in 0d338e5. I went with
Updated the prompt in 6bedde8. |
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.
The code looks good to me and Travis CI suggests that your tests and type-checks are passing. There's only one way to see if it actually works 😀🚢
Let's give it a try! |
And... it works! #21240 (comment) 🎉 |
Nice! I wonder if it's worth including an @ mention of the PR author in the comment text. |
It's a good idea! It might require a small refactoring of the current implementation, since the current text is just a static string, and such a change would need to adjust it to be generated dynamically instead. |
See #21384 |
Related:
This pull request seeks to fix and enhance the existing "First Time Contributor" project management automation to prompt the user to link their GitHub account to their WordPress.org profile if necessary for release props credit.
Currently, the prompt is:
(Click to expand for initial prompt proposed)
>Congratulations on your first merged pull request! We would like to give you credit for your contribution in the next WordPress release, but we were unable to find a WordPress.org profile associated with your GitHub account. At your convenience, please visit the following URL and click "link your GitHub account" under "GitHub Username" to initiate the process to link your accounts: > >https://profiles.wordpress.org/me/profile/edit/ > >If you do not have a WordPress.org account, you can create one at the following page: > >https://login.wordpress.org/registerFeedback is very welcome for adjustments to the phrasing (I've also applied "Needs Copy Review" label to this pull request).Reviewed at #21221 (comment).The prompt is presented under the following conditions:
As noted, this also fixes the "First Time Contributor" task, which was intended to be applying the "First Time Contributor" label to a pull request opened by a new contributor. Unfortunately, due to permission constraints of GitHub Actions, labels cannot be applied by actions if the originating repository is a fork of Gutenberg. Since the vast majority of new contributors will not have branching permissions of this repository, this made the task near-useless. This is resolved by adopting a similar approach of #20058 : The task is run on commit to master, where full permissions are granted. This means that the label is only applied after merge, which is not perfect, but certainly an improvement. Coincidentally, this complements the goal of prompting the user to link their accounts upon merge.
Testing Instructions:
There are unit tests:
But the most accurate test won't be 'til we can have it running live 😅