Repository navigation
fix(review): a readable PR comment: diff-anchored inline comments, no reposts, grouped rules, size budget, new-only PII, no portability noise #1721
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
0c4e2c6
147c38d
cfb0aa4
6143055
aca1e85
932cf6f
3f7ae53
18613b9
56a227e
29778be
4e25546
bc71523
1765b8d
1b4ffd1
2aa4fd1
18eb89d
f25ae0a
55f1f91
075fcee
d272b58
619331a
81259a4
fa570f8
12aea2d
2ad0660
2e674a7
44c7ee0
6f1682b
5d80f3d
bfb900c
f804832
db76ec1
c9e33bd
e7ac0a6
fa21744
dd9f9ff
1d91982
366abe9
0d575b3
3692322
e34e5ef
7c13b48
c6c73c0
bb81d27
b3d64e2
0aca7d9
36159a8
8e859b0
374b92e
3382f41
1552676
219f3e8
eb54e51
e0e3ba0
0212e2e
139da8a
b637b11
48f53c8
9f5954a
668d076
b6e15e5
67a9bb1
3f6665b
fdf1480
e8e509e
cd547e6
a5f79d7
17d9001
8f2e301
a0a3310
05795d4
f992c07
f4d5ce6
601f1a7
79308b8
c7a3d3d
5533949
7548ddf
72f9abc
d8895dc
2cf3250
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 |
|---|---|---|
|
|
@@ -254,6 +254,18 @@ dropped on the next run. `--post` targets **GitHub** PRs (it reads `GITHUB_TOKEN | |
| run with `--json`/`--output` and post the verdict using that platform's own API — | ||
| native GitLab posting is not yet built in. | ||
|
|
||
| The summary comment is updated in place only if the token's own account posted it. | ||
| For a personal access token, the account is the `/user` login. For Actions' own | ||
| `GITHUB_TOKEN`, it is `github-actions[bot]`. A GitHub App installation token cannot | ||
| read `/user`, so set `ALTIMATE_REVIEW_BOT_LOGIN` to the app's bot login (for example | ||
| `my-app[bot]`). Without it, outside Actions, each run posts a new summary comment | ||
| rather than risk editing another bot's comment. Inside Actions, an App token without | ||
| the variable is treated as `github-actions[bot]`: it never finds the summary it | ||
| posted earlier and adds a new one on every run, and if the PR already has a | ||
| `github-actions[bot]` summary it updates that one and no longer recognises its own | ||
| inline comments, so they are posted again. Set `ALTIMATE_REVIEW_BOT_LOGIN` whenever | ||
| the review posts with an App token. | ||
|
|
||
| ## Configuration — `.altimate/review.yml` | ||
|
|
||
| Per-repo configuration, the analogue of an `AGENTS.md`. Tune the rubric, choose | ||
|
|
@@ -264,6 +276,9 @@ mode: comment # comment | gate | |
| severityThreshold: suggestion | ||
| manifestPath: target/manifest.json | ||
| dialect: snowflake | ||
| # portability: true # cross-engine advice. Unset: off once the engine is known | ||
| # (configured or detected). An explicit value applies even when | ||
| # the engine is unknown. Set true for multi-adapter packages. | ||
| reviewers: [] # empty = risk-tier defaults; or pin lanes | ||
| dataDiff: # OFF by default — see "Data-diff in CI" below | ||
| enabled: false | ||
|
|
@@ -283,6 +298,39 @@ rubric: | |
| skipNonProdModels: true | ||
| ``` | ||
|
|
||
| ### What the PR comment shows | ||
|
|
||
| - **One summary comment**, updated in place on every push, capped at about | ||
| 5,000 characters. Critical findings come first; anything that does not fit is | ||
| counted, and the full list is always in the job log and the verdict envelope | ||
| (`altimate review --json --output <file>`). Local CLI output is never truncated. | ||
| - **Repeated findings are grouped:** the same rule and message (ignoring model | ||
| and column names) at the same severity on three or more models is one bullet | ||
| listing the models, with each model's own names when they differ. Local CLI output lists every | ||
| finding with its location. | ||
| - **Inline comments only on lines of the PR's diff.** Findings computed on | ||
| compiled SQL, or on unchanged lines, stay in the summary. | ||
| - **No re-posting on reruns:** each inline comment carries the finding's | ||
| fingerprint, so a push does not repeat findings already on the PR, and a | ||
| non-blocking rerun with nothing new and the same headline as the bot's last | ||
| review only updates the summary. | ||
| - **PII:** flagged only for PII columns the change newly exposes, not for | ||
|
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
|
||
| columns the base already surfaced. That comparison needs the base version's | ||
| SQL; when it can't be compiled, PII columns are reported as non-blocking | ||
| warnings that may predate the PR. One case still blocks without a compiled | ||
| base: the diff adds a highly sensitive column (an SSN, a passport or card | ||
| number, a date of birth) to a `marts/` or `reporting/` model, the base file's | ||
| own SQL cannot expose it (it does not name the column, select `*`, or call a | ||
| macro), and the column reaches the model's output unmasked, directly or | ||
| through CTEs and subqueries, from the added line or from anywhere else in the | ||
| model. A column that is hashed, masked or dropped everywhere it is read | ||
|
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. [WARNING]: A model ending in
Contributor
Author
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. Confirmed: a CTE's 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. P2: Qualify this warning: when a masked value is later selected by its original column name, the reach analysis can still classify the finding as critical. Prompt for AI agents
Contributor
Author
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. Same as the docs comment above on a hashed column that keeps its name. The follow-up corrects that line. |
||
| (`sha2(ssn)`, `right(ssn, 4)`, `* exclude (ssn)`) stays a warning; one that | ||
| only passes through a value-preserving expression (`coalesce(ssn, '')`, | ||
| `max(ssn)`) still blocks. So does one the review cannot rule out: in SQL it | ||
| cannot follow (Jinja that builds the select list, lateral or scalar | ||
| subqueries, unusual syntax), or in a model whose output also takes a `*` or a | ||
| Jinja column list over a table, whose columns the SQL does not show. | ||
|
|
||
| ### Risk-tier path tokens | ||
|
|
||
| Named categories under `riskTierPathTokens` promote any diff touching a matching | ||
|
|
||
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.
P2:
commentableLinesdeliberately includes unchanged context lines inside diff hunks, so this sentence incorrectly promises those findings remain in the summary. Say “outside the PR’s diff hunks” instead.Prompt for AI agents
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.
In this PR a finding on an unchanged context line inside a hunk can get an inline comment. A later PR in this stack marks such findings pre-existing and keeps them out of the inline set, which makes the sentence true.