Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2309b7d
feat(dependency-impact): add structured types for multi-step analysis…
claude Feb 27, 2026
87a838c
feat(dependency-impact): add version classifier and diff line finder
claude Feb 27, 2026
3982c9d
feat(dependency-impact): extract prompt builders for multi-step workflow
claude Feb 27, 2026
6f6573e
feat(dependency-impact): wire multi-step pipeline and inline review c…
claude Feb 27, 2026
e35aaa4
refactor(dependency-impact): extract review rendering into testable m…
claude Feb 27, 2026
6dd6420
test(dependency-impact): add tests for prompt builders and review ren…
claude Feb 27, 2026
9872bba
chore(dependency-impact): add missing dist declaration files
claude Feb 27, 2026
7bf6709
fix(dependency-impact): extract per-dep sections from Dependabot PR body
claude Feb 27, 2026
df383c2
fix(dependency-impact): exact boundary matching and no-newline marker…
dortort Feb 27, 2026
791677d
fix(dependency-impact): restrict inline comment placement to manifest…
dortort Feb 27, 2026
6a7d79b
fix(dependency-impact): avoid duplicating PR body for every dep in fa…
dortort Feb 27, 2026
6d71659
fix(dependency-impact): guard against schema conformance failures in …
dortort Feb 27, 2026
ab19fd1
fix(dependency-impact): guard against partial step-1 results in build…
dortort Feb 27, 2026
16d48a1
fix(dependency-impact): exact boundary matching in extractDependabotS…
dortort Feb 27, 2026
bc92c22
fix(dependency-impact): restore PR body fallback for all deps to prev…
dortort Feb 27, 2026
ce8e46c
build(dependency-impact): rebuild dist bundle
dortort Feb 27, 2026
e50aabc
fix(dependency-impact): use composite name::ecosystem key for release…
dortort Feb 28, 2026
b210775
fix(dependency-impact): normalize LLM risk values before riskLabel lo…
dortort Feb 28, 2026
366c353
build(dependency-impact): rebuild dist with composite key and risk no…
dortort Feb 28, 2026
e9a6cb4
fix(dependency-impact): deduplicate dep changes by name::ecosystem to…
dortort Feb 28, 2026
046c285
build(dependency-impact): rebuild dist with deduplication fix
dortort Feb 28, 2026
f313b0c
fix(dependency-impact): classify 0.x minor bumps as major in classify…
dortort Feb 28, 2026
2d68bb7
fix(dependency-impact): preserve step-2 safe default when parsed resu…
dortort Feb 28, 2026
b1cfe5b
build(dependency-impact): rebuild dist with 0.x classification and st…
dortort Feb 28, 2026
266ebc1
fix(dependency-impact): deduplicate by full version range in monorepo…
dortort Mar 1, 2026
95b94f2
fix(dependency-impact): fall back to postComment when createReview fails
dortort Mar 1, 2026
f48bd03
build(dependency-impact): rebuild dist
dortort Mar 1, 2026
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
641 changes: 566 additions & 75 deletions dependency-impact/dist/index.js

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions dependency-impact/dist/parsers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,26 @@ export declare function parseDependencyChanges(diff: string, files: {
filename: string;
patch?: string;
}[]): DependencyChange[];
import { UpgradeType } from "./types";
/**
* Classify a version change as major, minor, patch, or unknown.
*/
export declare function classifyUpgrade(from: string, to: string): UpgradeType;
/**
* Find the line number in the new file where a dependency's version appears as
* an added line in a diff patch. Returns null if not found.
*/
export declare function findDepLineInPatch(patch: string, depName: string): number | null;
export declare function getImportPatterns(depName: string, ecosystem: string): string[];
/**
* Extract the section of a Dependabot PR body relevant to a specific dependency.
*
* Dependabot group PRs embed per-dependency release notes inside `<details>`
* blocks whose content mentions the package name. This function returns only
* the matching block(s) instead of the full body, avoiding token duplication
* when the body is attached to every dependency.
*
* Falls back to the full body when no per-dep section can be isolated (e.g.
* single-dependency Dependabot PRs where the whole body is relevant).
*/
export declare function extractDependabotSection(body: string, depName: string): string;
9 changes: 9 additions & 0 deletions dependency-impact/dist/prompts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { EnrichedDependencyChange, Step1Result, Step2Result } from "./types";
export declare function buildStep1Prompt(enrichedDeps: EnrichedDependencyChange[]): string;
export declare function buildStep2Prompt(step1Result: Step1Result, usageSections: string): string;
export declare function buildStep3Prompt(enrichedDeps: EnrichedDependencyChange[], step1Result: Step1Result, step2Result: Step2Result): string;
export declare function buildStep3NoUsagePrompt(enrichedDeps: EnrichedDependencyChange[], step1Result: Step1Result): string;
/**
* Legacy single-prompt fallback, used when structured pipeline JSON parsing fails.
*/
export declare function buildLegacyPrompt(depChangesList: string, prBodySection: string, hasUsage: boolean, usageSections: string, prDiff: string): string;
1 change: 1 addition & 0 deletions dependency-impact/dist/prompts.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
10 changes: 10 additions & 0 deletions dependency-impact/dist/review.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { ReviewComment, PullRequestFile } from "@gemini-actions/shared";
import type { DependencyAssessment, EnrichedDependencyChange } from "./types";
/**
* Build the review body with a summary table and narrative.
*/
export declare function buildReviewBody(assessment: DependencyAssessment): string;
/**
* Build inline review comments for dependency version-change lines in manifest files.
*/
export declare function buildInlineComments(assessment: DependencyAssessment, enrichedDeps: EnrichedDependencyChange[], prFiles: PullRequestFile[]): ReviewComment[];
1 change: 1 addition & 0 deletions dependency-impact/dist/review.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
62 changes: 62 additions & 0 deletions dependency-impact/dist/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { DependencyChange } from "./parsers";
/** Semver upgrade classification */
export type UpgradeType = "major" | "minor" | "patch" | "unknown";
/** Risk level for impact assessment */
export type RiskLevel = "low" | "medium" | "high" | "critical";
/** A dependency change enriched with upgrade classification and release notes */
export interface EnrichedDependencyChange extends DependencyChange {
upgradeType: UpgradeType;
releaseNotes: string | null;
}
/** Output of Step 1: breaking change extraction per dependency */
export interface BreakingChangeEntry {
dependency: string;
upgradeType: UpgradeType;
breakingChanges: string[];
deprecations: string[];
notableChanges: string[];
hasConfirmedBreakingChanges: boolean;
}
export interface Step1Result {
dependencies: BreakingChangeEntry[];
}
/** Output of Step 2: cross-reference of breaking changes with codebase usage */
export interface UsageImpact {
dependency: string;
change: string;
affectedFiles: string[];
affectedCode: string[];
requiredAction: string;
severity: RiskLevel;
}
export interface Step2Result {
impacts: UsageImpact[];
unaffectedUsages: Array<{
dependency: string;
fileCount: number;
}>;
}
/** Output of Step 3: final synthesized assessment */
export interface DependencyAssessment {
overallRisk: RiskLevel;
riskJustification: string;
dependencySummaries: Array<{
dependency: string;
fromVersion: string;
toVersion: string;
upgradeType: UpgradeType;
risk: RiskLevel;
oneLiner: string;
}>;
actionItems: Array<{
severity: RiskLevel;
dependency: string;
file: string;
description: string;
}>;
inlineAnnotations: Array<{
dependency: string;
annotation: string;
}>;
narrativeSummary: string;
}
Loading