fix: prevent publication with unsupported credential types#351
Merged
Conversation
6 tasks
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
============================================
- Coverage 72.02% 71.80% -0.22%
Complexity 162 162
============================================
Files 16 16
Lines 529 532 +3
Branches 50 51 +1
============================================
+ Hits 381 382 +1
- Misses 123 124 +1
- Partials 25 26 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
To restore the previous behaviour it may be cleaner to put it here: https://github.com/jenkinsci/github-checks-plugin/blob/master/src/main/java/io/jenkins/plugins/checks/github/SCMFacade.java#L125-L134 |
|
Can this be merged? :) @timja |
Member
|
heh I was giving @uhafner time to review as he seemed to get annoyed last time I merged same day. |
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.
fixes: #347
What changed?
Unsupported credential types are now explicitly made incompatible with the
github-checks-pluginto avoid downstream unexpected exceptions such as the one reported here.With this change, the supported credential types are:
GitHubAppCredentialsVaultUsernamePasswordCredentialImplIf an unsupported credential type is provided, an early
returnis done to avoid having to handle downstream exceptions caused by incompatible types. This means that all pipeline console log entries will be suppressed if the pipeline has not been configured with compatible credentials.Testing done
Procedure
As extracted from here, I have ran the following command to both build & run the test suite:
$ mvn -Penable-jacoco clean verify -B -V -ntp
A regression test was also carried out in our internal Jenkins controller to assert that previous functionality based on the above described credential types is left unaffected.