Add workflow to report ID and file name mismatch#4903
Merged
aneta-petrova merged 10 commits intoJun 8, 2026
Conversation
Adds a bash script that checks whether module IDs match their filenames,
following the repository convention where IDs should mirror the filename
(without the module type prefix like con_, proc_, ref_).
The script handles the {project-context} attribute substitution and
skips snippets and assemblies which don't follow this convention.
Also adds a GitHub Actions workflow that runs the check on changed
module files in pull requests.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
9b6d294 to
e725aa1
Compare
|
The PR preview for 8ec7aa4 is available at theforeman-foreman-documentation-preview-pr-4903.surge.sh No diff compared to the current base |
39285a9 to
0a6286b
Compare
Updates the ID-filename check workflow to use reviewdog with the github-pr-check reporter, which creates check run annotations on PRs. The workflow now: - Installs reviewdog - Runs the check script on each changed file - Parses the script output with awk (handling ANSI color codes) - Converts to reviewdog's rdjsonl format - Creates check annotations on the PR (visible in Files changed tab) - Fails the check when ID-filename mismatches are found Using github-pr-check reporter instead of github-pr-review because it works with read-only tokens from fork PRs, while still providing inline feedback on the diff similar to Vale's output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removes: - files_ignore for snippets (script handles this internally) Keeps the 'List changed files' step for debugging purposes.
Extends the script to handle additional attributes found in module IDs:
- {smart-proxy-context} → smartproxy
- {ProjectNameID} → project
- {ProjectServerID} → project-server
- {customreposid} → repositories
- {FreeIPA-context} → freeipa
- {insights-id} → insights
- {foreman-installer} → foreman-installer
- and other less common variants
Does NOT handle {context} or _{context} suffix - these are legacy
format and should be reported as mismatches.
93d2270 to
1901a8a
Compare
The heading normalization was missing the {foreman-installer} attribute
replacement, causing false positives for files that use this attribute
in their headings.
50b8820 to
05e9020
Compare
Renames from check-id-filename-match to check-filename-id-heading-match to better reflect that the script validates all three elements: filename, ID, and heading. Script changes: - check-id-filename-match.sh → check-filename-id-heading-match.sh - Updated usage line in script header Workflow changes: - check-id-filename.yml → check-filename-id-heading-match.yml - Workflow name: 'Check Filename-ID-Heading Match' - Job name: check-match - Step names updated - Reviewdog reporter name updated
05e9020 to
7a2a271
Compare
Member
Author
037905a to
80c4f17
Compare
Member
Author
80c4f17 to
7a2a271
Compare
Member
Author
|
Ready for review now. I've done a lot of testing by breaking various IDs/headings/file names and took screenshots of the messages (see comments above). |
Lennonka
reviewed
Jun 4, 2026
Co-authored-by: Lena Ansorge <zuansorg@redhat.com>
Member
Author
This is one of those situations 'why hasn't anyone thought of this before', right? 😆
Agreed, that's great. Courtesy of Claude but very neat and seems to work reliably. Also, it should be easy for anyone to update the list in the script with more attributes if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.







What changes are you introducing?
Adding a pull request check that reports when a module's file name, ID, or heading don't match.
Why are you introducing these changes? (Explanation, links to references, issues, etc.)
It happens to me all the time that I forget to keep them in sync in my PRs, and seeing a warning saves precious peer reviewers' time that they otherwise have to spend pointing it out to me 🙃
Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)
My first choice would have been Vale but Vale can't read file names. Hence a script.
Contributor checklists
Please cherry-pick my commits into: