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

JENKINS-64662 Create GitHub App Credentials Binding to support owner override #375

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

nrayapati
Copy link
Member

@nrayapati nrayapati commented Jan 23, 2021

Description

Create GitHub App Credentials Binding to support owner override
See JENKINS-64662 for further information.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

@bitwiseman @timja

Testing Results

Screen Shot 2021-01-22 at 8 47 08 PM

@nrayapati
Copy link
Member Author

@bitwiseman @timja thoughts on this change?

@nrayapati
Copy link
Member Author

Really appreciate any feedback and steps to get this merged and released soon. Thank you!

@bitwiseman
Copy link
Contributor

I have not updated this to deal with autoformatting.

The steps needed:

$ git merge task/formatting-base
# resolve conflicts
$ mvnd spotless:apply && git commit -am "Apply autoformatting" && git merge -Xours upstream/master

@nrayapati
Copy link
Member Author

@bitwiseman Thank you for the feedback and addressed it.

cachedTokens = new ArrayList<>();
} else {
Optional<AppInstallationToken> tempToken =
cachedTokens.stream()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are just going to keep one token wouldn't a Map make more sense and be more clear?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried Map and changed it to List, I think I did that to avoid adding overrides to serialize/deserialize as this is transient field.

I think it is good to have that owner field with actual class just in case if we are going to use this token for future use cases across other classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried Map and changed it to List, I think I did that to avoid adding overrides to serialize/deserialize as this is transient field.

Not sure why this is a reason to use List instead of Map.

I think it is good to have that owner field with actual class just in case if we are going to use this token for future use cases across other classes.

I'm not sure what you mean here.

@carlossg
Copy link
Contributor

carlossg commented Mar 7, 2021

In my case this doesn't solve the underlying issue, in a multibranch pipeline job I would still need one credential per organization to do the repository scan.

@nrayapati
Copy link
Member Author

@bitwiseman Any other thoughts on this change?, looks like we have closed the other PR that carlossg proposed

synchronized (this) {
return cachedToken;
return cachedTokens;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to other recent changes, we should look at using concurrent hash map instead.

@ebirn
Copy link

ebirn commented Dec 28, 2021

Hi all,
Thanks for that work! I'm not a Jenkins developer, but highly interested in getting this feature integrated.
(My use-case is a single Github app by our institution, for internal customers in different Github Orgs)
I would like to provision the Github App Credentials once in Jenkins, and reuse it in the context of different Github Org owners.

How can I help to get this merged and released?
Best,
Erich

@jglick
Copy link
Member

jglick commented Mar 23, 2022

Not sure I see the point of this. You can already specify an owner…?

@jglick
Copy link
Member

jglick commented Mar 23, 2022

Perhaps #527 covers your requirement.

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