Skip to content
Merged
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
4 changes: 4 additions & 0 deletions review-enrichment/src/analyzers/eol-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export function extractVersionPins(
// `.node-version` (nodenv/asdf) carries the same leading-version pin as `.nvmrc`.
const version = leadingVersion(line);
if (version) pins.push({ file: file.path, product: "nodejs", version });
} else if (base === ".python-version") {
// pyenv/asdf pin file — same leading-version format, product is Python.
const version = leadingVersion(line);
if (version) pins.push({ file: file.path, product: "python", version });
} else if (base === "go.mod") {
const match = /^go\s+(\d+\.\d+)/.exec(line);
if (match)
Expand Down
3 changes: 2 additions & 1 deletion review-enrichment/src/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,12 @@ function isRuntimePinPath(path: string): boolean {
// Share the eol analyzer's own Dockerfile predicate so the gate can't skip a file the analyzer would
// parse. The prior bespoke `/^Dockerfile(?:\..*)?$/` missed `*.dockerfile` (e.g. web.dockerfile), silently
// dropping eol analysis for it even though isDockerfile() handles it.
// `.node-version` is the nodenv/asdf pin file; the eol analyzer parses it like `.nvmrc`.
// `.node-version` / `.python-version` are nodenv/pyenv (and asdf) pin files the eol analyzer parses.
return (
isDockerfile(path) ||
basename === ".nvmrc" ||
basename === ".node-version" ||
basename === ".python-version" ||
basename === "go.mod"
);
}
7 changes: 7 additions & 0 deletions review-enrichment/test/eol-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ test("extractVersionPins reads .node-version pins like .nvmrc", () => {
]);
});

test("extractVersionPins reads .python-version pins as Python", () => {
// pyenv/asdf use `.python-version` with the same leading-version format.
assert.deepEqual(extractVersionPins([added(".python-version", "3.11.0")]), [
{ file: ".python-version", product: "python", version: "3.11.0" },
]);
});

test("extractVersionPins ignores removed/context lines and files with no patch", () => {
const patch = ["@@ -1 +1,2 @@", "-FROM python:3.7", " FROM python:3.9"].join(
"\n",
Expand Down
Loading