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

Use correct getters for note fields #1607

Merged
merged 2 commits into from
Jul 15, 2024
Merged
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
23 changes: 19 additions & 4 deletions src/main/java/hudson/plugins/git/GitPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@

if (isPushNotes()) {
for (final NoteToPush b : notesToPush) {
if (b.getnoteMsg() == null)
if (b.getNoteMsg() == null)

Check warning on line 335 in src/main/java/hudson/plugins/git/GitPublisher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 335 is only partially covered, one branch is missing
throw new AbortException("No note to push defined");

b.setEmptyTargetRepoToOrigin();
String noteMsgTmp = environment.expand(b.getnoteMsg());
String noteMsgTmp = environment.expand(b.getNoteMsg());
final String noteMsg = replaceAdditionalEnvironmentalVariables(noteMsgTmp, build);
final String noteNamespace = environment.expand(b.getnoteNamespace());
final String noteNamespace = environment.expand(b.getNoteNamespace());
final String targetRepo = environment.expand(b.getTargetRepoName());
final boolean noteReplace = b.getnoteReplace();
final boolean noteReplace = b.getNoteReplace();

try {
// Lookup repository with unexpanded name as GitSCM stores them unexpanded
Expand Down Expand Up @@ -579,18 +579,33 @@
private String noteNamespace;
private boolean noteReplace;

@Deprecated
public String getnoteMsg() {
return noteMsg;
}

@Deprecated
public String getnoteNamespace() {
return noteNamespace;
}

@Deprecated
public boolean getnoteReplace() {
return noteReplace;
}

public String getNoteMsg() {
return noteMsg;
}

public String getNoteNamespace() {
return noteNamespace;
}

public boolean getNoteReplace() {
return noteReplace;
}

@DataBoundConstructor
public NoteToPush( String targetRepoName, String noteMsg, String noteNamespace, boolean noteReplace ) {
super(targetRepoName);
Expand Down