-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2024.1][PLAT-13324] We should not have multiple versions wi…
…th matching release tags Summary: Original commit: e016db2 / D33932 Making a release version unique except when a tag is present. To support this for internal machines - especially portals, we also have to be able to generate a tag from the file name. This is done by using any characters that are in place of "-b123" in the file name. Add a constraint unique(version, release_tag) on the release table to support this. But, in PG14 we cannot make null 'unique' (its in pg15). Instead, the Release model will encode a null tag to a constant to store in the db, and decode it back to null for any clients. Fixed some bugs with the migration process, especially around checking for helm charts. Test Plan: 1. do not allow multiple releases of the same version without release tags 2. Migration of older "matched" versions works correctly (older = not parsing version_metadata.json) 3. Migration of newer "matched" versions works correctly (parses version_metadata.json) 4. Tag generation works correctly 5. Migration from ReleaseMetadata works correctly 6. null encoding for release tags works correctly Reviewers: muthu, #yba-api-review, anijhawan Reviewed By: muthu, #yba-api-review, anijhawan Subscribers: yugaware, sanketh Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33963
- Loading branch information
Showing
9 changed files
with
140 additions
and
22 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
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
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
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
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
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
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
6 changes: 6 additions & 0 deletions
6
...ed/src/main/resources/db/migration/default_/postgres/V341__Release_Version_Tag_Unique.sql
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,6 @@ | ||
|
||
UPDATE release | ||
SET release_tag='NULL-VALUE-DO-NOT-USE-AS-INPUT' | ||
WHERE release_tag is null; | ||
ALTER TABLE release | ||
ADD CONSTRAINT version_tag_unique UNIQUE (version, release_tag); |
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