-
Notifications
You must be signed in to change notification settings - Fork 375
[JENKINS-75704] Fix Copilot user null name/email handling #864
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
Open
IvanGasant
wants to merge
15
commits into
jenkinsci:master
Choose a base branch
from
IvanGasant:fix/copilot-null-user
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0478e77
Fix Copilot user null name/email handling
IvanGasant d8dec83
Fixing test
IvanGasant 261736b
Fixing test
IvanGasant 02629fa
Fixing test
IvanGasant 9707e94
Fixing tests
IvanGasant d12f3a5
Allow only the copilot user to bypass missing name/email checks and u…
IvanGasant 7a34162
Fixing
IvanGasant da39a6c
Fixing Format
IvanGasant f0e4131
Create sintetic user for copilot
IvanGasant fcf852d
Fixing format
IvanGasant adca923
Optimize code and remove comments
IvanGasant 6282a91
Fix format
IvanGasant 6242c5f
Fix format
IvanGasant 67ecab6
Merge branch 'master' into fix/copilot-null-user
IvanGasant 633c26f
Merge branch 'master' into fix/copilot-null-user
IvanGasant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2572,17 +2572,22 @@ | |
GHUser user = null; | ||
try { | ||
user = pr.getUser(); | ||
if (users.containsKey(user.getLogin())) { | ||
// looked up this user already | ||
user = users.get(user.getLogin()); | ||
String login = user.getLogin(); | ||
if ("copilot".equalsIgnoreCase(login)) { | ||
ContributorMetadataAction contributor = | ||
new ContributorMetadataAction("copilot", "copilot", "copilot@unknown.user"); | ||
pullRequestContributorCache.put(number, contributor); | ||
users.put("copilot", user); | ||
} else { | ||
if (users.containsKey(login)) { | ||
user = users.get(login); | ||
} | ||
ContributorMetadataAction contributor = | ||
new ContributorMetadataAction(login, user.getName(), user.getEmail()); | ||
pullRequestContributorCache.put(number, contributor); | ||
users.put(login, user); | ||
} | ||
ContributorMetadataAction contributor = | ||
new ContributorMetadataAction(user.getLogin(), user.getName(), user.getEmail()); | ||
pullRequestContributorCache.put(number, contributor); | ||
// store the populated user record now that we have it | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
users.put(user.getLogin(), user); | ||
} catch (FileNotFoundException e) { | ||
// If file not found for user, warn but keep going | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC this was just false. |
||
request.listener() | ||
.getLogger() | ||
.format( | ||
|
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.
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.
may as well retain this comment in the
else
clause