-
Notifications
You must be signed in to change notification settings - Fork 2
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
PB-769: Required fields to comply with stac v1 #426
Conversation
f05f960
to
85fa313
Compare
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.
looks good. I left a comment on the test PR, there's a project that claims to be able to check STAC APIs for validity, maybe it could be useful to validate these changes and make sure we catched all changes
Pipfile
Outdated
@@ -39,6 +39,7 @@ django-prometheus = "~=2.3.1" | |||
django-admin-autocomplete-filter = "~=0.7.1" | |||
django-pgtrigger = "~=4.11.1" | |||
logging-utilities = "~=4.4.1" | |||
stac-api-validator = "*" |
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.
Should not this be in the dev-package ? In the package section we should have fix major, minor version.
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.
👍 Yes that makes sense. I added to dev-deps and fixed the version to the current latest.
753fd3a
to
5be59f9
Compare
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.
very nice! thanks.
@@ -15,14 +15,11 @@ | |||
from django.http import HttpResponseRedirect | |||
from django.urls import reverse | |||
|
|||
from solo.admin import SingletonModelAdmin |
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.
was this the only we used that SingletonModelAdmin
? If yes we could remove the package from the dependancy list.
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.
Thanks for the hint, I removed the dependency. 👍
] | ||
|
||
operations = [ | ||
migrations.RunPython(add_landing_page_version, reverse_landing_page_version), |
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.
nice!
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('stac_api', '0032_alter_asset_file'), | ||
('stac_api', '0033_auto_20240704_1157'), | ||
] | ||
|
||
operations = [] |
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.
was this migration done automatically? Merging migrations has not always worked well in the past, but this is already a while ago, so it's probably reliable now.
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.
Yes this was created automatically because of the conflicts with the changes for the new s3 bucket. I am not aware of any migration issues, it seems to work so far.
@@ -565,11 +557,15 @@ class Meta: | |||
def filename(self): | |||
return os.path.basename(self.file.name) | |||
|
|||
# From v1 on the json representation of this field changed from "checksum:multihash" to | |||
# "file:checksum". The two names may be used interchangeably for a now. | |||
checksum_multihash = models.CharField( |
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.
cosmetics, but we could rename the fields to relate to the naming in v1...
Add field type to catalog (landing page) and collection response body. Introduce enum to support handling api version checks.
Rename asset multihash json encoding from checksum:multihash to file:multihash.
Rename asset gsd json encoding. Introduce test_v0.9 path namespace to fix test cases that rely on v0.9 and test the old encoding.
Find and replace file:multihash to file:checksum
Add conformsTo to landing page response. Add conformsTo array to LandingPage model and remove the ConformancePage model. Return landing page information based on api version. Introduce stac-api-validator to check stac core conformance manually.
Conform with stac v1 collection definitions. Add 0 bbox if empty. This is only an edge case if the collection has no assets. Add collection conformance link.
5be59f9
to
03927fd
Compare
Remove dependency to the singleton package solo as it is no longer needed.
03927fd
to
f586994
Compare
Following changes are done to v1 (v0.9 stays unchanged)
Landing Page
type
conformsTo
Collection
type
Item
checksum:multihash
tofile:checksum
eo:gsd
togsd
These changes will remove the ConformancePage table from the database. The information is moved to the LandingPage.