Skip to content

Report analysis diagnostics in workflow runs - #124

Open
Svilen-Stefanov wants to merge 2 commits into
mainfrom
claude/codeboarding-webview-errors-x3e0sw
Open

Report analysis diagnostics in workflow runs#124
Svilen-Stefanov wants to merge 2 commits into
mainfrom
claude/codeboarding-webview-errors-x3e0sw

Conversation

@Svilen-Stefanov

@Svilen-Stefanov Svilen-Stefanov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add support for reading and reporting analysis diagnostics from CodeBoarding's engine. When an analysis completes but encounters degradations (e.g., language server failures, indexing issues), this change ensures those issues are surfaced to users through workflow annotations, job summaries, and review comments rather than silently publishing incomplete results.

A run that exits zero is not a run that finished cleanly. The engine records every degradation it survived into the analysis it writes; until now this action ignored that field, so a baseline missing a whole language was committed green and a review comment showed a diagram with nothing to say it was short.

Key Changes

  • New script: scripts/analysis_diagnostics.py

    • Reads metadata.run_diagnostics from analysis.json files
    • Generates workflow annotations (warnings for degraded entries, notices for others)
    • Produces Markdown output for job summaries and review comments
    • Handles missing/malformed analysis files gracefully
    • Outputs GitHub Actions outputs for downstream steps to consume
  • New test suite: tests/test_analysis_diagnostics.py

    • Comprehensive unit tests covering entry loading, annotation generation, and Markdown rendering
    • Tests edge cases: missing fields, unparseable JSON, repeated entries, long entry lists
    • Integration tests for the main CLI interface
  • Updated action.yml

    • Added "Read analysis diagnostics" steps in both sync and review modes
    • Steps run with continue-on-error: true to prevent failures from blocking the workflow
    • Pass diagnostic Markdown path to downstream summary/comment scripts
  • Updated scripts/action/sync-summary.sh

    • Conditionally includes analysis diagnostics section in job summary when present
  • Updated scripts/action/build-review-comment.sh

    • Inserts diagnostics block above the diagram in review comments (before the picture is believed)
  • Updated README.md

    • Documents the new analysis diagnostics feature and its user-facing behavior

Implementation Details

  • Diagnostics never fail the run; a degraded analysis is still valuable, and the point is that its reader learns it is degraded
  • Entries without actionable remedies link to Discord instead of inventing instructions
  • Long entry lists are capped at 10 rendered entries with a "…and N more" indicator
  • Repeated issues show occurrence counts (e.g., "×3")
  • Graceful degradation: missing analysis files, unparseable JSON, and missing diagnostic fields all result in empty output rather than errors

Where the block goes, and why

Above the diagram in the review comment, not below it. A caveat printed under a picture is read after the picture is believed, which is the failure this whole change exists to remove. In sync mode it goes in the job summary, because a baseline that is short a language is committed and then read for weeks.

Ordering with the engine

Per AGENTS.md, the engine is a separate repo pinned by codeboarding== in action.yml, so this reads a field that only exists once CodeBoarding/CodeBoarding#580 ships in a release and that pin is bumped. Until then load_entries finds nothing, the step writes an empty file, and every summary and comment looks exactly as it does today. Nothing to sequence and nothing to roll back.

Verification

python3 -m unittest discover -s tests passes (177 tests, 7 skipped), and black --check is clean. The lint job also runs actionlint and pre-commit, neither of which I could run in this environment; the action.yml additions copy the shape of the steps beside them.

Companion changes

One change across three repositories, all on the branch claude/codeboarding-webview-errors-x3e0sw:

https://claude.ai/code/session_01BSnQMqJKj7zbdfjy7KHF9x

… them

A run that exits zero is not a run that finished cleanly. Core records every
degradation it survived — a language server that never started, a language
nothing indexed under, naming that stopped answering — in the analysis it
writes. Until now this action ignored that field, so a baseline missing a
whole language was committed green and a review comment showed a diagram with
nothing to say it was short.

Read metadata.run_diagnostics back and put it where the reader already is: an
annotation per entry on the run page, the list in the sync job summary, and the
same list at the top of the review comment, above the diagram rather than under
it — a caveat printed below a picture is read after the picture is believed.

Entries carry their own remedy. Where nothing on the reader's side would have
changed the outcome the remedy is empty, and the block links Discord instead of
inventing an instruction nobody can follow.

Diagnostics never fail the run: a degraded analysis is still worth having, and
the point is that its reader learns it is degraded. An analysis written by an
engine that predates the field, or one that never got written at all, reads as
silence rather than an error.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSnQMqJKj7zbdfjy7KHF9x
The same title/detail/remedy strings render in the webview, which enforces the
house rule with a test, so the prose the action wraps them in should read the
same way rather than switching voice between surfaces.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSnQMqJKj7zbdfjy7KHF9x
@codeboarding-review

codeboarding-review Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 1 changed component

See the full change in CodeBoarding.

Compared against the merge base: this branch is 6 commits behind main.

graph LR
    n_GitHub_Action_Automation_Scripts["GitHub Action Automation 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;
    class n_GitHub_Action_Automation_Scripts modified;
Loading

download artifacts · run 34281105644

@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: 6c66dd8664

ℹ️ 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 action.yml
# An analysis that finished is not an analysis that finished cleanly. The engine
# records every degradation it survived; without this the run is green and the
# committed diagram is short of a language with nothing to say so.
- name: Read analysis diagnostics

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 Prefix the commit subject with feat:

If this commit is merged or rebased with its current subject, Report analysis diagnostics in workflow runs is not a Conventional Commit, so release-please will skip this adopter-facing feature and will not propose the release that moves the v1 tag. Use a feat: subject for the commit and PR title so consumers actually receive the new workflow behavior.

AGENTS.md reference: AGENTS.md:L88-L93

Useful? React with 👍 / 👎.

for entry in entries:
level = "warning" if entry.get("severity") == "degraded" else "notice"
remedy = entry.get("remedy") or f"Nothing on your side causes this; please report it: {DISCORD_URL}"
lines.append(f"::{level}::{entry.get('title', 'Analysis diagnostic')} {entry.get('detail', '')} {remedy}")

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 Escape diagnostic text before emitting workflow commands

When an engine diagnostic contains a newline in its title, detail, or remedy, this emits multiple physical log lines, so only the first is part of the intended annotation and a later line beginning with workflow-command syntax can create a spurious annotation. Multiline language-server or model failure details are a realistic input, and tests/test_llm_contract.py::test_the_annotation_stays_one_line_however_rich_the_remedy already records the repository's one-line requirement; normalize or workflow-command-escape these fields before printing.

Useful? React with 👍 / 👎.

Comment thread action.yml
continue-on-error: true
shell: bash
env:
ANALYSIS_PATH: ${{ steps.review_analyze.outputs.analysis_path }}

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 Include baseline diagnostics in review warnings

When the merge-base analysis is degraded but the subsequent head analysis completes cleanly, the rendered review still compares against an incomplete base and can report structures missing from that base as PR additions, yet this step reads only the head analysis path. Because review_analyze produces a separate base_analysis_path, its run diagnostics are not reliably represented by the head's per-run metadata; read and deduplicate diagnostics from both analyses before building the review comment.

Useful? React with 👍 / 👎.

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.

2 participants