-
Notifications
You must be signed in to change notification settings - Fork 370
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-62220] Automatically select owner
for GitHubAppCredentials
acc. to context
#527
Conversation
owner
for GitHubAppCredentials
acc. to requesting Run
owner
for GitHubAppCredentials
acc. to context
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.
nice, long standing issue where you had to duplicate this
…ource-plugin into Credentials.forRun
… flaking; use `closeTo` for actual times
} | ||
|
||
@NonNull | ||
@Override |
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.
Or could comment this out while reverting POM changes.
Includes GitHub App authentication enhancement from Jesse Glick for credentials by context. jenkinsci/github-branch-source-plugin#527 needs this so that it can use the enhancement in jenkinsci/credentials-plugin#293 Otherwise `withCredentials` works but `checkout scm` does not work
jenkinsci/github-branch-source-plugin#527 is a draft pull request to automatically select owner for GitHubAppCredentials acc. to context. https://issues.jenkins.io/browse/JENKINS-62220 asks to allow GitHub Apps to support credentials with multiple organizations
hate to bother you like this, but I encoutered https://issues.jenkins.io/browse/JENKINS-70984 this issue recently, I tried to fix other issue by two pr above, but this one is really hard for me, could you please help me with that, the reason seems to be that the git client is not passing context when getting credential.
could you please hint me or give me some document to read so I can figure it out? |
https://issues.jenkins.io/browse/JENKINS-62220
Uses jenkinsci/credentials-plugin#293 to ensure that the
owner
field may be left blank yet the appropriate org will still be selected for a particular build. (At least assuming the lookup is viaCredentialsProvider.findCredentialById
, which passes aRun
, as it would be for example in awithCredentials
block.)See discussions e.g. at #290 (comment) or #269 (comment).
Tested with jenkinsci/git-plugin#1242 and an App installed on my account as well as a test org. Was able to create a multibranch project on a private repo in my account
and run builds and get commit statuses.
When creating the App credentials, if you want to use the Test Connection button, you need to temporarily enter an Owner since otherwise there is no context, but you do not need to save it. When selecting the credentials in a dropdown on a branch source, the automatic connection check (which shows the remaining rate limit) will work so long as you have typed in an owner (org folder) or repo URL (multibranch folder).