From ba97448365a6daaddc96be72f2b175e9d24cb4f2 Mon Sep 17 00:00:00 2001 From: Ashley Childress Date: Fri, 28 Aug 2026 22:33:29 -0400 Subject: [PATCH] fix: resolve the community schema version at runtime - write through get_schema_path() instead of a literal v1 filename - drop the unreferenced SCHEMA_PATH backwards-compatibility shim - widen the community PR trigger to schemas/** so a version bump still fires it Generated-by: Claude Opus 5 --- .github/workflows/update-community-prs.yaml | 2 +- src/contributions/approve_submission.py | 6 +++--- src/contributions/regenerate_pr_schema.py | 6 +++--- src/contributions/schema.py | 3 --- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-community-prs.yaml b/.github/workflows/update-community-prs.yaml index cf7e826..f51eaba 100644 --- a/.github/workflows/update-community-prs.yaml +++ b/.github/workflows/update-community-prs.yaml @@ -5,7 +5,7 @@ on: branches: [main] paths: - 'community/**' - - 'schemas/community_submission.v1.schema.json' + - 'schemas/**' permissions: contents: write diff --git a/src/contributions/approve_submission.py b/src/contributions/approve_submission.py index bb421af..c7d959e 100644 --- a/src/contributions/approve_submission.py +++ b/src/contributions/approve_submission.py @@ -21,7 +21,7 @@ import urllib.request import urllib.error from datetime import datetime, timezone -from .schema import extract_json_from_issue_body, extract_contributor_name_from_issue_body, parse_and_validate, load_schema, SCHEMAS_DIR +from .schema import extract_json_from_issue_body, extract_contributor_name_from_issue_body, parse_and_validate, load_schema, get_schema_path from .contributor import ( generate_contributor_uuid, generate_submission_filename, @@ -206,7 +206,7 @@ def process_submission( commit_message = f"Add community submission from @{author_username} (closes #{issue_number})" create_or_update_file(file_path, content_json, commit_message, branch_name) - # Update schema with any new tags (modifies v1 in place) + # Update schema with any new tags (rewrites the resolved schema version in place) schema_updated = False new_tags = [] try: @@ -232,7 +232,7 @@ def process_submission( schema_json = json.dumps(updated_schema, indent=2) + "\n" create_or_update_file( - "schemas/community_submission.v1.schema.json", + f"schemas/{get_schema_path().name}", schema_json, f"Update schema with new tags: {', '.join(new_tags)}", branch_name diff --git a/src/contributions/regenerate_pr_schema.py b/src/contributions/regenerate_pr_schema.py index 5209e13..94eff97 100644 --- a/src/contributions/regenerate_pr_schema.py +++ b/src/contributions/regenerate_pr_schema.py @@ -20,7 +20,7 @@ from src.contributions.update_schema import ( check_for_new_tags, generate_updated_schema, ) -from src.contributions.schema import load_schema, SCHEMAS_DIR +from src.contributions.schema import load_schema, get_schema_path def main(): @@ -51,8 +51,8 @@ def main(): # Generate updated schema updated_schema = generate_updated_schema(current_schema, tag_registry) - # Write updated schema (in place) - schema_path = SCHEMAS_DIR / "community_submission.v1.schema.json" + # Write back to whichever version load_schema() resolved to + schema_path = get_schema_path() with open(schema_path, 'w') as f: json.dump(updated_schema, f, indent=2) f.write("\n") diff --git a/src/contributions/schema.py b/src/contributions/schema.py index bb29dcd..42fdd99 100644 --- a/src/contributions/schema.py +++ b/src/contributions/schema.py @@ -12,9 +12,6 @@ except ImportError: SCHEMAS_DIR = Path(__file__).parent.parent.parent / "schemas" -# For backwards compatibility -SCHEMA_PATH = SCHEMAS_DIR / "community_submission.v1.schema.json" - def get_latest_schema_version() -> int: """