Skip to content
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

fix global config is not saved #7

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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