asdf-format / asdf

ASDF (Advanced Scientific Data Format) is a next generation interchange format for scientific data
http://asdf.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
511 stars 56 forks source link

issue warning if manifest id does not match uri #1785

Closed braingram closed 2 months ago

braingram commented 2 months ago

Description

https://github.com/asdf-format/asdf/pull/1758 assumed that the uri used for a manifest matches the id in the manifest. This should be the case (as defined in the extension manifest schema). However this was not previously being checked. Both dkist and weldx downstream jobs show failures since both these packages use manifests with ids that do not match the uris. The dkist failure is due to use of sunpy manifests (which are fixed in main but are unreleased) and a PR is open for weldx to update the ids to match.

This PR detects the mismatch and instead of producing an exception issues a new warning AsdfManifestURIMismatchWarning with a message to file an issue with the package maintainers.

The weldx downstream job (which doesn't turn warnings into errors) shows the new warning: https://github.com/asdf-format/asdf/actions/runs/9004808168/job/24738692670?pr=1785#step:10:714

A warning filter is added in this PR to the tox.ini to filter out the warning for the dkist downstream job since it's an issue with the sunpy manifests and will be fixed in the next major sunpy release.

Checklist: