Merged
Conversation
gitcommitshow
commented
Sep 26, 2024
|
|
||
| - [x] When an external contributor (not the internal team) raises a PR, post a comment to sign CLA and label PR `Pending CLA` | ||
| - [x] On signing CLA, remove `Pending CLA` label and never ask that user to sign the CLA again on any of our repo in future | ||
| - [x] On signing CLA, remove `Pending CLA` label from all the PRs of that user. Never ask that user to sign the CLA on any of our repo in future |
Owner
Author
There was a problem hiding this comment.
Suggested change
| - [x] On signing CLA, remove `Pending CLA` label from all the PRs of that user. Never ask that user to sign the CLA on any of our repo in future | |
| - [x] On signing CLA, remove `Pending CLA` label from all the open PRs created by that contributor. Never ask that contributor to sign the CLA on any of our repo in future |
src/helpers.js
Outdated
| const filteredPrs = prs.filter(pr => pr.user.login === githubUsername); | ||
| console.log(`Found ${filteredPrs.length} open PRs for ${githubUsername} in ${org}:`, filteredPrs.map(pr => pr.number).join(', ')); | ||
|
|
||
| for await (const { installation } of app.eachInstallation.iterator()) { |
Owner
Author
There was a problem hiding this comment.
Is this really needed?
- Why not use the app.octokit instance for removeLabel call?
- Is installationId (and hence auth scope) different for different repo of the same org?
- Can we have a more unified way to get the correct authenticated octokit instance? e.g. getAuthenticatedInstance(repo, type)
gitcommitshow
commented
Sep 26, 2024
src/helpers.js
Outdated
| const hasPendingCLALabel = pr.labels?.some(label => label?.name?.toLowerCase() === "pending cla"); | ||
| console.log(`PR #${pr.number} has "Pending CLA" label: ${hasPendingCLALabel}`); | ||
| if (hasPendingCLALabel) { | ||
| await removePendingCLALabel(app.octokit, org, repository.name, pr.number); |
Owner
Author
There was a problem hiding this comment.
Suggested change
| await removePendingCLALabel(app.octokit, org, repository.name, pr.number); | |
| await removePendingCLALabel(app.octokit, org, pr?.repository?.name, pr.number); |
src/helpers.js
Outdated
| if (hasPendingCLALabel) { | ||
| await removePendingCLALabel(app.octokit, org, repository.name, pr.number); | ||
| } else { | ||
| console.log(`PR #${pr.number} in ${org}/${repository.name} does not have "Pending CLA" label. Skipping.`); |
Owner
Author
There was a problem hiding this comment.
Suggested change
| console.log(`PR #${pr.number} in ${org}/${repository.name} does not have "Pending CLA" label. Skipping.`); | |
| console.log(`PR #${pr.number} in ${org}/${pr?.repository.name} does not have "Pending CLA" label. Skipping.`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.