Repository navigation
chore: mark the synced baseline as generated and explain it in the sync PR - #141
Svilen-Stefanov wants to merge 2 commits into
Conversation
…nc PR A team that keeps the baseline on its branch gets .codeboarding/ in every diff and in the repository's language stats. deliver-sync now appends `.codeboarding/** linguist-generated=true` to .gitattributes inside the same sync commit, for both the push and pull_request strategies, unless a line already decides the attribute for those files (an opt-out included). Other lines are never touched. The rolling sync PR body now says what the files are (generated diagram data and an analysis cache that makes the next run incremental) and that merging lets reviews start from the saved diagram. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CodeBoarding reviewStatus: 0 changed components (no analysed file changed) See the full change in CodeBoarding. graph LR
n_action_scripts["action_scripts"]
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f72fcc44a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # explicit opt-out is as deliberate as an opt-in, and other lines are not ours. | ||
| if [ "$(git check-attr linguist-generated -- .codeboarding/analysis.json | awk '{print $NF}')" = unspecified ]; then | ||
| [ ! -s .gitattributes ] || [ -z "$(tail -c 1 .gitattributes)" ] || printf '\n' >> .gitattributes | ||
| printf '.codeboarding/** linguist-generated=true\n' >> .gitattributes |
There was a problem hiding this comment.
Use a release-triggering commit type
This adopter-facing behavior is committed as chore:, so release-please will not propose a release for it and consumers using the moving @v1 tag will not receive the generated-file marking or improved PR text until an unrelated feat: or fix: lands. Use a release-triggering type for the commit and PR title.
AGENTS.md reference: AGENTS.md:L90-L93
Useful? React with 👍 / 👎.
| # Marked generated, so GitHub collapses the baseline's diffs and leaves it out of | ||
| # the language stats. Only when nothing in .gitattributes decides it already: an | ||
| # explicit opt-out is as deliberate as an opt-in, and other lines are not ours. | ||
| if [ "$(git check-attr linguist-generated -- .codeboarding/analysis.json | awk '{print $NF}')" = unspecified ]; then |
There was a problem hiding this comment.
Check attribute coverage beyond analysis.json
If a repository already marks only .codeboarding/analysis.json (or a subset such as *.json) as generated, this check returns set and skips adding the directory-wide rule. Other installed artifacts such as static_analysis.pkl and health/health_report.json then remain visible in diffs and language statistics, defeating the new behavior. Determine coverage across the installed paths rather than treating this one file as representative.
Useful? React with 👍 / 👎.
| # explicit opt-out is as deliberate as an opt-in, and other lines are not ours. | ||
| if [ "$(git check-attr linguist-generated -- .codeboarding/analysis.json | awk '{print $NF}')" = unspecified ]; then | ||
| [ ! -s .gitattributes ] || [ -z "$(tail -c 1 .gitattributes)" ] || printf '\n' >> .gitattributes | ||
| printf '.codeboarding/** linguist-generated=true\n' >> .gitattributes |
There was a problem hiding this comment.
Limit the generated attribute to generated artifacts
Repositories can contain hand-written files under .codeboarding/; the existing sync contract explicitly preserves examples such as .codeboardingignore, health_config.json, health ignore rules, and notes.md. This blanket pattern labels those files as generated too, causing GitHub to collapse genuine user-authored configuration changes and omit applicable files from language statistics. Emit attributes only for the engine-produced paths rather than the entire directory.
Useful? React with 👍 / 👎.
| if [ "$(git check-attr linguist-generated -- .codeboarding/analysis.json | awk '{print $NF}')" = unspecified ]; then | ||
| [ ! -s .gitattributes ] || [ -z "$(tail -c 1 .gitattributes)" ] || printf '\n' >> .gitattributes | ||
| printf '.codeboarding/** linguist-generated=true\n' >> .gitattributes | ||
| echo .gitattributes >> "$GENERATED_PATHS" |
There was a problem hiding this comment.
Prevent the generated attributes commit from retriggering sync
When sync_strategy: pull_request is used and the first rolling PR is merged with a human-authored merge commit, the new root .gitattributes path is not covered by either the repository's or the README's push.paths-ignore list. The merge is therefore treated as a source push and starts another sync analysis; unlike a direct bot push, the author-email guard does not skip it. Include this generated path in the documented loop guard or avoid committing an additional root-level path.
Useful? React with 👍 / 👎.
…ange Review follow-ups on the attributes line: - It is added after the unchanged check, so it never makes a commit of its own: the push strategy no longer pushes an attributes-only commit, and the pull_request strategy no longer re-creates a sync PR for it. - It names the generated files (analysis.json, fingerprint.json, static_analysis.pkl, static_analysis.sha, codeboarding_version.json, health/health_report.json) instead of .codeboarding/**, which also covered .codeboardingignore and the health configuration people write. Each path some line already decides is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changed and why
A team that keeps the CodeBoarding baseline on its branch gets
.codeboarding/in every diff and counted in the repository's language stats, and the rolling sync PR said nothing about what the files are.deliver-sync.sh(push and pull_request strategies) marks the generated baseline fileslinguist-generated=truein.gitattributes, inside the same sync commit, so GitHub collapses their diffs and leaves them out of language stats. It names them one by one (analysis.json,fingerprint.json,static_analysis.pkl,static_analysis.sha,codeboarding_version.json,health/health_report.json) so the configuration people write under.codeboarding/stays unmarked. A path some line already decides (an opt-out included) is left alone, and no other line is touched. The line is added only alongside a real baseline change, so it never makes a commit or a sync PR of its own.What it looks like
This PR changes nothing visible in the web platform UI. On GitHub, the sync commit's
.codeboarding/files render as generated (collapsed) in diffs, and the sync PR body reads as above. The body is set when the rolling PR is created; an already-open sync PR keeps its old body until it is next recreated.How it was tested
New tests in
tests/test_action_sync.pyagainst a real local remote: attributes added in the sync commit alongside the analysis, existing lines kept and appended to (including a file without a trailing newline), a line covering some paths leaves only the rest added, an explicit opt-out respected, no attributes-only commit when the baseline is unchanged, user-written files left unmarked, and the pull_request strategy's body and sync-branch commit.python -m unittest discover -s tests: 186 tests, all pass excepttest_sync_without_baseline_uses_configured_depth_directly, which fails identically onmainlocally because macOS ships bash 3.2 (${FORCE_FULL,,}; fixed in #140); CI runs bash 5. Black 25.9.0 via the pre-commit hook; shellcheck on all action scripts.🤖 Generated with Claude Code