Repository navigation
fix(tests): accept safe dependency updates in version guards - #1208
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 24 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@coderabbitai review Please review exact head 5fe6af2. This makes dependency guards accept newer exact stable pins while keeping the YAML security floor and nested-install agreement, and PostHog manifest/root/install equality. It includes the minimum PostHog 1.427.2 correction you verified in #1209, with the same guard file bytes. Invalid versions, downgrades, missing entries and Vercel telemetry packages remain rejected; privacy assertions are unchanged. The full local gate passed in 306.42 seconds with 100% app/UI coverage and 150 website scripts. Threat model: ordinary dependency/lockfile drift, not a hostile maintainer rewriting tests. This is the first review request for this PR. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== HEAD =='
git rev-parse HEAD
printf '%s\n' '== status =='
git status --short
printf '%s\n' '== changed files against first parent =='
git diff-tree --no-commit-id --name-status -r HEAD
printf '%s\n' '== diff =='
git diff HEAD^ HEAD -- . ':!package-lock.json' ':!pnpm-lock.yaml' ':!yarn.lock'
printf '%s\n' '== changed test-like files outlines =='
git diff-tree --no-commit-id --name-only -r HEAD | while IFS= read -r file; do
case "$file" in
*.ts|*.tsx|*.js|*.mjs|*.cjs)
printf '\n-- %s --\n' "$file"
ast-grep outline "$file" --items all || true
;;
esac
done
printf '%s\n' '== version guard references =='
rg -n -i -C 3 '(yaml|posthog|vercel).*(version|override|telemetry)|(version|override|telemetry).*(yaml|posthog|vercel)' . \
-g '!node_modules/**' -g '!dist/**' -g '!build/**' || trueLength of output: 201400 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== exact HEAD =='
git rev-parse HEAD
printf '%s\n' '== commit summary =='
git show --no-ext-diff --format=fuller --no-renames --stat --oneline HEAD
printf '%s\n' '== changed paths =='
git diff-tree --no-commit-id --name-status -r --no-renames HEAD
printf '%s\n' '== textual changed paths =='
git diff-tree --no-commit-id --name-only -r --no-renames HEAD | while IFS= read -r file; do
case "$file" in
*.ts|*.tsx|*.js|*.mjs|*.cjs|*.json|*.yaml|*.yml)
printf '%s\n' "$file"
;;
esac
done
printf '%s\n' '== textual diffs =='
git diff --no-ext-diff --no-renames --unified=80 HEAD^ HEAD -- \
'*.ts' '*.tsx' '*.js' '*.mjs' '*.cjs' '*.json' '*.yaml' '*.yml'Length of output: 7564 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="CodesWhat/drydock"
pr="1208"
printf '%s\n' '== PR metadata =='
gh pr view "$pr" --repo "$repo" --json number,baseRefName,baseRefOid,headRefName,headRefOid,commits,files \
--jq '{number,baseRefName,baseRefOid,headRefName,headRefOid, commits: [.commits[] | {oid,messageHeadline}], files: [.files[] | {path,additions,deletions}]}'
base_oid=$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)
printf '%s\n' '== merge base =='
git merge-base "$base_oid" HEAD
printf '%s\n' '== complete PR diff =='
git diff --no-ext-diff --no-renames --unified=100 "$base_oid"...HEAD -- '*.mjs' '*.js' '*.ts' '*.tsx' '*.json' '*.yaml' '*.yml'
printf '%s\n' '== affected guard section =='
sed -n '1,180p' apps/web/scripts/analytics-integration.test.mjs
printf '%s\n' '== dependency values =='
node -e '
const fs=require("fs");
for (const p of ["apps/web/package.json","apps/web/package-lock.json"]) {
const x=JSON.parse(fs.readFileSync(p,"utf8"));
console.log(p, {
posthog: x.dependencies?.["posthog-js"] ?? x.packages?.[""]?.dependencies?.["posthog-js"],
installed: x.packages?.["node_modules/posthog-js"]?.version
});
}'Length of output: 25018 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== package manifests =='
fd --type f --glob 'package.json' . | sort
printf '%s\n' '== npm lockfiles =='
fd --type f --glob 'package-lock.json' . | sort
printf '%s\n' '== PostHog values in lockfiles =='
while IFS= read -r file; do
printf '\n-- %s --\n' "$file"
jq '{root: .packages[""].dependencies["posthog-js"], installed: .packages["node_modules/posthog-js"].version}' "$file"
done < <(fd --type f --glob 'package-lock.json' . | sort)
printf '%s\n' '== relevant source call sites =='
rg -n -C 2 'source\("package-lock\.json"\)|assertAnalyticsDependencies\(' \
apps/web/scripts/analytics-integration.test.mjsLength of output: 1267 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== tracked package lockfiles =='
git ls-tree -r --name-only HEAD | rg '(^|/)package-lock\.json$' || true
printf '%s\n' '== app-level lockfile exists =='
if git cat-file -e HEAD:apps/web/package-lock.json 2>/dev/null; then
echo 'tracked'
else
echo 'not tracked'
fi
if test -e apps/web/package-lock.json; then
echo 'present in worktree'
else
echo 'absent from worktree'
fi
printf '%s\n' '== tracked PostHog lockfile entries =='
git ls-tree -r --name-only HEAD | rg '(^|/)package-lock\.json$' | while IFS= read -r file; do
printf '\n-- %s --\n' "$file"
git show "HEAD:$file" | jq '{root: .packages[""].dependencies["posthog-js"], installed: .packages["node_modules/posthog-js"].version}'
done
printf '%s\n' '== source package lock resolution =='
python - <<'PY'
from pathlib import Path
script = Path("apps/web/scripts/analytics-integration.test.mjs").resolve()
web_root = (script.parent / "..").resolve()
print(web_root)
print(web_root / "package-lock.json")
PYLength of output: 1968
|
Fix version guards that reject valid dependency updates in #1199 and #1200. Require exact stable versions and matching installed lockfile versions instead of freezing the tests to the package version that happened to be current when written.
The YAML security minimum stays at 2.9.0, and every nested YAML install must match the exact override. Missing entries, older versions, ranges, prereleases and mismatches fail. PostHog must match the manifest, lock root and installed package; removed Vercel telemetry packages still fail. Analytics privacy behavior and its tests are unchanged.
Reproduced the failures against both Renovate PR manifests and lockfiles. The focused runs pass 65 UI security tests and 143 website-script tests, including invalid-fixture coverage. The full normal pre-push gate passed in 307.14 seconds with 100% app/UI coverage, both builds, lint, Knip, Qlty and workflow tests. No dependency version or bot history is changed by this PR. Clean Docker builds also need the timezone-pin fix in #1204; that maintenance fix remains separate from this test-only patch.