Skip to content

chore: mark the synced baseline as generated and explain it in the sync PR - #141

Open
Svilen-Stefanov wants to merge 2 commits into
mainfrom
chore/sync-gitattributes
Open

Svilen-Stefanov wants to merge 2 commits into
mainfrom
chore/sync-gitattributes

Conversation

@Svilen-Stefanov

@Svilen-Stefanov Svilen-Stefanov commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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 files linguist-generated=true in .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.
  • The rolling sync PR's body now explains the files:
Updates the CodeBoarding files in `.codeboarding/` for `main`. They are generated, not written by hand: the data behind the architecture diagram, and an analysis cache that lets the next run analyze only what changed. Merging this lets pull request reviews start from the saved diagram instead of building one first.

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.py against 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 except test_sync_without_baseline_uses_configured_depth_directly, which fails identically on main locally 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

…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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T15:36:08.988684Z fc00095 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeboarding-review

codeboarding-review Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 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;
Loading

download artifacts · run 37644941047

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/action/deliver-sync.sh Outdated
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread scripts/action/deliver-sync.sh Outdated
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread scripts/action/deliver-sync.sh Outdated
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread scripts/action/deliver-sync.sh Outdated
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant