Repository navigation
chore(release): v0.12.13 #1892
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
chore(release): v0.12.13 #1892
Changes from all commits
bf1579e
27e7a1a
02c9864
37a00bc
3299191
91c0056
e609e2f
40c2e00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,7 +218,8 @@ function renderSummaryWith(env: VerdictEnvelope, opts: RenderOptions): string { | |
|
|
||
| if (!env.findings.length) { | ||
| // With a broken run, no findings means not checked, not clean; with files | ||
| // left unverified it is clean only as far as the checks reached. | ||
| // left unverified it is clean only as far as the checks reached; a | ||
| // lint-only run checked less, so its empty result is not an all-clear. | ||
| const unverified = unverifiedFiles(env) | ||
| const hiddenBehind = (env.withheld ?? []).some((w) => w.verdict > 0 || (w.reason !== undefined && w.reason !== "rule_off")) | ||
| lines.push( | ||
|
|
@@ -230,7 +231,9 @@ function renderSummaryWith(env: VerdictEnvelope, opts: RenderOptions): string { | |
| ? "No findings are listed: the findings behind this verdict are hidden (see above)." | ||
| : unverified | ||
| ? `No issues found; ${unverified} file(s) not fully verified (see above).` | ||
| : "No issues found in the changed dbt models. 🎉", | ||
| : env.summary.degraded | ||
| ? "No lint findings in the changed dbt models." | ||
| : "No issues found in the changed dbt models. 🎉", | ||
|
Comment on lines
+234
to
+236
Contributor
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. [🔵 LOW] According to the code quality checklist, nested ternary expressions are not allowed. Adding another level of ternary expression here makes the code harder to read. Consider refactoring the entire block to use let summaryMessage = "No issues found in the changed dbt models. 🎉";
if (reviewIncomplete(env)) {
summaryMessage = "No issues were reported, but the review did not complete (see above).";
} else if (unverified) {
summaryMessage = `No issues found; ${unverified} file(s) not fully verified (see above).`;
} else if (env.summary.degraded) {
summaryMessage = "No lint findings in the changed dbt models.";
}
lines.push(summaryMessage, "");
Collaborator
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. Leaving it: it continues the existing ternary, and the order of the cases reads top to bottom.
Comment on lines
+234
to
+236
Contributor
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. [🔵 LOW] According to the code quality guidelines, nested ternary expressions are not allowed. Adding the Consider refactoring this logic into an let message = "No issues found in the changed dbt models. 🎉";
if (env.verdict > 0) {
message = "No findings are listed: the run is degraded (see above), so not all issues might have been detected.";
} else if (hiddenBehind) {
message = "No findings are listed: the findings behind this verdict are hidden (see above).";
} else if (unverified) {
message = `No issues found; ${unverified} file(s) not fully verified (see above).`;
} else if (env.summary.degraded) {
message = "No lint findings in the changed dbt models.";
}
lines.push(message, ""); |
||
| "", | ||
| ) | ||
| lines.push(...ledgerBlock(env, Math.max(120, maxChars - [...lines, ...tail].join("\n").length))) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ import path from "node:path" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { readFile, realpath, stat, access, readdir } from "node:fs/promises" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import YAML from "yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Installation } from "../../installation" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { aiLaneEnabled, headPolicyChanges, loadReviewPolicy, policyHash, resolveRubric } from "./config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { aiLaneEnabled, CANDIDATE_FILES, headPolicyChanges, loadReviewPolicy, policyHash, resolveRubric } from "./config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { SEVERITY_ORDER, type Severity } from "./finding" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| collectChangedFiles, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -375,9 +375,25 @@ export async function reviewPullRequest(opts: ReviewPullRequestOptions): Promise | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| policy.changedInPr = [...new Set([...policy.changedInPr, ...addedHere])] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const config = policy.config | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const cwdRel = await repoRelative(gitRoot, opts.cwd, true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (resolved && cwdRel !== undefined && policy.source === "default" && !policy.changedInPr.length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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: This guard can make the target-policy notice wrong when Prompt for AI agents
Collaborator
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. 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: The merge-base policy notice is skipped when the PR also edits the policy The Consider dropping
Collaborator
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. Fixed in e609e2f: when the merge-base has no policy, the "this PR changes .altimate/review" line now says the default policy was applied, not the base branch's. The rebase advice stays off when the PR adds its own policy, since rebasing would put the PR's file in conflict with the target's. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // A PR branched before the target branch gained its policy is reviewed under the defaults. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const rel of CANDIDATE_FILES) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const atTip = await showAtRef(opts.cwd, resolved.ref, path.posix.join(cwdRel, rel)).catch(() => undefined) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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: This catch treats every Git failure as a missing policy file, so repository/ref errors silently suppress the diagnostic. Prompt for AI agents
Suggested change
Collaborator
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. Deliberate. This lookup only decides whether to print a hint; a git failure there must not fail the review. The policy itself is read from the merge-base by 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. Check inherited policy directories for the rebase notice. With Check the same ordered directories used by policy loading. Keep the applied policy pinned to the merge-base.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (atTip === undefined) continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.stderr.write( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `ℹ️ ${resolved.ref} has a ${rel} that the merge-base (${resolved.sha.slice(0, 10)}) lacks, ` + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `so the default policy was applied. Rebase onto ${resolved.ref} to be reviewed under its policy.\n`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| break | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+378
to
+390
Contributor
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. [🟠 MEDIUM] Since policy loading cascades up to Consider iterating through Suggested change:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (policy.changedInPr.length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.stderr.write( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `ℹ️ this PR changes .altimate/review (${policy.changedInPr.join(", ")}); the base branch's policy was applied.\n`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `ℹ️ this PR changes .altimate/review (${policy.changedInPr.join(", ")}); ` + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (policy.source === "default" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? `the merge-base has no policy, so the default policy was applied.\n` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : `the base branch's policy was applied.\n`), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (opts.forceTier && config.allowForceTier === false) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
SUGGESTION: This branch is unreachable for the typical lint-only run
reviewIncomplete(env)and theunverifiedcount are checked first. In a run with no manifest (degraded === true), any changed model containing Jinja ({{ ref(...) }}) hasengineNewSql === undefinedand is recorded asnot_compiled/head, whichholdsBackApprovaltreats as blocking, so the comment still says "the review did not complete". This new "No lint findings" line is reached only for lint-only runs whose models are Jinja-free (or Python), which is the uncommon case.The added test sets
env.summary.degraded = trueon a hand-built envelope, so it does not exercise this path. ArunReview-level case with a{{ ref() }}model would show the gap; if "No lint findings" is the intended outcome, consider orderingdegradedbeforereviewIncomplete(or composing one message).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.
Agreed it is reached only when nothing held the verdict back. A lint-only run with uncompiled Jinja models says "the review did not complete", which is the accurate line for that run. No change.