chore: bump CodeBoarding version to 0.13.7 - #76
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c4035ee84
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| rm -rf "$OUTPUT_DIR" | ||
| mkdir -p "$OUTPUT_DIR" "$OUTPUT_DIR/health" |
There was a problem hiding this comment.
Preserve user-authored CodeBoarding configuration
Every sync run deletes the entire .codeboarding directory and reconstructs only generated artifacts before staging it. Repositories with .codeboarding/.codeboardingignore, health/.healthignore, health_config.json, or other user-authored configuration will therefore commit their deletion on the next sync, changing future analysis scope. Remove only owned generated files or restore the configuration files before staging.
Useful? React with 👍 / 👎.
| PR_URL="$(gh pr list --repo "$REPO" --head "$SYNC_PR_BRANCH" --base "$TARGET_BRANCH" --state open --json url --jq '.[0].url // empty' || true)" | ||
| if [ -z "$PR_URL" ]; then | ||
| gh pr create --repo "$REPO" --head "$SYNC_PR_BRANCH" --base "$TARGET_BRANCH" --title "$PR_TITLE" --body "CodeBoarding sync PR for ${TARGET_BRANCH}." >/dev/null 2>&1 || true | ||
| PR_URL="$(gh pr list --repo "$REPO" --head "$SYNC_PR_BRANCH" --base "$TARGET_BRANCH" --state open --json url --jq '.[0].url // empty' || true)" |
There was a problem hiding this comment.
Pass the push token to GitHub CLI
When sync_strategy=pull_request, these gh pr commands have no authentication environment variable: push_token exists only as a shell variable used in the Git remote URL. The checked gh help environment documentation identifies GH_TOKEN or GITHUB_TOKEN as the authentication variables, so on a normal hosted runner the list/create calls fail; because their errors are swallowed, the branch is pushed and committed=true is reported without opening the promised rolling PR.
Useful? React with 👍 / 👎.
| ```mermaid | ||
| $(cat "${{ steps.review_render.outputs.diagram_md }}") | ||
| ``` |
There was a problem hiding this comment.
Build the review comment body before posting it
For every successful review, message is an action input rather than a shell script, so $(cat "...") is posted literally instead of reading the diagram file. Additionally, diff_to_mermaid.py already writes a complete fenced ```mermaid block, while this input adds another fence around it. The sticky comment therefore cannot contain a valid rendered architecture diagram; pass the generated file through the action's path input or construct a body file first.
Useful? React with 👍 / 👎.
| if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then | ||
| echo "::error::Missing OIDC token. Add permissions: id-token: write." && exit 1 | ||
| fi |
There was a problem hiding this comment.
Retain the documented non-OIDC credential path
Users following the documented llm_api_key/bring-your-own-provider setup commonly omit id-token: write, but this change removes that input and now unconditionally fails whenever the OIDC variables are absent. Those existing workflows receive an unexpected-input warning and then stop here before analysis, even though README still explicitly says OIDC can be omitted when an API key is supplied. Either restore direct-key handling or update the supported contract without breaking those runs.
Useful? React with 👍 / 👎.
| git config user.name "codeboarding-review[bot]" | ||
| git config user.email "codeboarding-review[bot]@users.noreply.github.com" | ||
| git add "$OUTPUT_DIR" 2>/dev/null || true |
There was a problem hiding this comment.
Stage the generated architecture document
The render step writes docs/development/architecture.md, but the commit step stages only .codeboarding. Consequently the architecture document is never included in either direct sync commits or rolling sync PRs; if it is the only meaningful change, the cached-diff check also exits as though nothing changed. Stage this file alongside the generated output directory.
Useful? React with 👍 / 👎.
| if [ "$NEED_FULL" = "true" ]; then | ||
| rm -rf "$HEAD_DIR" && mkdir -p "$HEAD_DIR" |
There was a problem hiding this comment.
Preserve the head checkout during local full fallback
In the local harness, HEAD_DIR is the registered worktree containing the PR source. When incremental analysis requests a full fallback, this deletes that checkout and recreates it using only analysis artifacts copied from the base output; run_full then analyzes HEAD_DIR, which no longer contains the head repository's code. Keep the checkout intact and use a separate output directory so fallback analyzes the requested head revision.
Useful? React with 👍 / 👎.
| echo "target_sha=$GITHUB_SHA" >> "$GITHUB_OUTPUT" | ||
| echo "target_branch=$REF_NAME" >> "$GITHUB_OUTPUT" | ||
| echo "checkout_ref=$GITHUB_SHA" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Preserve the intended target for manual rolling syncs
The guard now hardcodes the sync target branch to github.ref_name. For a workflow_dispatch launched from a feature ref with sync_strategy=pull_request, this opens the rolling baseline PR into that feature branch rather than main; the removed workflow wiring explicitly targeted main for this dogfood scenario. Retain a configurable target branch or resolve manual rolling syncs to the intended default branch.
Useful? React with 👍 / 👎.
| if git diff --cached --quiet; then | ||
| echo "::notice::Generated architecture is unchanged; nothing to commit." | ||
| reconcile_stale_sync_pr | ||
| echo "files_written=${#new_md[@]}" >> "$GITHUB_OUTPUT" | ||
| echo "::notice::Generated architecture is unchanged." | ||
| echo "files_written=0" >> "$GITHUB_OUTPUT" | ||
| echo "committed=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 |
There was a problem hiding this comment.
Close obsolete rolling sync PRs on a no-op
With sync_strategy=pull_request, a no-op can occur after an earlier unmerged sync PR became obsolete—for example, source changes produced a baseline PR and were then reverted before that PR was merged. This early exit leaves the old sync branch and PR open, so it can still be merged and install a baseline that no longer represents the target branch. Reconcile or delete the machine-owned branch before returning when the freshly generated artifacts match the target.
Useful? React with 👍 / 👎.
| N_CHANGED="$(jq -r '.n_changed' "$META")" | ||
| TRUNCATED="$(jq -r '.truncated | ascii_downcase' "$META")" | ||
| echo "diagram_md=$DIAGRAM_OUT" >> "$GITHUB_OUTPUT" | ||
| echo "n_changed=$N_CHANGED" >> "$GITHUB_OUTPUT" | ||
| echo "truncated=$TRUNCATED" >> "$GITHUB_OUTPUT" | ||
| echo "rendered=true" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Propagate the renderer's actual rendered status
The renderer emits rendered: false and writes an empty file when even its changed-only fallback cannot fit GitHub's limits or when there are no drawable components, but this step ignores that metadata and unconditionally exports rendered=true. Downstream steps then upload and post an empty Mermaid payload as if rendering succeeded. Read .rendered from diagram_meta.json and gate the comment on that value.
Useful? React with 👍 / 👎.
|
|
||
| See the [setup guide](https://github.com/CodeBoarding/CodeBoarding-action#more-usage) for the exact workflow snippet. | ||
| **Hosted webview:** [open artifact](${{ steps.upload_review_artifact.outputs.artifact-url }}) |
There was a problem hiding this comment.
Link to the hosted webview instead of the artifact page
A successful review labels this as a hosted webview but links directly to upload-artifact's artifact-url, which opens GitHub's artifact page/download rather than the CodeBoarding web application. The removed webview_base_url composition means users no longer get the promised interactive head-vs-base view, and unauthenticated viewers cannot access the artifact URL at all. Construct the hosted webview URL from the artifact metadata or describe this accurately as an artifact download.
Useful? React with 👍 / 👎.
0c4035e to
2e9c84f
Compare
Update action default/code example to reference CodeBoarding 0.13.7.