forked from lfit/releng-lftools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Nexus release logic and naming, add unit test
nexus.release_staging_repos was failing with an error due to an undeclared variable. Several other issues were identified and fixed (see release note for details), and a unit test has been added to help prevent similar issues in the future. Issue: RELENG-3804 Change-Id: I8b7e4adf4561541acffa1dc81dbeba35d7783e51 Signed-off-by: Eric Ball <[email protected]>
- Loading branch information
Showing
5 changed files
with
153 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
releasenotes/notes/fix-nexus-release-01c462b4c2ff2741.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
fixes: | ||
- | | ||
nexus.release_staging_repos was failing with an error due to an undeclared | ||
variable. Upon inspection, there were several other issues at play as well: | ||
* No unit test (which would have caught an undeclared variable). | ||
* Initial sleep of 20s is significantly longer than many repos take to | ||
release. | ||
* Only checked release status every 40s, while printing every 20s. | ||
* Rather than checking release status, we were checking for "close" | ||
status. Nexus closes repos before releasing them, so this is not the | ||
correct status to look for when waiting for the repo to release. | ||
A unit test has been added, several variables issues have been corrected, | ||
timing was adjusted (waiting just 5 seconds before the initial check for | ||
success), and the code will now check for "release" status. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<list> | ||
<stagingActivity> | ||
<name>open</name> | ||
<events> | ||
<stagingActivityEvent> | ||
<timestamp>2021-01-01T01:01:01.000Z</timestamp> | ||
<name>repositoryCreated</name> | ||
<severity>0</severity> | ||
<properties> | ||
<stagingProperty> | ||
<name>id</name> | ||
<value>test-release-repo</value> | ||
</stagingProperty> | ||
</properties> | ||
</stagingActivityEvent> | ||
</events> | ||
</stagingActivity> | ||
<stagingActivity> | ||
<name>close</name> | ||
<events> | ||
<stagingActivityEvent> | ||
<timestamp>2021-01-01T01:01:02.000Z</timestamp> | ||
<name>repositoryClosed</name> | ||
<severity>0</severity> | ||
<properties> | ||
<stagingProperty> | ||
<name>id</name> | ||
<value>test-release-repo</value> | ||
</stagingProperty> | ||
</properties> | ||
</stagingActivityEvent> | ||
</events> | ||
</stagingActivity> | ||
</list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<list> | ||
<stagingActivity> | ||
<name>open</name> | ||
<started>2021-01-01T01:01:00.000Z</started> | ||
<stopped>2021-01-01T01:01:01.000Z</stopped> | ||
<events> | ||
<stagingActivityEvent> | ||
<timestamp>2021-01-01T01:01:01.000Z</timestamp> | ||
<name>repositoryCreated</name> | ||
<severity>0</severity> | ||
<properties> | ||
<stagingProperty> | ||
<name>id</name> | ||
<value>test-release-repo</value> | ||
</stagingProperty> | ||
</properties> | ||
</stagingActivityEvent> | ||
</events> | ||
</stagingActivity> | ||
<stagingActivity> | ||
<name>close</name> | ||
<started>2021-01-01T01:01:02.000Z</started> | ||
<stopped>2021-01-01T01:01:03.000Z</stopped> | ||
<events> | ||
<stagingActivityEvent> | ||
<timestamp>2021-01-01T01:01:02.000Z</timestamp> | ||
<name>repositoryClosed</name> | ||
<severity>0</severity> | ||
<properties> | ||
<stagingProperty> | ||
<name>id</name> | ||
<value>test-release-repo</value> | ||
</stagingProperty> | ||
</properties> | ||
</stagingActivityEvent> | ||
</events> | ||
</stagingActivity> | ||
<stagingActivity> | ||
<name>release</name> | ||
<started>2021-01-01T01:01:04.000Z</started> | ||
<stopped>2021-01-01T01:01:05.000Z</stopped> | ||
<events> | ||
<stagingActivityEvent> | ||
<timestamp>2021-01-01T01:01:04.000Z</timestamp> | ||
<name>repositoryReleased</name> | ||
<severity>0</severity> | ||
<properties> | ||
<stagingProperty> | ||
<name>id</name> | ||
<value>test-release-repo</value> | ||
</stagingProperty> | ||
</properties> | ||
</stagingActivityEvent> | ||
</events> | ||
</stagingActivity> | ||
</list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters