Skip to content

ci: enforce Codex plugin contribution scanner gate - #361

Merged
kantorcodes merged 2 commits into
mainfrom
feat/contribution-gate-clean
Aug 15, 2026
Merged

ci: enforce Codex plugin contribution scanner gate#361
kantorcodes merged 2 commits into
mainfrom
feat/contribution-gate-clean

Conversation

@kantorcodes

Copy link
Copy Markdown
Member

Summary

  • add a target-side contribution gate for README plugin submissions
  • require each contributed source repository to run hashgraph-online/ai-plugin-scanner-action on push or pull_request
  • scan eligible source repositories at the documented 80/130, no-high-severity threshold
  • publish one per-PR check and an idempotent author-tagged remediation comment
  • sweep all open PRs on PR events, schedule, and manual dispatch
  • document the gate behavior and remediation flow in CONTRIBUTING.md

Validation

  • actionlint .github/workflows/validate-contribution.yml .github/workflows/sweep-open-prs.yml
  • Python syntax/AST checks for both new scripts
  • python3 scripts/check-alphabetical.py README.md
  • live validate-contribution.py --open-prs sweep against hashgraph-online/awesome-codex-plugins (17 open PRs classified; seven missing scanner CI, three queued for scan)

The target-side workflow checks out only the default branch. It reads PR metadata and README refs through the GitHub API, so fork PRs do not execute untrusted workflow code with write permissions. Scanner jobs clone only the public source repository selected by the validated README URL.

Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf51e3f3fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/validate-contribution.py Outdated
Comment thread scripts/validate-contribution.py Outdated
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@kantorcodes
kantorcodes merged commit e1208ba into main Aug 15, 2026
7 checks passed
@kantorcodes
kantorcodes deleted the feat/contribution-gate-clean branch August 15, 2026 17:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1959442d8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +68 to +70
echo "matrix=$(cat \"$MATRIX_FILE\")" >> "$GITHUB_OUTPUT"
echo "has_failures=$(jq -r '.has_failures' \"$STATUS_FILE\")" >> "$GITHUB_OUTPUT"
echo "results=$(jq -c '.results' \"$STATUS_FILE\")" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove backslashes around output-file variables

When either workflow reaches its export step, \"$MATRIX_FILE\" is parsed inside the command substitution as literal quote characters, so cat looks for a path named "/.../open-pr-matrix.json" rather than the generated file. The surrounding echo still succeeds and exports an empty matrix; fromJSON('') then prevents the scan matrix from being instantiated, while the two jq calls here also lose the validation status and per-PR results. Use normal nested quoting such as $(cat "$MATRIX_FILE"); the same defect is present in .github/workflows/validate-contribution.yml.

Useful? React with 👍 / 👎.

Comment on lines +253 to +255
url=match.group(2).strip(),
owner=match.group(3),
repo=match.group(4),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip the clone suffix from repository identifiers

The fresh .git URL case remains despite the new URL normalization: for a standard clone-form link such as https://github.com/acme/plugin.git, the regex stores plugin.git here even though normalize_url() strips the suffix only for duplicate comparison. Workflow discovery consequently requests /repos/acme/plugin.git/..., and the generated clone URL becomes plugin.git.git, so an otherwise valid contribution is rejected or fails its scan. Canonicalize the captured repository name before constructing the Contribution.

Useful? React with 👍 / 👎.

Comment on lines +238 to +244
if existing is not None and isinstance(existing.get("id"), int):
github_api(
repository,
f"/issues/comments/{existing['id']}",
token,
method="PATCH",
payload={"body": body},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent stale sweeps from overwriting newer remediation state

Because sweep-open-prs.yml runs scheduled all-PR sweeps and per-PR synchronize sweeps concurrently without ordering, an older scheduled run can finish after a newer head-specific run and PATCH this shared marker comment with results calculated from the previous PR head. The check runs remain attached to their respective SHAs, but the contributor-facing comment can regress from passed to failed or otherwise show stale guidance. Before updating the comment, verify that the PR still has the result's head_sha, or serialize/cancel superseded runs.

Useful? React with 👍 / 👎.

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.

1 participant