-
Couldn't load subscription status.
- Fork 6
issue 1111 set list_job_results list items with stac1.1 #430
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add tests to make sure that these assets are actually downloadable (their hrefs have to work), for:
assetsdeclared in the result Collection,assetsdeclared in the results item(s).
Check test_download* functions in test_views.py for inspiration.
| ) | ||
|
|
||
|
|
||
| if len(result_metadata.items) > 0 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if len(result_metadata.items) > 0 : | |
| if result_metadata.items: |
I would take the opportunity to replace this as it it shorter, safer and expresses the intent better.
|
|
||
| resp = api110.get(f"/jobs/{job_id}/results", headers=self.AUTH_HEADER).assert_status_code(200) | ||
|
|
||
| assert "assets" in resp.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test the actual value of this assets property.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(result_metadata.items) > 0 : | ||
| assets = { | ||
| item_key + "_" + asset_key: asset_metadata | ||
| for item_key, item_metadata in result_items.items() | ||
| for asset_key, asset_metadata in item_metadata.get("assets").items() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build STAC 1.1 assets without URL signing
When items are present the collection’s assets are now rebuilt straight from result_metadata.items (item_metadata.get("assets").items()) without calling _asset_object. In the STAC 1.0 path each asset is wrapped by _asset_object, which injects signed/absolute hrefs and honours the asset flag. The new branch therefore returns raw backend metadata for STAC 1.1, which can omit href entirely or contain unsigned/internal paths, breaking download links for backends that rely on asset_url.build_url or URL signing. This regression only manifests for jobs producing STAC 1.1 items and makes the collection response unusable for clients expecting valid asset URLs.
Useful? React with 👍 / 👎.
follow up on #411