-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add GitHub scm source implementation for status checks properties #66
Add GitHub scm source implementation for status checks properties #66
Conversation
XiongKezhi
commented
Oct 15, 2020
•
edited
Loading
edited
- Implementing Add the ability to allow users to customize status checks checks-api-plugin#31 to enable customized status checks for GitHub SCM Source projects.
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.
Does this approach work the plain GitSCM as well?
pom.xml
Outdated
@@ -25,7 +25,7 @@ | |||
<useBeta>true</useBeta> | |||
|
|||
<!-- Jenkins Plug-in Dependencies Versions --> | |||
<checks-api.version>1.0.2</checks-api.version> | |||
<checks-api.version>2.0.0-SNAPSHOT</checks-api.version> |
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.
It would make sense to use the associated incrementals build:
https://repo.jenkins-ci.org/incrementals/io/jenkins/plugins/checks-api/
/** | ||
* {@inheritDoc} | ||
*/ |
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.
Such comments can be removed since the IDE is smart enough
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.
I added more meaningful docs.
.filter(t -> t instanceof GitHubSCMSourceStatusChecksTrait) | ||
.findFirst() | ||
.map(t -> (GitHubSCMSourceStatusChecksTrait)t) | ||
.orElseThrow(IllegalStateException::new); |
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.
Are you planning to add a test? It is hard to follow the setup here.
If there is no trait defined then an exception will be thrown, is this intended?
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.
No, just a problem in my logic. Fixed.
No, I'll implement a trait for GitSCM after this. The logic is mostly the same. |
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
============================================
+ Coverage 79.30% 81.03% +1.73%
- Complexity 106 121 +15
============================================
Files 8 10 +2
Lines 343 385 +42
Branches 36 37 +1
============================================
+ Hits 272 312 +40
- Misses 50 52 +2
Partials 21 21
Continue to review full report at Codecov.
|
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.
could you add a screenshot showing the UI for this?
...ain/resources/io/jenkins/plugins/checks/github/GitHubSCMSourceStatusChecksTrait/config.jelly
Outdated
Show resolved
Hide resolved
...ain/resources/io/jenkins/plugins/checks/github/GitHubSCMSourceStatusChecksTrait/config.jelly
Outdated
Show resolved
Hide resolved
Any docs needed? |
ok, I will add it. |
Co-authored-by: Tim Jacomb <[email protected]>
@@ -23,6 +23,10 @@ This plugin has been installed, alone with the [General API Plugin](https://gith | |||
|
|||
By listening to the Jenkins builds, this plugin will automatically publish statuses (pending, in progress, and completed) to GitHub. | |||
|
|||
The status checks can be customized by configuring the "Status Checks Properties" behaviour for you GiHub Source (similar behaviour for Git SCM will be provided soon): | |||
|
|||
![Status Checks Properties](docs/images/status-checks-properties.png) |
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.
might want to fix your spelling of customized in the screenshot
README.md
Outdated
|
||
The status checks can be customized by configuring the "Status Checks Properties" behaviour for you GiHub Source (similar behaviour for Git SCM will be provided soon): | ||
However, this is not a default feature. |
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.
hmm don't we want it to be the default (like it currently is) by just installing this plugin?
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.
oh, I mixed up:dizzy_face:, so let me make it clear:
- in checks-api, we set the default value of
skip
to be true, so users won't get logs when no implementation is installed; - in github-checks, we set the default value of
skip
to be false, so users can get statuses as long as they installed the implementation, even they didn't add the trait at all?