DO NOT MERGE Add script to compare MIxS schema releases using GitHub API#1026
DO NOT MERGE Add script to compare MIxS schema releases using GitHub API#1026
Conversation
- Created diff_two_linkml_mixs_releases.py script to fetch release information - Script lists all GitHub releases with commit hashes and YAML files - Finds mixs.yaml files in approved directories (src/, model/) - Supports GitHub API authentication via local/.env file - Added python-dotenv and requests dependencies to pyproject.toml - Created local/.env.template for GitHub token setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
…ions - Identify populated keys (non-None values) in old_schema.schema and new_schema.schema - Compare keys between versions showing only-in-old, only-in-new, and common keys - Print counts and key names without printing values to avoid huge lists 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add GitHub token validation with regex patterns for different token types - Add timeout parameters (10s) to all requests.get() calls to prevent hanging - Replace hardcoded commit hashes with symbolic constants DEFAULT_OLD_COMMIT/DEFAULT_NEW_COMMIT - Refactor main block to extract duplicated logic into build_release_info_dict() function - Update commit documentation to clearly indicate comparison versions (mixs6.0.0 vs main 2025-07-14) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
Adds a new Python script to compare MIxS schema releases via the GitHub API, along with necessary dependency updates and an environment template.
- Introduce
diff_two_linkml_mixs_releases.pyto fetch release metadata, locatemixs.yaml, and diff schema keys. - Update
pyproject.tomlto includepython-dotenvandrequests. - Provide
local/.env.templatefor GitHub token setup.
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/scripts/diff_two_linkml_mixs_releases.py | New script to fetch and compare MIxS schema releases |
| pyproject.toml | Added python-dotenv and requests dependencies |
| local/.env.template | Template for setting GITHUB_TOKEN |
Comments suppressed due to low confidence (3)
src/scripts/diff_two_linkml_mixs_releases.py:1
- Core functions like
validate_github_token,find_mixs_yaml_path, and API interactions currently lack unit tests. Consider adding tests to ensure these utilities work correctly and handle edge cases.
"""
src/scripts/diff_two_linkml_mixs_releases.py:321
- [nitpick] The script relies on hard-coded default commits and has no CLI interface. Consider adding argparse support so users can specify old/new commit SHAs or tags at runtime instead of editing the code.
if __name__ == "__main__":
pyproject.toml:27
- The script imports
yamlandlinkml_runtime, but neither PyYAML norlinkml-runtimeare listed in the main dependencies. Consider addingpyyamlandlinkml-runtimeto ensure the script runs when installed.
python-dotenv = "^1.0.0"
| Raises: | ||
| ValueError: If specified commits are not found or have no mixs.yaml file. | ||
| """ | ||
| releases = get_releases() |
There was a problem hiding this comment.
[nitpick] The logic to build release_info is duplicated in both load_schema_views and build_release_info_dict. Consider refactoring into a shared helper function to reduce duplication.
| return None | ||
|
|
||
|
|
||
| def get_releases() -> List[Tuple[str, datetime]]: |
There was a problem hiding this comment.
The get_releases function fetches only the first page of GitHub releases. If there are more than 30 releases, some will be missed. Consider adding pagination support to retrieve all pages.
Co-authored-by: Copilot <[email protected]>
…efactor duplicated logic - Add PyYAML ^6.0 dependency to pyproject.toml for explicit yaml import support - Add pagination support to get_releases() function to fetch all releases (not just first 30) - Refactor duplicated release_info building logic into build_full_release_info() helper function - Improve intelligent is_populated() function to properly detect empty collections, strings, and LinkML objects - Add keywords test case to validate proper population detection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ties - Add dynamic schema traversal using SchemaView all_* methods - Implement recursive populated value detection for complex structures - Add element-level difference detection for enums, classes, and slots - Include structured pattern analysis for slot settings usage - Add comprehensive filtering for expected name changes and inter-type refactoring - Improve GitHub API handling with authentication and rate limiting - Enhance output formatting with better diff visualization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Note I would suggest putting in draft mode rather than 'DO NOT MERGE' in the title ;) |
|
Closing — this exploratory diff script has been superseded by PR #1115, which implements a unified Keeping the branch for reference. |
🤖 Generated with Claude Code