Skip to content

fix(tests): accept safe dependency updates in version guards - #1208

Merged
scttbnsn merged 3 commits into
dev/v1.7from
scttbnsn/fix-v1.7-dependency-guards
Sep 15, 2026
Merged

scttbnsn merged 3 commits into
dev/v1.7from
scttbnsn/fix-v1.7-dependency-guards

Conversation

@scttbnsn

Copy link
Copy Markdown
Contributor

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.

@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Sep 15, 2026 1:47pm UTC
drydockdemo-website Ready Ready Preview Sep 15, 2026 1:47pm UTC

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2d66f31a-3f11-4cdf-b421-e8c70837342a

📥 Commits

Reviewing files that changed from the base of the PR and between 271a12f and 5fe6af2.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • apps/web/scripts/analytics-integration.test.mjs
  • ui/tests/security/yaml-lockfile.spec.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@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.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
🧩 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/**' || true

Length 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.mjs

Length 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")
PY

Length of output: 1968


@scttbnsn No actionable findings for commit 5fe6af2ee613b4cf3f2601cc7e781953531cc705.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@scttbnsn
scttbnsn merged commit a1a71b7 into dev/v1.7 Sep 15, 2026
32 of 33 checks passed
@scttbnsn
scttbnsn deleted the scttbnsn/fix-v1.7-dependency-guards branch September 15, 2026 17:03

This branch was successfully deployed

2 active deployments
Preview – drydock-website — 5fe6af2e Deployed Sep 15, 2026 by vercel[bot]
Preview – drydockdemo-website — 5fe6af2e Deployed Sep 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant