-
Notifications
You must be signed in to change notification settings - Fork 2
fix: stop discarding the health report #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,11 @@ cp "$ANALYSIS_PATH" "${RUNNER_TEMP}/cb-review-artifact/analysis.json" | |
| # branch's committed baseline instead would drift from the merge base exactly as | ||
| # the review itself used to. | ||
| cp "$BASE_ANALYSIS_PATH" "${RUNNER_TEMP}/cb-review-artifact/base_analysis.json" | ||
| # The engine writes this next to the analysis it came from. Ship it when present | ||
| # so a pull request's warnings are readable without rerunning the analysis. | ||
| HEALTH_REPORT="$(dirname "$ANALYSIS_PATH")/health/health_report.json" | ||
| [ ! -f "$HEALTH_REPORT" ] || cp "$HEALTH_REPORT" "${RUNNER_TEMP}/cb-review-artifact/health_report.json" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an incremental review is seeded from the merge-base state or a previous PR-chain run and Core produces no health report, the seeded Useful? React with 👍 / 👎. |
||
|
|
||
| # base_sha stays the event's base branch tip for consumers that key on it; | ||
| # merge_base_sha records the commit the diagram actually compared against. | ||
| # pr_base_sha carries the same value under the name the webview already reads: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,18 +40,25 @@ for name in "${artifacts[@]}"; do | |
| printf '%s\n' "$target" | ||
| done | ||
|
|
||
| # Remove identifiable v1 Markdown and its generated health report. | ||
| # The engine writes a health report on every run, full or incremental. Install it | ||
| # beside the analysis so the extension and webview can read warnings without | ||
| # regenerating, and remove a stale one when a run produced none. | ||
| health_source="$ANALYSIS_DIR/health/health_report.json" | ||
| health_target="$output/health/health_report.json" | ||
| if [ -f "$health_source" ]; then | ||
| mkdir -p "$output/health" | ||
| cp "$health_source" "$health_target" | ||
|
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a previous baseline already contains a health report but the current engine run produces none, Useful? React with 👍 / 👎. |
||
| elif [ -e "$health_target" ]; then | ||
| rm -f "$health_target" | ||
| fi | ||
| printf '%s\n' "$health_target" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Whenever this path is installed and staged, Useful? React with 👍 / 👎. |
||
|
|
||
| # Remove identifiable v1 Markdown. | ||
| marker='https://img.shields.io/badge/Generated%20by-CodeBoarding' | ||
| for legacy in "$output"/*.md "$CHECKOUT_DIR/docs/development/architecture.md"; do | ||
| [ -f "$legacy" ] || continue | ||
| grep -Fq "$marker" "$legacy" || continue | ||
| rm -f "$legacy" | ||
| printf '%s\n' "$legacy" | ||
| done | ||
| legacy="$output/health/health_report.json" | ||
| if [ -e "$legacy" ]; then | ||
| rm -f "$legacy" | ||
| printf '%s\n' "$legacy" | ||
| fi | ||
|
|
||
| echo "installed=$installed" >> "$GITHUB_OUTPUT" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once sync commits this newly listed file, the workflow example below still omits
.codeboarding/health/health_report.jsonfrompaths-ignore. In the documentedsync_strategy: pull_requestsetup, merging the rolling PR can therefore trigger another full sync job because the merge commit is not necessarily authored with the bot email handled byguard.sh; that redundant run consumes analysis time and LLM quota even though it should find no baseline change. Add the generated health path to the sample ignore list, as the repository's own sync workflow already does.Useful? React with 👍 / 👎.