Fix silently-failing board conflict CI check - #270
Merged
Conversation
The board_types.txt conflict check never failed CI even when conflicts existed. The awk pass printed conflicts but always exited 0, so the workflow step passed regardless. A real unannotated collision on board ID 88 has been sitting in board_types.txt undetected as a result. This addresses the issue by: - Making the script exit non-zero when any conflict is found, so CI fails loudly. - Renaming the script from .txt to .sh (it is an executable bash script) and updating the workflow and in-file reference. - Adding an optional base-ref argument so pull requests only validate the board IDs they actually add, while still checking those against the full existing set. Push to main/master still runs a full-file check as a backstop. Also fixes two latent bugs: "# same" annotated lines now register their mapping so later collisions compare against them correctly, and new IDs are passed to awk space-separated so local runs work on BSD awk (macOS).
Runs the full-file board conflict check every Sunday at 06:00 UTC. On a scheduled failure it opens a tracking issue, or appends a dated comment to the existing open one so repeated weekly failures collect in a single thread instead of spawning a new issue each week.
Extract the issue create/append logic into Tools/report_board_conflict_failure.sh so the workflow file only describes triggers and invokes scripts, keeping logic out of YAML.
Move the scheduled run and issue-reporting into a dedicated weekly_board_conflicts.yaml. The push/PR check stays in check_board_conflicts.yaml and never opens issues, since PR conflicts are resolved at the PR level. Adds workflow_dispatch so the weekly sweep can be triggered manually.
Drop the push trigger and the if/else branching. PRs are checked in new-IDs mode; full-file coverage is owned by the weekly sweep, so the push-to-main path is no longer needed here.
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.
The board_types.txt conflict check has never actually failed CI, even when conflicts exist. The
awkpass printed any conflicts it found but always exited 0, so the workflow step passed regardless. As a result a genuine unannotated collision on board ID 88 (TARGET_HW_MINDPX_V2andTARGET_HW_ARK_CAN_FLOW_MR) has been sitting inboard_types.txtundetected. This fixes #269.The script now exits non-zero when a conflict is found, so CI fails loudly. It is also renamed from
.txtto.sh(it is an executable bash script), with the workflow and the in-file reference updated to match.On top of the exit-code fix, the script takes an optional base ref. On pull requests the workflow passes the PR base, so a PR is only checked for conflicts involving the board IDs it actually adds, while still validating those against the full existing set. Push to
main/masterstill runs a full-file check as a backstop, which is what surfaces pre-existing issues.Two latent bugs are fixed along the way:
# sameannotated lines now register their mapping so later collisions compare against them correctly, and new IDs are passed toawkspace-separated so local runs work on BSD awk (macOS), which the file header tells maintainers to do.I replayed the fixed script against the last 20 commits that touched
board_types.txt. In PR mode it correctly passes the diffs that introduce no new collision and would have failed exactly one:c1b5dca("add board IDs for missing ARK products"), which is where the id-88 collision entered. Full-file behavior is unchanged for the clean states.Heads up: once this merges, the push-to-
mainrun will fail on the existing id-88 conflict until it is resolved (one board needs a different ID, or a# sameannotation if intentional). That conflict is intentionally left untouched here since it is a data decision, not a script bug.This PR also adds a weekly scheduled run (Sundays 06:00 UTC) that does a full-file sweep. When the scheduled run fails it opens a tracking issue, or appends a dated comment to the existing open one, so a conflict that persists across weeks collects in one thread instead of spawning a fresh issue every Sunday.