Skip to content

fix(ci): check public text against a private denylist (ENG-3469) - #72

Closed
lucas-koontz wants to merge 5 commits into
mainfrom
fix/eng-3469-public-text-guard
Closed

lucas-koontz wants to merge 5 commits into
mainfrom
fix/eng-3469-public-text-guard

Conversation

@lucas-koontz

@lucas-koontz lucas-koontz commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

User story

As an engineer publishing changes in a public repository,
I want GitHub to check public text against a private list,
So that restricted names and private repository details are caught before merge and soon after a text edit.

Why this matters

Text copied from tickets can put a restricted name into a PR title, branch name, commit message or comment, and nobody notices until it is public. This adds a shared scanner that fails the PR when current text matches a private pattern, and fails a separate audit run for issues, comments and reviews. It runs after GitHub saves the text, so it catches a disclosure but cannot prevent or erase it.

Release trains merge by squash, so each train lists every earlier train's commits again. The scanner skips commits that the newest earlier merged PR from the same branch into the same base already carried, and checks the rest. Without that, one old commit message would fail every later train. A PR past the PR endpoint's 250-commit limit lists its commits through the compare endpoint, with count checks. The release-train PR description now lists only the commits since the last merged train too, so a shipped commit's subject cannot fail a later train through the description.

Test plan

  • A match fails the PR in each field (title, description, branch, commit message, path, added line): unit tests pass; GET-only probes against live release trains fail on a broad pattern and pass on a clean one, including a train past 700 commits.
  • Commits an earlier merged train carried are skipped, new ones are checked, and a branch that left the merged head is checked in full: unit tests pass, and each fails against the implementation without that rule.
  • The release-train description excludes carried commits; fetching or parsing history failures stop before creating or editing a PR. Successful empty history and unsuccessful ancestry checks keep the full range: the actual workflow step passes these cases with synthetic command responses.
  • Files without a patch: binaries check only their path; added text up to 1 MiB is scanned whole with strict UTF-8 and a documented PDF-marker fallback. Unsupported encodings fail as incomplete: unit tests and scanner subprocess runs verify clean text, matches, invalid encodings and the preserved PDF case.
  • Editing a description reruns against current text, and removing the match passes: unit tests pass; the live rerun waits for operator configuration.
  • Issue, comment and review edits fail their own audit job, and a clean audit cannot satisfy the PR check: unit tests and a workflow-shape test pass.
  • Missing or malformed configuration, incomplete or inconsistent API data and a PR that changes during the scan never pass: unit tests pass.
  • Logs name only a field, ordinal and line, never the text, a filename, the pattern or an error: unit tests pass; live probes wrote nothing to stderr.
  • Negative: clean text and generic deployment terms pass, and fork events report NOT SCANNED: unit tests pass.
  • The live event matrix and the required-check context: not checked yet; they need this merge and the operator steps in docs/public-text.md.

Ships with

Callers: mindsdb/anton#664, mindsdb/cowork-server#771, mindsdb/cowork#1310.

Merge order: this PR first. Then the operator configures the organization secret and its Dependabot copy, then the callers merge into staging and reach main. No deployment is part of this PR.

@lucas-koontz
lucas-koontz marked this pull request as ready for review October 26, 2026 05:39
@lucas-koontz
lucas-koontz requested a review from a team October 26, 2026 05:39
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