Repository navigation
feat(review): --all-projects reviews every dbt project a PR touches in one run
#1773
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
base: feat/review-ai-focused-batches
Are you sure you want to change the base?
Changes from all commits
284541e
04b5104
676c803
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -72,6 +72,8 @@ export function renderSummary(env: VerdictEnvelope, opts: RenderOptions = {}): s | |||||
| return "" | ||||||
|
|
||||||
| const lines: string[] = [REVIEW_MARKER, "", `## ${verdictHeadline(env)}`, ""] | ||||||
| const projects = env.scope?.projects ?? [] | ||||||
| if (projects.length > 1) lines.push(`Reviewed ${projects.length} dbt projects: ${projects.map((p) => p.root || ".").join(", ")}`, "") | ||||||
|
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: Project roots are repository-controlled strings, but this line inserts them raw into Markdown. A project directory containing a backtick or newline can break the summary's formatting or inject content; render each root with Prompt for AI agents
Suggested change
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. Follow-up: low priority, tracked ( 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. SUGGESTION: The project list is unbounded, unlike the other multi-entry renders ( On a monorepo with many (or long-named) projects this single fixed line can consume most of
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 r4626966319; tracked. |
||||||
|
|
||||||
| if (env.summary.degraded) { | ||||||
| lines.push( | ||||||
|
|
||||||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { cmd } from "./cmd" | |
| import { bootstrap } from "../bootstrap" | ||
| import { Installation } from "../../installation" | ||
| import { prContextFromEnv, reviewPullRequest } from "../../altimate/review/run" | ||
| import { reviewAllProjects } from "../../altimate/review/multi-project" | ||
| import { renderSummary } from "../../altimate/review/format" | ||
| import { postGitHubReview, resolveGitHubTarget } from "../../altimate/review/post-github" | ||
| // altimate_change — review feature telemetry | ||
|
|
@@ -70,6 +71,13 @@ export const ReviewCommand = cmd({ | |
| type: "string", | ||
| describe: "provider/model for the advisory AI lane (default: the configured default model)", | ||
| }) | ||
| .option("all-projects", { | ||
| type: "boolean", | ||
| default: false, | ||
| describe: | ||
| "review every dbt project the PR changes (mono-repo) and emit one merged verdict / one comment; " + | ||
| "--manifest then applies only to the project that contains it", | ||
| }) | ||
| .option("cwd", { type: "string", describe: "project directory (default: current dir)" }), | ||
| async handler(args) { | ||
| const cwd = (args.cwd as string) || process.cwd() | ||
|
|
@@ -100,7 +108,8 @@ export const ReviewCommand = cmd({ | |
| const prContext = await prContextFromEnv() | ||
| let env | ||
| try { | ||
| env = await reviewPullRequest({ | ||
| const review = args.allProjects === true ? reviewAllProjects : reviewPullRequest | ||
|
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: 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. Follow-up: low priority, tracked. Discovering roots at the merge-base as well would cover it. |
||
| env = await review({ | ||
| ...prContext, | ||
| aiModel: args.aiModel as string | undefined, | ||
| cwd, | ||
|
|
||
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: The project list is unbounded even though this renderer promises a character budget for the posted comment. With enough touched projects, this line alone can exceed 5,000 characters and the later finding-budget loop cannot trim it; cap the displayed roots and retain the full list in
scope.projects.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.
Follow-up: low priority, tracked. We'll cap it at
RENDER_CAPwith "+N more".