-
Notifications
You must be signed in to change notification settings - Fork 385
[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
Conversation
…pdate tests - Updated logic so that only the copilot user is allowed to bypass missing name and email checks in pull request processing. - All other users without name/email are marked as unknown and a log message is generated. - Added and updated tests to verify that copilot is accepted and handled as expected.
I see no evidence of such a change in the current patch; did you revert it? If so, please update the PR description accordingly. |
| try { | ||
| user = pr.getUser(); | ||
| if (users.containsKey(user.getLogin())) { | ||
| // looked up this user already |
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
| 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 comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| // store the populated user record now that we have it | ||
| 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 comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this was just false.
|
Dear @jglick and @IvanGasant , Do you have an estimated timeline for merging this pull request and creating a new release? I'm particularly interested in this fix, as it's currently blocking some of our Jenkins CI/CD workflows when Copilot creates pull requests in our repositories. Thank you! |
|
Hey @IvanGasant , thanks a lot for your contribution! |
|
It's true that Jesse did approve the pull request but a few comments were not addressed, specifically about retaining the comments, for future reviewers. |
Thank you Adrien for your reply. |
|
It would be nice if @IvanGasant could manage the comments to merge this PR. |
fruch
left a comment
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.
LGTM
|
we are running into this issue as well, is there any way around it until this get merged and released ? |
|
Hi everyone, thank you for your comments and for your interest in this PR. Apologies for the delay in progressing with this—it’s been a busy period for me, but I plan to resume work on it soon. I’ll make sure to address all suggestions and questions raised and will keep you updated on my progress. If there’s any particular priority or information you need, please let me know. Thanks again for your patience! |
|
Ready for Review @jglick |
|
I am not maintaining this plugin, will leave it some other maintainer. |
Description
This PR improves the handling of pull requests and commits authored by GitHub IA, Copilot, who may not have a real GitHub account or may lack a defined name or email.
It prevents exceptions and ensures that these contributions are not discarded during indexing or processing.
Changes
Special handling for the "copilot" user:
"copilot", a syntheticContributorMetadataActionis created with:"copilot""[email protected]"Other users:
login,name, andemail) with no fallback.If
user.getName()oruser.getEmail()arenull, those fields will remainnullas before.Unchanged logic for missing users:
Motivation
GitHub Copilot and other bots can appear as authors of commits and pull requests, but may not exist as real users in GitHub.
Without this special handling, such PRs would be discarded or cause exceptions, impacting the visibility and traceability of AI-generated or bot-generated contributions.
See JENKINS-75704 for further information.
Submitter checklist
No automated tests were added because this is a trivial change: it only handles null values or exceptions when fetching the GitHub user's name/email for logging purposes, defaulting to safe values if missing. It does not affect business logic or the core functionality of the plugin.
Reviewer checklist
Documentation changes
Users/aliases to notify