Skip to content
Draft
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
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,33 @@ The guide's request body, the same xz-compressed bytes the service receives, is
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 changed files with their patches, as GitHub lists them.
With `closed_features_source: false` it sends no patches, only each file's path, additions and
deletions, so the diff's size and the areas its paths fall in still count. A diff too large to
send with its patches goes the same way. Without patches the checks that read added code (areas it
mentions, new dependencies) cannot run: the answer says so in `facts.patches`, the run logs a
notice, and the web platform shows it 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, the diff's merge-risk facts and the reasons they give, 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.
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 eight-question checklist
about the diff (sign-in and access, billing, stored data, releases, dependency and platform versions,
public interfaces), 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, and
merge risk then sends its file list without patches.
An unsupported provider skips the guide, but architecture can still return measured findings.
merge risk then sends its file list without patches and leaves out the pull request's description.
An unsupported provider skips the guide, but architecture can still return measured findings, and
merge risk returns size and tests only (`unchecked: no_model`).

### Providers

Expand Down Expand Up @@ -425,7 +431,7 @@ The update runs after the baseline is saved, stops itself after 10 minutes and n
| `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`, `/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. |
| `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, and not the pull request's description. 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
11 changes: 6 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ inputs:
description: >-
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 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.
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 @@ -160,7 +160,8 @@ inputs:
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. Merge
risk then sends the changed files' paths and line counts without their patches.
risk then sends the changed files' paths and line counts without their patches, and leaves
out the pull request's description, which can quote code.
required: false
default: 'true'
problem_history:
Expand Down
9 changes: 2 additions & 7 deletions scripts/problem_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,11 @@ def review_findings(gh: GitHub, repo: str, pr: int, sha: str) -> dict | None:


def _unread(ledger: dict | None) -> list[dict]:
"""The ledger's merged pull requests whose findings were never read. A ledger from before
`warningsRead` has no flag; a merge with warnings stored counts as read."""
warned = {w.get("pr") for w in (ledger or {}).get("warnings") or [] if isinstance(w, dict)}
"""The ledger's merged pull requests whose findings were never read."""
return [
m
for m in (ledger or {}).get("merged") or []
if isinstance(m, dict)
and isinstance(m.get("number"), int)
and m.get("warningsRead") is not True
and m["number"] not in warned
if isinstance(m, dict) and isinstance(m.get("number"), int) and m.get("warningsRead") is not True
]


Expand Down
Loading
Loading