Skip to content

Commit

Permalink
Fix The referenced documents are not displaying the correct version i…
Browse files Browse the repository at this point in the history
…f they are generated after the SLC Document (master) (#685)

* Search for document tracking issues across project versions

Co-authored-by: zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL <juan_antonio.farre_basurte.ext@boehringer-ingelheim.com>
  • Loading branch information
Juan Farré and zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL committed Jun 30, 2021
1 parent bd3efeb commit f4b9569
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
- Fix epic Issues not correctly ordered on the CSD ([#671](https://github.com/opendevstack/ods-jenkins-shared-library/pull/671))
- Fix Reference Documents not displaying the correct version on the SLC Documents ([#672](https://github.com/opendevstack/ods-jenkins-shared-library/pull/672))
- Jenkins nonCPS prevents project.dump from work ([#673](https://github.com/opendevstack/ods-jenkins-shared-library/issues/673))
- Regression from NonCPS refactoring leads to method not found ([#675](https://github.com/opendevstack/ods-jenkins-shared-library/issues/675), ([#678]https://github.com/opendevstack/ods-jenkins-shared-library/issues/678)
- Regression from NonCPS refactoring leads to method not found ([#675](https://github.com/opendevstack/ods-jenkins-shared-library/issues/675), ([#678](https://github.com/opendevstack/ods-jenkins-shared-library/issues/678))
- Fix reference Document Version for the DTR and TIR are not correct ([#681](https://github.com/opendevstack/ods-jenkins-shared-library/pull/681))
- Fix the referenced documents are not displaying the correct version if they are generated after the SLC Document ([#685](https://github.com/opendevstack/ods-jenkins-shared-library/pull/685))

## [3.0] - 2020-08-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ class LeVADocumentUseCase extends DocGenUseCase {
// The document, or a new version of it, has already been created in this same pipeline run.
version = this.project.getDocumentVersionFromHistories(doc)
if (!version) {
def trackingIssues = this.getDocumentTrackingIssues(doc, ['D', 'Q', 'P'])
def trackingIssues = this.getDocumentTrackingIssuesForHistory(doc, ['D', 'Q', 'P'])
version = this.jiraUseCase.getLatestDocVersionId(trackingIssues)
if (this.project.isWorkInProgress || docIsCreatedInTheEnvironment(doc)) {
// Either this is a developer preview or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1651,12 +1651,12 @@ class LeVADocumentUseCaseSpec extends SpecHelper {
def jiraUseCase = Spy(new JiraUseCase(null, null, null, jiraService, null))
jiraUseCase.getLatestDocVersionId(_) >> 1L
def useCase = Spy(new LeVADocumentUseCase(project, null, null, null, null, jiraUseCase, null, null, null, null, null, null))
useCase.getDocumentTrackingIssues(_, _) >> []

when:
def versions = useCase.getReferencedDocumentsVersion()

then:
8 * useCase.getDocumentTrackingIssuesForHistory(_, _) >> []
versions == [
CSD: 'ConfigItem / 3',
SSDS: 'ConfigItem / 2',
Expand All @@ -1675,6 +1675,7 @@ class LeVADocumentUseCaseSpec extends SpecHelper {
versions = useCase.getReferencedDocumentsVersion()

then:
8 * useCase.getDocumentTrackingIssuesForHistory(_, _) >> []
versions == [
CSD: 'ConfigItem / 3-WIP',
SSDS: 'ConfigItem / 2-WIP',
Expand Down

0 comments on commit f4b9569

Please sign in to comment.