From 3ae6c350c93e68a3d976ef24e1a88c49ffd9e954 Mon Sep 17 00:00:00 2001 From: "zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL" Date: Mon, 31 May 2021 17:31:02 +0200 Subject: [PATCH 1/2] Remove workaround to avoid NullPointerException resolving referenced issues --- src/org/ods/orchestration/util/Project.groovy | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/org/ods/orchestration/util/Project.groovy b/src/org/ods/orchestration/util/Project.groovy index 003fccc7e..a977d78e9 100644 --- a/src/org/ods/orchestration/util/Project.groovy +++ b/src/org/ods/orchestration/util/Project.groovy @@ -1132,34 +1132,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 ?: [] @@ -1452,13 +1424,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] } } } From c6e9e96a4b527b36fdadb4a10ecacf482b138f58 Mon Sep 17 00:00:00 2001 From: "zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL" Date: Tue, 1 Jun 2021 14:07:47 +0200 Subject: [PATCH 2/2] Update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15043faaa..f2b607944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,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)) ## [3.0] - 2020-08-11