screwdriver
screwdriver copied to clipboard
Template version delete caused accident config parser behavior
What happened: When users delete a template version that has a tag associated with it.
Say
template namespace-test/name-deploy
which has versions:
- 1.0.3
- 1.0.4,
- 1.0.5 with
latest
tag
Since the template owner deleted version 1.0.5, and resulting latest
tag also be deleted (which ought to happen by user intention).
So, the config parser will raise issues such as
Error: Template namespace-test/name-deploy@latest does not exist
What you expected to happen:
- There should be a better way to allow users to add tags on the template UI
- Relax rules that instead of scoping to the template pipeline build, the sd admin and repo owner can also change the tag
- When
latest
tag is removed, preserve deleted tags and defaults to the previous version (does not make sense to me, only list here for exploring options)
How to reproduce it: Create two pipelines
- pipeline 1 publishes a template with tag, say
latest
- pipeline 2 uses that template with the
latest
tag - Remove the template version which has
latest
tag - Kick off pipeline 2, one will see config parser error mentioned previously
The immediate resolution is to update the DB by executing:
INSERT INTO "templateTags" (name, tag, version, namespace, "templateType")
VALUES ('name-deploy', 'latest', '1.0.3', 'namespace-test', 'JOB');
Verification
SELECT * from "templateTags" WHERE namespace = 'namespace-test'