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

Remove the workaround for NPE resolving issues #660

Merged
merged 3 commits into from
Jul 29, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fixed bug that disallowed empty label values ([#655](https://github.com/opendevstack/ods-jenkins-shared-library/pull/655))
- Added builder (agent and master) labels into image building process ([#644](https://github.com/opendevstack/ods-jenkins-shared-library/pull/644))
- Added regexp compatibility with new Bitbucket merge commit messages ([#655](https://github.com/opendevstack/ods-jenkins-shared-library/pull/656))
- Remove the workaround for NPE resolving issues ([#660](https://github.com/opendevstack/ods-jenkins-shared-library/pull/660))
- Set jenkins job to unstable in case of open issues ([#664](https://github.com/opendevstack/ods-jenkins-shared-library/pull/664))
- Fixed regression on project dump in release manager ([#666](https://github.com/opendevstack/ods-jenkins-shared-library/issues/666))
- Fixed use of full image in the creation of the documents ([682](https://github.com/opendevstack/ods-jenkins-shared-library/pull/682))
Expand Down
36 changes: 1 addition & 35 deletions src/org/ods/orchestration/util/Project.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1146,34 +1146,6 @@ class Project {
protected Map loadJiraDataForCurrentVersion(String projectKey, String versionName) {
def result = [:]
def newData = this.loadVersionJiraData(projectKey, versionName)
/* FIXME: This is a workaround for NPE bugs resulting from being unable to resolve a reference to an issue belonging
* to a previous version. As a workaround, the deltadocgen report contains the full information of all references.
* Here we will strip data information and store it aside for the use of the resolution algorithm.
* The NPE's must be fixed in the future, and this workaround and the deltadocgen report workaround have to be
* rolled back. */
// FIXME: Start of the workaround
def typesOfInterest = [
JiraDataItem.TYPE_EPICS,
JiraDataItem.TYPE_REQUIREMENTS,
JiraDataItem.TYPE_TECHSPECS,
JiraDataItem.TYPE_RISKS,
JiraDataItem.TYPE_MITIGATIONS,
JiraDataItem.TYPE_TESTS
] as Set
def olderIssues = [:]
newData = newData.collectEntries {
type, issues ->
if (typesOfInterest.contains(type)) {
olderIssues.putAll(issues)
def filteredIssues = issues.findAll {
key, Map issue -> issue.versions[0] == versionName
}
return [(type): filteredIssues]
}
return [(type): issues]
}
result.olderIssues = olderIssues
// FIXME: End of the workaround.

// Get more info of the versions from Jira
def predecessors = newData.precedingVersions ?: []
Expand Down Expand Up @@ -1466,13 +1438,7 @@ class Project {
result[type][key][referenceType] = []

item[referenceType].eachWithIndex { referenceKey, index ->
/* FIXME: This is a workaround for NPE bugs resulting from being unable to resolve a reference to an issue belonging
* to a previous version. As a workaround, the deltadocgen report contains the full information of all references.
* Here, whenever an issue cannot be resolved, we use an auxiliar olderIssues map
* containing the referenced issues belonging to previous versions.
* The NPE's must be fixed in the future, and this workaround and the deltadocgen report workaround have to be
* rolled back. */
result[type][key][referenceType][index] = data[referenceType][referenceKey]?:data.olderIssues[referenceKey]
result[type][key][referenceType][index] = data[referenceType][referenceKey]
}
}
}
Expand Down