Validate granules using UMM_JSON metadata from CMR
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with _get_cmr_metadata in apps/api/src/hyp3_api/validation.py and CMR_URL in apps/api/src/hyp3_api/__init__.py; compare the current granule JSON fields with their UMM_JSON equivalents. The issue says this work is blocked by issue #2740, so first check whether that integration test work is complete. Done means validators use the needed UMM_JSON metadata without regressions in existing validation behavior.
Written by the indexing model from the issue text.
Description
Jira: https://asfdaac.atlassian.net/browse/TOOL-3662
Note: The above link is accessible only to members of ASF.
The _get_cmr_metadata function in hyp3_api.validation currently queries https://cmr.earthdata.nasa.gov/search/granules.json as defined by CMR_URL here, and then further filters the fields included for each granule before returning the metadata.
Recently https://github.com/ASFHyP3/hyp3/issues/2739 motivated us to consider querying https://cmr.earthdata.nasa.gov/search/granules.umm_json instead, to get the UMM_JSON metadata, which includes more information than the JSON metadata.
@asjohnston-asf also points out here that using umm_json would simplify some of our other validators as well:
having access to the additional attributes simplifies
check_same_relative_orbitsvia PATH_NUMBER andcheck_single_burst_pairvia POLARIZATION
and the new
check_rtc_static_coveragevia BURST_ID_FULL
It shouldn't be too difficult to make the conversion, but unfortunately the fields available in umm_json are not a superset of the fields available in json, so it will require at least updating _get_cmr_metadata to filter for different fields, e.g. this is what currently gets returned from that function (as of v10.4.1):
return [
{
'name': entry.get('producer_granule_id', entry.get('title')),
'polygon': Polygon(_format_points(entry['polygons'][0][0])),
}
for entry in response.json()['feed']['entry']
]
so we'll have to find the equivalent of producer_granule_id, title, and polygons in the umm_json. But I'd probably lean toward removing the custom field filtering logic from _get_cmr_metadata and just providing the full umm_json CMR item for each granule to the validators, so that _get_cmr_metadata doesn't have to care about e.g. choosing between producer_granule_id and title for the granule name.
Even though it's probably a fairly straightforward refactor, I'm not confident in our ability to do this without introducing regression bugs for our existing job validators, especially since we don't have comprehensive integration tests that actually query CMR. So I would consider this issue blocked by https://github.com/ASFHyP3/hyp3/issues/2740.
- Dominant language
- Python
- Stars
- 53
- Forks
- 13
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ASFHyP3/hyp3
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Most static tests fail when a date-like string is provided as an example value in a job spec YAMLOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Jira Bug
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
FinanceFlash/unvibecode#699 ·
Maintainers usually reply within 1 day
-
enhancement Website
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OWASP/OWASP-Hunting#96 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
micropython/micropython#19942 ·
Maintainers usually reply within 1 day
-
A rebuild posts "not part of this build" success to the commit's failed `nix-build` gate and effectsPossibly taken @Padraic-O-Mhuiris claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
`epoch.Integer` raises a raw OverflowError for integers too large to convert to a floatPossibly taken @arindam77 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pydantic/pydantic-extra-types#479 ·
Maintainers usually reply within 1 day