-
Notifications
You must be signed in to change notification settings - Fork 44
Change default behaviour of "Suppress progress updates in job check" #299
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package io.jenkins.plugins.checks.github; | ||
|
|
||
| import hudson.Extension; | ||
| import jenkins.model.GlobalConfiguration; | ||
| import net.sf.json.JSONObject; | ||
| import org.kohsuke.stapler.StaplerRequest; | ||
|
|
||
| @Extension | ||
| public class GitHubChecksGlobalConfig extends GlobalConfiguration { | ||
|
|
||
|
|
||
| private boolean skipProgressUpdates = false; | ||
| private boolean enforceSkipProgressUpdates = false; | ||
|
|
||
| public static GitHubChecksGlobalConfig get() { | ||
| return GlobalConfiguration.all().get(GitHubChecksGlobalConfig.class); | ||
| } | ||
|
|
||
| public GitHubChecksGlobalConfig() { | ||
| load(); | ||
| } | ||
|
|
||
| public synchronized boolean isSkipProgressUpdates() { | ||
| return skipProgressUpdates; | ||
| } | ||
|
|
||
| public synchronized void setSkipProgressUpdates(boolean skipProgressUpdates) { | ||
| this.skipProgressUpdates = skipProgressUpdates; | ||
| save(); | ||
| } | ||
|
|
||
| public synchronized boolean isEnforceSkipProgressUpdates() { | ||
| return enforceSkipProgressUpdates; | ||
| } | ||
|
|
||
| public synchronized void setEnforceSkipProgressUpdates(boolean enforceSkipProgressUpdates) { | ||
| this.enforceSkipProgressUpdates = enforceSkipProgressUpdates; | ||
| save(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean configure(StaplerRequest req, JSONObject json) throws FormException { | ||
| req.bindJSON(this, json); | ||
| return true; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?jelly escape-by-default='true'?> | ||
| <j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form"> | ||
| <f:section title="GitHub Checks Global Configuration"> | ||
| <f:entry title="${%Suppress progress updates in job check}" field="skipProgressUpdates" | ||
| description="${%Queued, checkout and completed will still be sent}"> | ||
| <f:checkbox default="${descriptor.defaultSkipProgressUpdates}"/> | ||
| </f:entry> | ||
| <f:entry title="${%Enforce global setting suppress progress updates in job check}" field="enforceSkipProgressUpdates" | ||
| description="${%Enforce this setting.}"> | ||
| <f:checkbox/> | ||
| </f:entry> | ||
| </f:section> | ||
| </j:jelly> |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,17 +9,19 @@ | |||||||
| <f:textbox default="Jenkins"/> | ||||||||
| </f:entry> | ||||||||
|
|
||||||||
|
|
||||||||
| <f:entry title="${%Publish unstable builds as neutral status checks}" field="unstableBuildNeutral"> | ||||||||
| <f:checkbox/> | ||||||||
| </f:entry> | ||||||||
|
|
||||||||
| <f:entry title="${%Suppress log output in checks}" field="suppressLogs"> | ||||||||
| <f:checkbox/> | ||||||||
| </f:entry> | ||||||||
|
|
||||||||
| <f:entry title="${%Suppress progress updates in job check}" field="skipProgressUpdates" | ||||||||
| description="${%Queued, checkout and completed will still be sent}"> | ||||||||
| <f:checkbox/> | ||||||||
| </f:entry> | ||||||||
|
|
||||||||
| <j:var set="readOnlyMode" value="${descriptor.enforceSkipProgressUpdates}" /> | ||||||||
| <j:if test="${!readP}"> | ||||||||
|
Comment on lines
+20
to
+21
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just do this?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same result. We built that complicated workaround because this did not work initially. |
||||||||
| <f:entry title="${%Suppress progress updates in job check}" field="skipProgressUpdates" | ||||||||
| description="${%Queued, checkout and completed will still be sent}"> | ||||||||
| <f:checkbox default="${descriptor.defaultSkipProgressUpdates}"/> | ||||||||
| </f:entry> | ||||||||
| </j:if> | ||||||||
|
Comment on lines
+20
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would need some advice on Jelly conditional rendering here.. we try to hide the option on the jobs, if the global configuration says that the option is enforced. |
||||||||
| </j:jelly> | ||||||||
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.
these shouldn't be final / static, why do you need them in here? these will only get set on jenkins start