Skip to content
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 @@ -5,6 +5,7 @@
### Added

### Changed
* Update automatic release component information with N/A when pipelines have not run yet ([#1257](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1257))
* Enhance Helm strategy and support of Statefullset/Cronjob ([#1253](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1253))
* Add component information in automatic release close notes ([#1254](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1254))

Expand Down
5 changes: 3 additions & 2 deletions src/org/ods/orchestration/usecase/JiraUseCase.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,11 @@ class JiraUseCase {
def components = []
this.project.data.metadata.repositories.each { repo ->
if (repo.include == true) {
def gitSHA = repo.data?.git?.commit
components.add([
id: repo.id,
commit: repo.data?.git?.commit,
failed: repo.data?.failedStage ? true : false,
commit: gitSHA ? gitSHA : 'N/A',
status: gitSHA ? (repo.data?.failedStage ? 'FAILURE' : 'SUCCESS') : 'N/A',
])
}
}
Expand Down
26 changes: 18 additions & 8 deletions test/groovy/org/ods/orchestration/usecase/JiraUseCaseSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,11 @@ class JiraUseCaseSpec extends SpecHelper {
],
failedStage: true
]
project.data.metadata.repositories[1].data << [
git: [
commit: 5678
]
]

def error = new RuntimeException("Oh no!")

Expand All @@ -898,10 +903,10 @@ class JiraUseCaseSpec extends SpecHelper {
status: "Failed",
env: 'D',
components: [
['id':'demo-app-carts', 'commit':1234, 'failed':true],
['id':'demo-app-catalogue', 'commit':null, 'failed':false],
['id':'demo-app-front-end', 'commit':null, 'failed':false],
['id':'demo-app-tests', 'commit':null, 'failed':false]
['id':'demo-app-carts', 'commit':1234, 'status':'FAILURE'],
['id':'demo-app-catalogue', 'commit':5678, 'status':'SUCCESS'],
['id':'demo-app-front-end', 'commit':'N/A', 'status':'N/A'],
['id':'demo-app-tests', 'commit':'N/A', 'status':'N/A']
],
startDateTimestamp: "1234567890",
])
Expand All @@ -925,6 +930,11 @@ class JiraUseCaseSpec extends SpecHelper {
],
failedStage: true
]
project.data.metadata.repositories[1].data << [
git: [
commit: 5678
]
]

when:
usecase.updateJiraReleaseStatusResult("", false)
Expand All @@ -942,10 +952,10 @@ class JiraUseCaseSpec extends SpecHelper {
status: "Successful",
env: 'D',
components: [
['id':'demo-app-carts', 'commit':1234, 'failed':true],
['id':'demo-app-catalogue', 'commit':null, 'failed':false],
['id':'demo-app-front-end', 'commit':null, 'failed':false],
['id':'demo-app-tests', 'commit':null, 'failed':false]
['id':'demo-app-carts', 'commit':1234, 'status':'FAILURE'],
['id':'demo-app-catalogue', 'commit':5678, 'status':'SUCCESS'],
['id':'demo-app-front-end', 'commit':'N/A', 'status':'N/A'],
['id':'demo-app-tests', 'commit':'N/A', 'status':'N/A']
],
startDateTimestamp: "1234567890",
])
Expand Down