fix(codex): track plugin lockfile for ci

This commit is contained in:
YeonGyu-Kim
2026-05-31 01:43:45 +09:00
parent 9fa62932e4
commit f1fb0f3ac0
3 changed files with 1768 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@ npm-debug.log*
# Lock files (use bun.lockb instead) # Lock files (use bun.lockb instead)
package-lock.json package-lock.json
!packages/omo-codex/plugin/package-lock.json
yarn.lock yarn.lock
# Environment # Environment
File diff suppressed because it is too large Load Diff
+17
View File
@@ -2,6 +2,7 @@
import { describe, expect, test } from "bun:test" import { describe, expect, test } from "bun:test"
import { readFileSync, readdirSync } from "node:fs" import { readFileSync, readdirSync } from "node:fs"
import { execFileSync } from "node:child_process"
const ciWorkflowPath = new URL("../.github/workflows/ci.yml", import.meta.url) const ciWorkflowPath = new URL("../.github/workflows/ci.yml", import.meta.url)
const publishWorkflowPath = new URL("../.github/workflows/publish.yml", import.meta.url) const publishWorkflowPath = new URL("../.github/workflows/publish.yml", import.meta.url)
@@ -89,6 +90,22 @@ describe("test workflows", () => {
expect(codexTestScriptBuildsMcpRuntimes, "test:codex must install nested Codex plugin deps and build bundled runtimes before installer tests copy them").toBe(true) expect(codexTestScriptBuildsMcpRuntimes, "test:codex must install nested Codex plugin deps and build bundled runtimes before installer tests copy them").toBe(true)
}) })
test("tracks the nested Codex plugin lockfile used by npm ci", () => {
// #given
const gitignore = readFileSync(new URL("../.gitignore", import.meta.url), "utf8")
// #when
const lockfileIsUnignored = gitignore.includes("!packages/omo-codex/plugin/package-lock.json")
const trackedLockfile = execFileSync("git", ["ls-files", "packages/omo-codex/plugin/package-lock.json"], {
cwd: new URL("..", import.meta.url),
encoding: "utf8",
}).trim()
// #then
expect(lockfileIsUnignored, "the aggregate Codex plugin lockfile must escape the root package-lock ignore").toBe(true)
expect(trackedLockfile, "npm ci in CI requires the nested Codex plugin package-lock.json to be tracked").toBe("packages/omo-codex/plugin/package-lock.json")
})
test("pins every workflow Bun setup to the tested runtime", () => { test("pins every workflow Bun setup to the tested runtime", () => {
for (const workflowPath of workflowPaths) { for (const workflowPath of workflowPaths) {
// #given // #given