Skip to content

Add format validation for module manifests #369

@jasminebro

Description

@jasminebro

👋 Welcome to OpenCRAVAT!
This task helps improve code reliability and developer experience by ensuring that all module manifests (.yml or .json files) include the required metadata fields before they’re accepted or published.


📝 Summary

Create a lightweight Python validation script to check OpenCRAVAT module manifests for missing required fields such as:

  • name
  • version
  • description

This will help maintainers and contributors catch formatting or metadata errors early during module submission or testing.


💡 Description

OpenCRAVAT modules rely on manifest files (.yml or .json) to define key attributes.
Currently, if a manifest is missing required fields, it may only fail later in the module registration process.

Adding a format validation script will:

  • Help developers verify module metadata locally before upload.
  • Provide clear error messages for missing or invalid fields.
  • Make automated testing of module submissions more robust.

🧭 Steps to Complete

  1. Identify where OpenCRAVAT stores module manifests (typically within the modules/ or store/ directory).
  2. Write a short Python script, e.g., validate_manifest.py.
  3. The script should:
    • Accept a file path or directory as an argument.
    • Parse .yml or .json manifest files using yaml.safe_load() or json.load().
    • Check for the presence of the required fields:
      required_fields = ["name", "version", "description"]
    • Print a clear message if any field is missing, e.g.:
      ❌ Missing field 'description' in my_annotator.yml
      ✅ Manifest validated successfully.
      
  4. Add a simple CLI entry point (e.g., python validate_manifest.py my_annotator.yml).
  5. Optionally integrate this check into the CI workflow (GitHub Actions) later.
  6. Test your script using one or two sample manifest files from the repository.

✅ Acceptance Criteria

  • Script runs successfully on .yml and .json files.
  • Detects and reports missing fields (name, version, description).
  • Exits with a clear success/failure message.
  • Code follows PEP8 formatting.
  • Pull Request includes usage instructions in the README or inline comments.
  • All existing CI checks pass.

⚙️ Difficulty Level

🟡 Low–Medium — suitable for new contributors familiar with Python basics and YAML/JSON parsing.


📚 Helpful Resources


🧑‍🤝‍🧑 Maintainer Checklist

  • Verified that this issue is beginner-friendly
  • Added labels: good first issue, help wanted, python
  • Linked this issue to the “Module Store Improvements” or “Tooling” milestone

🎉 Thank you for strengthening OpenCRAVAT’s module ecosystem!
Automated manifest validation keeps our tools consistent, discoverable, and easy to maintain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions