Skip to content

Stop searching for tracker keys by shape, and keep the internal-link check - #28

Merged
GavinLucas merged 2 commits into
mainfrom
remove-tracker-key-check
Dec 2, 2026
Merged

GavinLucas merged 2 commits into
mainfrom
remove-tracker-key-check

Conversation

@GavinLucas

Copy link
Copy Markdown
Contributor

Summary

This stops the repo-hygiene action searching for tracker keys by shape. The rule against tracker keys in a public repository stands; review enforces it.

The search matched any ABC-123. Standards, licences, Octopus tariff product codes (AGILE-24-10-01, IOG-SMB-VAR-24-10-29) and vendors' error codes (KT-CT-1139) all share that shape. Each one needed its own exception, and the latest blocked a send-to-influx pull request whose subject is those product codes.

I tried a narrower pattern, which ignores a key-shaped match followed by -<digit> or preceded by an uppercase word and a hyphen. It passed every existing test, but it leaves the same trade-off in place, so this change removes the search rather than tuning it.

The search for links into the internal Atlassian site stays. It is a URL shape nothing else has, and the more damaging leak. It had no tests of its own, so tests/test_internal_references.py now covers it:

  • wiki, browse and board links are reported;
  • a wiki path with no host is reported;
  • a bare key shape, or the hostname named as text, is not.

To release as v2.1.1 after merge, publish the release, then move v2 to it, as in the README's "Versions and releases". main also carries one unreleased Dependabot bump (#27), which goes out with it.

Test plan

  • The repository's own suite, as premerge runs it: 134 passed.
  • The changed script run against a send-to-influx checkout of the blocked branch: "7 check(s) passed over 159 searchable file(s) of 159 tracked".
  • With the link search disabled, 4 of the 8 tests in tests/test_internal_references.py fail.

…check

The key search matched any ABC-123, a shape standards, licences, Octopus tariff product codes (AGILE-24-10-01) and vendors' error codes (KT-CT-1139) all share. Each new one needed an exception, and the latest blocked a pull request whose subject is those product codes. A shape-based narrowing was tried and kept the existing tests passing, but it leaves the same trade, so the search is removed rather than tuned. The rule against tracker keys in a public repository stands; review enforces it.

The search for links into the internal Atlassian site stays: a URL shape nothing else has, and the more damaging leak. It had no tests of its own, the file covering only the key search, so the file now tests it: wiki, browse and board links are reported, a hostless wiki path is reported, and a bare key shape or the hostname named as text is not.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Claude review: approve

Summary

The change removes the shape-based search for tracker keys (TRACKER_KEY, NOT_A_TRACKER_KEY, PART_OF_A_STANDARD) from the hygiene check. It keeps the internal-link search. The test file now tests that link search instead of the key search. The removal is complete: nothing in the repository refers to the removed names. The README describes the action only as "no internal references", which is still true. re is still used. Nothing below should block a merge.

Findings

1. Maintainability: the INTERNAL_LINK comment's reason for the wider pattern no longer fits (actions/repo-hygiene/check-repo-hygiene.py:79-83)

The edited paragraph still argues that the pattern should not be narrowed to /wiki/ because "a Jira board URL carrying no issue key … would otherwise slip past this check". The words "carrying no issue key" only mattered while the key search existed and caught /browse/ABC-1 links. With that search gone, narrowing to /wiki/ would let every /browse/ link through as well, not only board links. That is a stronger reason, and the comment no longer gives it. The paragraph also still tells what happened in review ("Review asked whether… Widened the name rather than…"). That kind of record belongs in the commit or pull request. Suggest stating it as a rule instead. For example: "Any link into the site is a leak, whether wiki, issue or board, so the pattern matches the host rather than a path." This also covers the /browse/ case.

2. Preference: links written without a scheme are no longer caught by anything (actions/repo-hygiene/check-repo-hygiene.py:94-96)

INTERNAL_LINK requires https?:// before the host. This is deliberate, so that "an atlassian.net/wiki link" in an instruction file does not trigger it. Before this change, a link written without a scheme, such as foo.atlassian.net/browse/AB-1, was still reported through its key. Now nothing reports it. I checked this by running the function directly: the line <host>/browse/AB-1 bare gives []. One possible fix is to also match atlassian\.net/(?:wiki|browse|jira)/ without a scheme. That still requires a slash after the path segment, so the instruction-text case ("atlassian.net/wiki link") is still not reported. This is optional, and leaving it to review is a reasonable choice. I'm raising it because the change removes the check that used to cover this case.

Recorded state

I checked every added or edited comment, docstring and test comment. The new lines (check-repo-hygiene.py:74-77, the docstring at :373-377, tests/test_internal_references.py:37-38, 41) give rules and the reasons for them, not claims about the current state that will go stale. The only text that records what happened is the review narrative already raised in finding 1.

What I checked

  • The full diff of both changed files, plus the surrounding code: tracked_paths, check_the_scan_is_real, check_no_internal_references, the check registry, conftest.py, the premerge.yaml test job and the README.
  • I searched the repository for remaining references to the removed names, to "tracker" and to "issue key". The only matches are in the new comments.
  • I ran every case in tests/test_internal_references.py against the script as it ships, using a small stand-in for pytest, because neither pytest nor uv is installed on this runner. All 8 cases pass.
  • I confirmed the test file builds its host and /wiki/spaces/ strings from pieces, so it contains nothing the check would report if run on this repository.
  • I did not run the rest of the test suite (tests/ with pyyaml), because pytest is not available here. Those tests don't touch the changed function.

full review of b4621ea6ba5e..e3d3b03bb1d7. Run.

…pattern matches the host

With the key search gone, a link such as <site>.atlassian.net/browse/<key>, written without https://, was no longer reported by anything: before, its issue key caught it. Such a link is now matched by the host followed by one of the site's top-level paths (wiki, browse, jira) and a slash. The instruction-text case the pattern was built around, "an atlassian.net/wiki link", has no slash after the path, so it is still not reported.

The comment above the pattern argued from the removed key search, and narrated the review that widened it. It now states the rule: any link into the site is a leak, so the pattern matches the host rather than one path.

Run over the three local repositories that call this action (docker-mcp, quaffed, send-to-influx): all checks pass on each.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Claude review: approve

Resolved

  • Finding 1 (comment reason for the wide pattern): check-repo-hygiene.py:79-80 now states the rule ("any link into the internal site is a leak… the pattern matches the host rather than one path under it"). The review narrative is gone.
  • Finding 2 (links without a scheme): a new alternative, (?:host\.)?atlassian.net/(?:wiki|browse|jira)/…, catches them. I ran the pattern directly:
    • foo.<host>/browse/AB-1 is reported.
    • foo.<host>/wiki/spaces/X is reported once, as a single match.
    • x <host>/jira/ is reported.
    • (foo.<host>/wiki/x) is reported.
    • The instruction-text case "an atlassian.net/wiki link" is not reported, because the path needs a slash after the segment.
    • A full https://…/wiki/a link is still one match.

Still open

None.

Declined

None.

New

None. The new comment (:87-88) states a rule and does not record current state. The two new test cases in tests/test_internal_references.py build the host from pieces, so the file does not trip the check. The relaxed startswith("notes.md:1: internal Atlassian link (") assertion is needed because scheme-less matches have no https:// prefix.

One small thing, not a finding: the list of top-level paths (wiki|browse|jira) is duplicated knowledge about the site. It is a reasonable heuristic, and the comment says it is "the site's own top-level paths".

What I checked: the delta diff, and the regex behaviour above. I did not run the pytest suite, because pytest is not installed on this runner.


delta review of e3d3b03bb1d7..a340f2e37dc6. Run.

@GavinLucas
GavinLucas merged commit 26b06fb into main Dec 2, 2026
10 checks passed
@GavinLucas
GavinLucas deleted the remove-tracker-key-check branch December 2, 2026 13:10
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