Repository navigation
Conversation
make build-lambda, test-coverage, complexity-report and the security-scan-* targets write bootstrap, coverage.html, complexity-report.txt and gosec/trivy/tfsec-report.json at the repo root, and none of them was ignored, so a `git add -A` after a build or scan could commit the multi-MB Lambda binary or a scanner report. Add root-anchored patterns for all six so same-named files elsewhere in the tree stay trackable, and add scripts/test-gitignore-make-artifacts.sh (run by a new CI job) asserting each root artifact is ignored by .gitignore itself, the same name one level down is not, and the Makefile still writes each file. Closes LeanerCloud#279 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Resolve the .github/workflows/ci.yml conflict: main added the migration-down-gate job (LeanerCloud#1084) at the same spot as this branch's gitignore-make-artifacts job. Keep both jobs and both ci-success needs entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es it Since LeanerCloud#1145 (LeanerCloud#340), `make security-scan-go` runs scripts/run-gosec.sh, which prints text findings or writes SARIF into a given directory; nothing writes gosec-report.json at the repo root any more. Drop the /gosec-report.json rule and its test row. The test's "still in the Makefile" check kept passing for that name only because the `make clean` rm line still lists it, which is the stale guard the check was meant to catch. Skip `rm` lines when looking for the name, so a target that stops writing a file fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merged origin/main to resolve conflicts in Conflict (
Semantic follow-up from main (
Head: Verification on the merged tree (Linux)
|
This was referenced Oct 23, 2026
This branch has not been deployed
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.
Root cause
Five documented Make targets write files at the repo root, and
.gitignorecovered none of them. After a build, coverage run or scan,git add -Awould pick them up. The worst case is the multi-MB linux/arm64bootstrapLambda binary.coverage.outwas already covered by*.out, andbin/cudly-serverby/bin/.bootstrapmake build-lambdacoverage.htmlmake test-coveragetrivy-report.jsonmake security-scan-dockertfsec-report.jsonmake security-scan-terraformcomplexity-report.txtmake complexity-reportFix
.gitignore: one root-anchored pattern per file (/bootstrap,/coverage.html,/trivy-report.json,/tfsec-report.json,/complexity-report.txt). The issue also listsgosec-report.json, but since ci(gosec): run one rule set from a shared script in the hook, Makefile and CI #1145make security-scan-gorunsscripts/run-gosec.sh, which writes no root file, so it is left out. The issue suggests a*-report.jsonglob, but I used exact anchored names instead. Unanchored, the glob would also ignore any nested*-report.jsonfixture someone adds later, and the probe below shows it doing so.scripts/test-gitignore-make-artifacts.sh(new): checks each file in both directions withgit check-ignore -v --no-index..gitignoreitself, so a developer's global excludes file or.git/info/excludecan't make it pass locally.some/nested/dir/<name>is not ignored by.gitignore, so the patterns stay anchored.Makefileon a line other than anrmline, so if a target is renamed or stops writing the file the test fails instead of guarding a file that is no longer produced. (make cleanstill listsgosec-report.json, which is whyrmlines are skipped.).github/workflows/ci.yml: new shell-only jobgitignore-make-artifactsruns the script, and it is added toci-successneeds. It follows the same structure as the other self-test jobs: pinned checkout SHA,persist-credentials: false,contents: read.Closes #279
Verification
All evidence comes from local runs against the real
.gitignore: first on macOS, then re-run on Linux on the tree merged with origin/main (6124b1a3). I did not run the heavy Make targets (build, coverage, scanners) to produce the files; I used emptytouchstand-ins with the same paths.Fail before (the test script run against
.gitignorewithout this PR's rules, on the merged tree):Pass after:
Stand-in files present: after
touch bootstrap coverage.html trivy-report.json tfsec-report.json complexity-report.txtat the root,git status --porcelainshowed only this PR's own edits, andgit status --porcelain --ignoredlisted all five as!!. I deleted the stand-ins afterwards.No tracked file becomes ignored:
git ls-files -ci --exclude-standardgives the same output before and after the change (diffidentical, 13 entries). Those 13 are all pre-existing; see Out of scope. No tracked file anywhere in the tree has any of the five names (git ls-files | grep).Mutation probes (each applied to
.gitignore, then reverted):/bootstrapchanged to unanchoredbootstrapbootstrapignored/trivy-report.jsonchanged to the*-report.jsonglob/tfsec-report.jsonline deletedtfsec-report.jsonnot ignored/bootstrapdeleted, but present in a globalcore.excludesFile.gitignoregosec-report.jsonrow restored in the test (onlymake clean'srmline names it)tfsecwriter lines deleted from theMakefile(rmline kept)Other checks:
shellcheck scripts/test-gitignore-make-artifacts.sh: cleanactionlint .github/workflows/ci.yml: cleanuvx zizmor==1.29.0 --offline --persona=pedantic --min-severity=medium .github/workflows/ci.yml: no findings (7 ignored, 1 suppressed; origin/main gives the same counts). Run before the main merge; not re-run sincegit diff --check: clean; files end with a newline--register-awsin a freshgit initrepo with an isolated HOME, scanning the three changed files with the repo's.gitallowed): clean; a planted fake secret key was caught as a positive controlbash scripts/test-git-secrets-allowlist.sh: 137 PASS, 0 FAIL on the merged tree./internal/mocksdon't applyOut of scope (noted, not changed)
make cleanremoves the other four files but notcomplexity-report.txt, and it still removesgosec-report.json, which no target writes since ci(gosec): run one rule set from a shared script in the hook, Makefile and CI #1145. Both are one-line Makefile changes; I left them out to keep this PR to the ignore rules.git ls-files -ci --exclude-standardalready lists 13 tracked files ignored by older patterns. These are the unanchoredcleanup-lambdaandclear-rate-limitpatterns matching source directories, and.terraform.lock.hclmatching committed lock files.cloudformation/stacks/CUDly/template.yamlappears only on case-insensitive checkouts such as macOS, where it matchescudly. Tracked files stay tracked, but new files under those paths would be silently ignored. This PR leaves that set unchanged.Labels
Could a maintainer please mirror the issue's triage labels onto this PR:
impact/internal,type/chore,triaged,priority/p3,severity/low,urgency/eventually,effort/xs.🤖 Generated with Claude Code