Only consider the latest removal request per deployment.
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 30s
Smoke Test / Run basic test suite (pull_request) Successful in 2m52s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m0s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m9s

This commit is contained in:
Thomas E Lackey 2024-02-07 14:13:05 -06:00
parent 5198f2d3cc
commit 27437ba869

View File

@ -161,11 +161,18 @@ def command(ctx, laconic_config, deployment_parent_dir,
# TODO: should we handle CRNs? # TODO: should we handle CRNs?
removals_by_deployment[r.attributes.deployment] = r removals_by_deployment[r.attributes.deployment] = r
requests_to_execute = [] one_per_deployment = {}
for r in requests: for r in requests:
if not r.attributes.deployment: if not r.attributes.deployment:
print(f"Skipping removal request {r.id} since it was a cancellation.") print(f"Skipping removal request {r.id} since it was a cancellation.")
elif skip_by_tag(r, include_tags, exclude_tags): elif r.attributes.deployment in one_per_deployment:
print(f"Skipping removal request {r.id} since it was superseded.")
else:
one_per_deployment[r.attributes.deployment] = r
requests_to_execute = []
for r in one_per_deployment.values():
if skip_by_tag(r, include_tags, exclude_tags):
print("Skipping removal request %s, filtered by tag (include %s, exclude %s, present %s)" % (r.id, print("Skipping removal request %s, filtered by tag (include %s, exclude %s, present %s)" % (r.id,
include_tags, include_tags,
exclude_tags, exclude_tags,