Skip to content

validate the exemption allow list#46

Open
ciaracarey wants to merge 1 commit intomainfrom
exemption
Open

validate the exemption allow list#46
ciaracarey wants to merge 1 commit intomainfrom
exemption

Conversation

@ciaracarey
Copy link
Copy Markdown
Collaborator

No description provided.

@ciaracarey ciaracarey marked this pull request as ready for review April 3, 2026 09:08
Copilot AI review requested due to automatic review settings April 3, 2026 09:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CI guardrail to validate the exemptions allowlist (exemptions/allow.json) before attempting to apply exemptions to Cloudsmith.

Changes:

  • Introduces a Python validator script for exemptions/allow.json structure and entry format.
  • Runs the validator as a dedicated step in the apply-exemptions GitHub Actions workflow before uploading the generated policy.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
exemptions/validate_allowlist.py New script to validate allow.json is present, valid JSON, non-empty list, and entries match an expected shape.
.github/workflows/apply-exemptions.yml Adds a workflow step to run the validator before exemptions/update_policy.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exemptions/validate_allowlist.py
Comment on lines +6 to +8
ALLOW_FILE = Path(__file__).parent / "allow.json"
ENTRY_PATTERN = re.compile(r"^[a-zA-Z0-9_\-]+:[a-zA-Z0-9_\-\.]+:[a-zA-Z0-9_\-\.]+$")

Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file re-implements allowlist entry validation that already exists in exemptions/update_policy.py (_validate_allowlist_entry). Because the criteria differ (regex here vs just enforcing two ':' separators there), CI can end up rejecting entries that the upload code would accept (or vice versa). Consider sharing one validation function/module or aligning the checks exactly.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants