Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TriggerZoneMoveTask ignores project lock #2041

Closed
mikkonie opened this issue Nov 26, 2024 · 1 comment
Closed

TriggerZoneMoveTask ignores project lock #2041

mikkonie opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
app: landingzones Issue in the landingzones app bug Something isn't working
Milestone

Comments

@mikkonie
Copy link
Contributor

mikkonie commented Nov 26, 2024

While looking into #1910, I thought a similar "landing zone queue" could also implemented using LANDINGZONES_TRIGGER_ENABLE and uploading a trigger file - at least if validating AND moving the files is the desired outcome.

Alas, I noticed a bug in the implementation: while we only include landing zones in a non-locking state in processing the file triggers, we don't skip the triggering if the project is currently locked. This means that with multiple zones to be moved, this will generate errors due to the project being locked. It should still work as expected, but all the while generating unnecessary failures in the timeline.

I guess we only tested this with a single active landing zone.

Good thing this is an easy fix, just skip if project lock is currently active.

See also #2042.

@mikkonie
Copy link
Contributor Author

It seems I'm having problems reading my own code which I wrote years ago. This is in fact correctly handled in the following query:

projects = (
    Project.objects.filter(type='PROJECT')
    .annotate(zone_count=Count('landing_zones'))
    .exclude(zone_count=0)
    .exclude(landing_zones__status__in=STATUS_LOCKING)
)

Oh well, at least this lead me into refactoring the task into something less messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: landingzones Issue in the landingzones app bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant