Skip to content

Commit

Permalink
fix #193
Browse files Browse the repository at this point in the history
- add missing parts for feature overrideResolvedIssues from PR #80
  • Loading branch information
chcg committed Dec 2, 2024
1 parent 83eba49 commit 57d95f6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ junit (
autoResolveIssue: false,
autoUnlinkIssue: false,
additionalAttachments: false,
overrideResolvedIssues: false,
)
]
)
Expand Down Expand Up @@ -120,6 +121,7 @@ Checking **Auto resolve issue** check box will enable an experimental feature. B

If you check the **Auto unlink issues when test passes** check box, this plugin will automatically unlink issues for all the tests changing to passed in new builds.

If you check the **Auto override resolved issues** check box, this plugin will newly create issues automatically for failing tests that are linked to already resolved issues.

![image of job config settings](img/job-config1.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public boolean getAutoUnlinkIssue() {
return JobConfigMapping.getInstance().getAutoUnlinkIssue(getJobName());
}

public boolean getOverrideResolvedIssues() {
return JobConfigMapping.getInstance().getOverrideResolvedIssues(getJobName());

Check warning on line 135 in src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestDataPublisher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 135 is not covered by tests
}

/**
* Getter for list of attachments by test method identified by its classname and name
* @param className
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ public boolean getAutoRaiseIssue() {
return autoRaiseIssue;
}

public boolean getOverrideResolvedIssues() {
return overrideResolvedIssues;
}

public boolean getAutoResolveIssue() {
return autoResolveIssue;
}
Expand All @@ -133,6 +129,10 @@ public boolean getAdditionalAttachments() {
return additionalAttachments;
}

public boolean getOverrideResolvedIssues() {
return overrideResolvedIssues;
}

/**
* Getter for the issue key pattern
* @return
Expand Down Expand Up @@ -189,11 +189,6 @@ public JobConfigEntryBuilder withAutoRaiseIssues(boolean autoRaiseIssues) {
return this;
}

public JobConfigEntryBuilder withOverrideResolvedIssues(boolean overrideResolvedIssues) {
this.overrideResolvedIssues = overrideResolvedIssues;
return this;
}

public JobConfigEntryBuilder withAutoResolveIssues(boolean autoResolveIssue) {
this.autoResolveIssue = autoResolveIssue;
return this;
Expand All @@ -209,6 +204,11 @@ public JobConfigEntryBuilder withAdditionalAttachments(boolean additionalAttachm
return this;
}

public JobConfigEntryBuilder withOverrideResolvedIssues(boolean overrideResolvedIssues) {
this.overrideResolvedIssues = overrideResolvedIssues;
return this;
}

public JobConfigEntry build() {
if (projectKey == null) {
throw new IllegalStateException("The Project Key may not be null");
Expand Down Expand Up @@ -449,11 +449,6 @@ public boolean getAutoRaiseIssue(Job project) {
return entry != null ? entry.getAutoRaiseIssue() : false;
}

public boolean getOverrideResolvedIssues(Job project) {
JobConfigEntry entry = getJobConfigEntry(project);
return entry != null ? entry.getOverrideResolvedIssues() : false;
}

public boolean getAutoResolveIssue(Job project) {
JobConfigEntry entry = getJobConfigEntry(project);
return entry != null ? entry.getAutoResolveIssue() : false;
Expand All @@ -469,6 +464,11 @@ public boolean getAdditionalAttachments(Job project) {
return entry != null ? entry.getAdditionalAttachments() : false;
}

public boolean getOverrideResolvedIssues(Job project) {
JobConfigEntry entry = getJobConfigEntry(project);
return entry != null ? entry.getOverrideResolvedIssues() : false;

Check warning on line 469 in src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JobConfigMapping.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 133-469 are not covered by tests
}

/**
* Getter for the issue key pattern, used to validate user input
* @param project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<f:checkbox/>
</f:entry>

<f:entry title="Auto override resolved issues" field="overrideResolvedIssues">
<f:checkbox/>
</f:entry>

<f:advanced>
<j:set var="items" value="${ instance.configs != null ? instance.configs : descriptor.templates }"/>
<f:entry field="configs">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
Create issues automatically for failing tests that are linked to resolved issues in JiraIssueKeyToTestMap.json.
Create issues automatically for failing tests that are linked to resolved issues (Stored by jenkins in JiraIssueKeyToTestMap.json).
</div>

0 comments on commit 57d95f6

Please sign in to comment.