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

Fix The referenced documents are not displaying the correct version if they are generated after the SLC Document (master) #685

Merged
merged 3 commits into from
Jun 30, 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
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