Repository navigation
feat: report code-gauge violations in pull request changes - #536
Merged
Merged
Conversation
Add a step to the test workflow that runs `wb code-gauge --base <merge-base>` on pull requests and writes the violations to the job log and the step summary. It never fails the job and does nothing when the installed wb has no `code-gauge` command. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
… runs Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
…was built on Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
…t as the report Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
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.
Requirements
testjob oftest.yml, onpull_requestevents and the first matrix leg only, so callers change nothing and the result does not depend on the Node.js version.wb code-gauge --base <sha>with no token. The token-using step runs before any pull-request code (installs, build, tests), because such code could otherwise read the token from a process environment or command line, or redirect the step throughGITHUB_ENV,GITHUB_PATH, git config, or hooks; and wb executes code installed by the pull request, so the step running it must not hold the token.HEADis ahead, and onegit fetch --depth=<ahead + 1>reaches it.--shallow-excludewould fetch less, but it left a broken shallow repository in a trial whenever a fetched commit merges the base branch.github.token, the token the checkout itself uses: it is read-only on fork pull requests, which is enough. It is passed to git throughGIT_CONFIG_*variables for that one command.package.jsondeclares@willbooster/wb, and the report step does nothing unlesswb code-gauge --helplists--base, because callers pin many wb versions and older ones lack the command.!cancelled()), after the build because a repository that develops wb runs it from its build output, and before lint-staged and the release test because they modify and stage files that code-gauge would count as changes. It measures the tree the fix step left: formatting does not change code-gauge's metrics, and a pull request the fixers modify already fails the job.node_modules/.bin/wb, not through the package manager, because Yarn 1 wraps the output in its own lines and the summary must stay empty when there are no violations. A Yarn Plug'n'Play caller therefore gets no report; none exists among the callers.continue-on-errorand timeouts cover everything else, so the job result never changes.Self Check
All checks have passedon this page.Steps to Test
bun verifyand actionlint with the flags oflint-workflows.ymlpass locally.git diffagainst it listed exactly the pull request's file.code-gauge: 1 threshold violations (...)with the added function; the job stayed green.package.jsonthe script prints nothing and exits 0 (checked locally on the first revision of the step).Notes
GIT_CONFIG_COUNT) and a private repository. A failure there only costs the report.