Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,32 @@ The guide's request body, the same xz-compressed bytes the service receives, is
`closed/bundle.json.xz`, so the guide can be generated again later from the same inputs. It
never carries `source.json`, and it is left out when no guide request goes out.

A third request, `POST /v1/merge-risk`, goes to the same base URL at the same time and sends
no analysis: only the pull request's title, description and changed files with their patches, as
GitHub lists them. The service counts size and tests itself, asks a fixed nine-question checklist
about the diff (sign-in and access, billing, stored data, releases, dependency and platform versions,
public interfaces, calls to other services), has a model decide each answer and a second pass drop
the false alarms, with a sentence and the changed line behind each risk it keeps. With your own
provider key it sends the same provider headers as the guide: your model makes the decision and the
review, and the checklist's classifier, which only CodeBoarding's key can reach, is skipped. With
`closed_features_source: false` it sends neither patches nor the description, only each file's
path, additions and deletions; a diff too large to send with its patches goes the same way. Without patches the
checklist cannot run: the answer comes back `partial` with size and tests only, the run logs a
notice, and the web platform shows the level as not assessed rather than reading the silence as
clean. This input does not keep code from the review guide, whose request carries the changed files
at both commits.
The answer is saved as `closed/merge_risk.json` with the head it describes, and summed up in one
hidden line of the review comment, `<!-- codeboarding:merge_risk {json} -->`, which the web
platform's dashboard reads. When the request fails, or the pull request moved on to a newer head
during the run, neither is written and the run logs one notice.

Only architecture receives optional `source.json`: tracked Python, JavaScript/TypeScript
and C# files (`.py`, `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`, `.cs`, `.csproj`), excluding
dependency/build directories, docs/public/fixtures, minified JS and TypeScript declarations.
Symlinks are not read. Individual files are capped at 300 KB and source at 16 MB. If adding
source exceeds the 4.3 MB compressed request limit, it is omitted with a reason; architecture
still runs with the required inputs. `closed_features_source: false` also omits source.
still runs with the required inputs. `closed_features_source: false` also omits source, and
merge risk then sends its file list without patches.
An unsupported provider skips the guide, but architecture can still return measured findings.

### Providers
Expand Down Expand Up @@ -409,8 +429,8 @@ The update runs after the baseline is saved, stops itself after 10 minutes and n
| `github_token` | both | `${{ github.token }}` | Token for comments and sync delivery. |
| `codeboarding_analysis_location` | both | `codeboarding_branch` | Where the synced branch's analysis is stored: `codeboarding_branch` (on `codeboarding/baseline`, for the default branch; the code is never written) or `in_place` (committed as `.codeboarding/` on the synced branch). Sync saves it there and review reads it from there. |
| `warmstart_retention_days` | review | `1` | Days to keep the reusable analysis. Only the next run reads it. |
| `review_guide_url` | both | `https://jxivqwx4or6oip3krgdmdaiunm0iaybf.lambda-url.us-east-1.on.aws/` | Experimental. Shared base URL for `/v1/review-guide` and `/v1/architecture`, and for sync's `/v1/briefing` when `problem_history` is on. Saves `review_guide.json`, `closed/architecture.json` and the guide's request (`closed/bundle.json.xz`) in the review artifact. Set to `''` to disable all three. Never fails the run. |
| `closed_features_source` | review | `true` | Whether architecture checks may read this repository's source. Only the architecture request carries it, capped in size, and the service keeps nothing. The model sees code around a finding, never the tree. With `false`, source-dependent checks and model review do not run, and the result says so. |
| `review_guide_url` | both | `https://jxivqwx4or6oip3krgdmdaiunm0iaybf.lambda-url.us-east-1.on.aws/` | Experimental. Shared base URL for `/v1/review-guide`, `/v1/architecture` and `/v1/merge-risk`, and for sync's `/v1/briefing` when `problem_history` is on. Saves `review_guide.json`, `closed/architecture.json`, `closed/merge_risk.json` and the guide's request (`closed/bundle.json.xz`) in the review artifact. Set to `''` to disable them all. Never fails the run. |
| `closed_features_source` | review | `true` | Whether architecture checks may read this repository's source. Only the architecture request carries it, capped in size, and the service keeps nothing. The model sees code around a finding, never the tree. With `false`, source-dependent checks and model review do not run, and the result says so; merge risk sends the changed files' paths and line counts without their patches. It does not change what the review guide's request carries. |
| `problem_history` | sync | `false` | Opt-in. With `'true'`, each sync sends this repository's issues and merged pull requests to `review_guide_url` and commits the returned problem list as `problems.json` on the orphan branch `codeboarding/briefing`. Needs `contents: write`, `issues: read`, `pull-requests: read`, `actions: read` and `id-token: write` on the sync job. See [Problem history](#problem-history). Never fails the run. |

`target_branch` and `sync_strategy` are deprecated, and read as the `codeboarding_analysis_location` they stand for, with a warning: `sync_strategy: push` as `in_place`, `sync_strategy: pull_request` as `codeboarding_branch`. `target_branch` is accepted only when it names the branch the run is on: the push trigger picks the branch. `force_full: true` is ignored with a warning. Anything the new input cannot express fails, linking to [moving an existing setup](#moving-an-existing-setup).
Expand Down
15 changes: 10 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ inputs:
default: '2'
review_guide_url:
description: >-
Experimental. Service base URL for POST /v1/review-guide and POST /v1/architecture.
Defaults to production. Both receive this run's analysis independently; results are stored
as review_guide.json and closed/architecture.json, and the guide's request as sent as
closed/bundle.json.xz. Set to an empty string to disable both.
Experimental. Service base URL for POST /v1/review-guide, POST /v1/architecture and
POST /v1/merge-risk. Defaults to production. The first two receive this run's analysis and
the third its title, description and changed files, independently; results are stored as review_guide.json,
closed/architecture.json and closed/merge_risk.json, and the guide's request as sent as
closed/bundle.json.xz. Merge risk is also summed up in a hidden line of the review comment.
Set to an empty string to disable all three.
Sync's opt-in problem_history calls POST /v1/briefing on the same URL.
required: false
default: 'https://jxivqwx4or6oip3krgdmdaiunm0iaybf.lambda-url.us-east-1.on.aws/'
Expand All @@ -157,7 +159,8 @@ inputs:
Whether architecture checks may read this repository's source, for checks that
need the whole tree and to verify a finding. Only the architecture request carries it, capped in
size, and the service keeps nothing. The model sees the code around a finding, never the tree.
With 'false' those checks and the model review do not run, and the result says so.
With 'false' those checks and the model review do not run, and the result says so. Merge
risk then sends the changed files' paths and line counts without their patches.
required: false
default: 'true'
problem_history:
Expand Down Expand Up @@ -809,6 +812,8 @@ runs:
HEAD_SHA: ${{ steps.guard.outputs.head_sha }}
# Analysed files whose content hash differs between base and head, from the render step.
ANALYSED_FILES_CHANGED: ${{ steps.review_render.outputs.analysed_files_changed }}
# Set by the remote features step when the service answered merge risk; empty otherwise.
MERGE_RISK_LINE: ${{ steps.remote_features.outputs.merge_risk_line }}
run: "$GITHUB_ACTION_PATH/scripts/action/build-review-comment.sh"

- name: Post review comment
Expand Down
5 changes: 5 additions & 0 deletions scripts/action/build-review-comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ fi
printf '[download artifacts](%s) · ' "$ARTIFACT_URL"
fi
printf 'run [%s](%s)</sub>\n' "$GITHUB_RUN_ID" "$RUN_URL"
# Merge risk at this head, for the web platform's dashboard: one more hidden line, only when the
# service answered (see merge_risk_line in remote_features.py). Before the line below, which stays last.
if [ -n "${MERGE_RISK_LINE:-}" ]; then
printf '%s\n' "$MERGE_RISK_LINE"
fi
# The machine-readable line: what a reader of the comment (the web platform's dashboard, an
# agent) needs without parsing the prose or the diagram. An HTML comment renders as nothing.
# Keep it one line, `key=value` pairs, values without spaces, so a regex over it stays trivial.
Expand Down
Loading
Loading