Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
stac_harvest
management command to the distributions application to sync package distributions withservice-stac
.The command uses the STAC collection ID as the package distribution slug and relies on the
managed_by_stac
flag to identify package distributions managed byservice-stac
.The command ensures that for each STAC collection, a corresponding package distribution exists by:
managed_by_stac
flag to be set.managed_by_stac
flag set but no matching STAC collection.Assumptions and Behavior
Customization Options
--url
: Allows to specify the STAC endpoint. By default, the command uses theservice-stac
endpoint (https://data.geo.admin.ch/api/stac/v0.9).--clear
: Deletes all package distributions previously marked as managed byservice-stac
.--dry-run
: Runs the command without making any changes, allowing you to preview the actions.