Skip to content

Commit

Permalink
fix global config is not saved (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 authored Dec 3, 2023
1 parent b342d7b commit 2f2db10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.425</jenkins.version>
<jenkins.version>2.426.1</jenkins.version>
</properties>

<developers>
Expand Down Expand Up @@ -61,8 +61,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.414.x</artifactId>
<version>2465.va_e76ed7b_3061</version>
<artifactId>bom-2.426.x</artifactId>
<version>2612.v3d6a_2128c0ef</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
import jenkins.appearance.AppearanceCategory;
import jenkins.model.GlobalConfiguration;
import jenkins.model.GlobalConfigurationCategory;
import net.sf.json.JSONObject;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.StaplerRequest;

@Symbol("customizeBuildNow")
@Extension
public class AlternateBuildLabelConfiguration extends GlobalConfiguration {

public AlternateBuildLabelConfiguration() {
load();
}

private String alternateBuildNow;

private String alternateBuildWithParams;
Expand Down Expand Up @@ -41,6 +47,13 @@ public void setAlternateBuildButton(String alternateBuildButton) {
this.alternateBuildButton = alternateBuildButton;
}

@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
super.configure(req, json);
save();
return true;

Check warning on line 54 in src/main/java/org/jenkinsci/plugins/customizebuildnow/AlternateBuildLabelConfiguration.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 52-54 are not covered by tests
}

public static AlternateBuildLabelConfiguration get() {
return GlobalConfiguration.all().get(AlternateBuildLabelConfiguration.class);
}
Expand Down

0 comments on commit 2f2db10

Please sign in to comment.