Skip to content

Add STAC catalog validation script and integrate into build#59

Draft
samn wants to merge 1 commit intomainfrom
claude/add-stac-validation-gl1Cg
Draft

Add STAC catalog validation script and integrate into build#59
samn wants to merge 1 commit intomainfrom
claude/add-stac-validation-gl1Cg

Conversation

@samn
Copy link
Copy Markdown
Member

@samn samn commented Apr 2, 2026

Summary

This PR adds automated validation of STAC (SpatioTemporal Asset Catalog) JSON files to the build pipeline. A new bash script validates all generated STAC files using the gostac-validator tool, ensuring catalog integrity before deployment.

Key Changes

  • New validation script (scripts/validate-stac.sh):

    • Automatically builds gostac-validator from source if not already present
    • Discovers and validates all STAC JSON files in the docs/stac directory
    • Provides clear pass/fail output for each file with detailed error messages
    • Exits with failure status if any files are invalid
  • Updated build pipeline (package.json):

    • Integrated STAC validation into the build script to run after Eleventy compilation
    • Added new validate:stac npm script for standalone validation runs
    • Ensures STAC catalogs are valid before the build completes

Implementation Details

  • The validator is cached in .cache/gostac-validator to avoid rebuilding on every run
  • Uses shallow clone (--depth 1) for faster validator setup
  • Provides user-friendly output with checkmarks (✓) for valid files and crosses (✗) for invalid ones
  • Includes helpful error message if STAC output directory doesn't exist, guiding users to run build first
  • Gracefully handles validator output parsing to detect validation results

https://claude.ai/code/session_01HqPu7U8YpWHFqhJJRAMUtq

Validates all generated STAC catalog and collection JSON files against
the STAC spec after each build to ensure ecosystem compatibility.
The validator is built from source on first run and cached in .cache/.

https://claude.ai/code/session_01HqPu7U8YpWHFqhJJRAMUtq
@samn samn linked an issue Apr 2, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add validation to stac catlog before update

2 participants