Repository navigation
fix(tests): forward-port dependency version guards to v1.8 - #1209
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 56 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 |
|
@coderabbitai review Please review exact head 2310c6d. This makes dependency regression tests accept exact stable patch upgrades while preserving the YAML security floor, nested lockfile consistency, analytics privacy assertions and removed Vercel dependency check. Focus on malformed, missing, prerelease or stale versions bypassing those guards. Runtime behavior is unchanged; full local gate passed. Threat model: ordinary dependency updates and lockfile drift, not a hostile maintainer deliberately rewriting tests. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
target='2310c6dfd2a9fdc8d82d188924491dd736a47df0'
git status --short
git rev-parse "${target}^{commit}"
git show --no-ext-diff --format=fuller --no-renames --stat "$target"
printf '\n--- changed paths ---\n'
git diff-tree --no-commit-id --name-status -r "$target"
printf '\n--- patch ---\n'
git diff --no-ext-diff --no-renames "${target}^" "$target" -- . ':!package-lock.json' ':!pnpm-lock.yaml' ':!yarn.lock' || true
printf '\n--- outlines for changed TypeScript/JavaScript files ---\n'
git diff-tree --no-commit-id --name-only -r "$target" | while IFS= read -r f; do
case "$f" in
*.ts|*.tsx|*.js|*.mjs|*.cjs)
echo "### $f"
ast-grep outline "$f" --items all || true
;;
esac
doneLength of output: 1839 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='CodesWhat/drydock'
pr='1209'
target='2310c6dfd2a9fdc8d82d188924491dd736a47df0'
printf '%s\n' '--- pull request metadata ---'
gh pr view "$pr" --repo "$repo" --json number,url,baseRefName,baseRefOid,headRefName,headRefOid,commits,files \
--jq '{number,url,baseRefName,baseRefOid,headRefName,headRefOid,commits:[.commits[]|{oid,messageHeadline}],files:[.files[]|{path,additions,deletions}]}'
base=$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)
printf '%s\n' '--- complete pull request diff ---'
git diff --no-ext-diff --no-renames --find-renames=0 "$base" "$target" -- .
printf '%s\n' '--- changed paths in complete range ---'
git diff --name-status --no-renames "$base" "$target"
printf '%s\n' '--- candidate dependency-test paths ---'
git diff --name-only --no-renames "$base" "$target" | while IFS= read -r f; do
case "$f" in
*.ts|*.tsx|*.js|*.mjs|*.cjs|*.json|*.yaml|*.yml)
echo "### $f"
case "$f" in
*.ts|*.tsx|*.js|*.mjs|*.cjs) ast-grep outline "$f" --items all || true ;;
esac
nl -ba "$f" | sed -n '1,320p'
;;
esac
done
printf '%s\n' '--- version and YAML guard references ---'
rg -n -C 4 --glob '*.{ts,tsx,js,mjs,cjs,json,yaml,yml}' \
'(yaml|YAML|package-lock|pnpm-lock|yarn\.lock|vercel|telemetry|analytics|semver|version)' . \
-g '!node_modules/**' -g '!dist/**' -g '!build/**' | head -n 1200Length of output: 115027 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='9a7debf874b701883ff8ee6f3e4622005d57562a'
guard='c478ea8451a5be13cc809339e24a7da9d9c5aeca'
target='2310c6dfd2a9fdc8d82d188924491dd736a47df0'
printf '%s\n' '--- guard-only commit ---'
git diff --no-ext-diff --no-renames "${guard}^" "$guard" -- \
apps/web/scripts/analytics-integration.test.mjs \
ui/tests/security/yaml-lockfile.spec.ts
printf '%s\n' '--- current manifest and lockfile dependency values ---'
jq -r '.dependencies["posthog-js"], .overrides.yaml' apps/web/package.json
jq -r '.packages[""].dependencies["posthog-js"], .packages["node_modules/posthog-js"].version' apps/web/package-lock.json
jq -r '.overrides.yaml' ui/package.json
jq -r '.packages | to_entries[] | select(.key == "node_modules/yaml" or endswith("/node_modules/yaml")) | [.key, (.value.version // "<missing>")] | `@tsv`' ui/package-lock.json
printf '%s\n' '--- all committed YAML overrides and lockfile installs ---'
while IFS= read -r manifest; do
dir=$(dirname "$manifest")
lockfile="$dir/package-lock.json"
printf '### %s\n' "$dir"
jq -r '.overrides.yaml // "<no override>"' "$manifest"
if [ -f "$lockfile" ]; then
jq -r '.packages | to_entries[] | select(.key == "node_modules/yaml" or endswith("/node_modules/yaml")) | [.key, (.value.version // "<missing>")] | `@tsv`' "$lockfile"
fi
done < <(fd --type f --glob package.json . | sort)
printf '%s\n' '--- modified guard line locations ---'
nl -ba apps/web/scripts/analytics-integration.test.mjs | sed -n '20,115p'
nl -ba ui/tests/security/yaml-lockfile.spec.ts | sed -n '20,108p'Length of output: 10476 🏁 Script executed: #!/bin/bash
set -euo pipefail
target='2310c6dfd2a9fdc8d82d188924491dd736a47df0'
printf '%s\n' '--- package manifests and lockfiles tracked at target ---'
git ls-tree -r --name-only "$target" | rg '(^|/)(package\.json|package-lock\.json)$' | sort
printf '%s\n' '--- apps/web package metadata and script discovery ---'
git show "${target}:apps/web/package.json"
printf '\n--- scripts test configuration references ---\n'
rg -n -C 3 --glob 'package.json' --glob '*.{mjs,cjs,js,json}' \
'test:scripts|analytics-integration\.test|--test|node:test' \
apps/web package.json .github lefthook.yml 2>/dev/null || true
printf '%s\n' '--- target path existence and source inputs ---'
for f in apps/web/package.json apps/web/package-lock.json package-lock.json ui/package.json ui/package-lock.json; do
if git cat-file -e "${target}:${f}" 2>/dev/null; then
printf 'present: %s\n' "$f"
if [[ "$f" == *package-lock.json ]]; then
git show "${target}:${f}" | jq -r '.lockfileVersion, .packages[""]?.dependencies?."posthog-js", .packages["node_modules/posthog-js"]?.version' 2>/dev/null || true
fi
else
printf 'absent: %s\n' "$f"
fi
done
printf '%s\n' '--- analytics test exact source input resolution ---'
git show "${target}:apps/web/scripts/analytics-integration.test.mjs" | nl -ba | sed -n '1,115p'
printf '%s\n' '--- effective path type in working tree ---'
for f in apps/web/package-lock.json package-lock.json; do
ls -ld "$f" 2>&1 || true
doneLength of output: 20136
P1 — Reject stale stable PostHog pins.
Add a minimum stable version check after the syntax check. Keep the manifest, lockfile-root, and installed-package equality checks. const MIN_POSTHOG_VERSION = [1, 427, 2];
function assertPostHogMinimumVersion(pin) {
const parts = pin.split(".").map(Number);
for (let index = 0; index < MIN_POSTHOG_VERSION.length; index += 1) {
if (parts[index] !== MIN_POSTHOG_VERSION[index]) {
assert.ok(parts[index] > MIN_POSTHOG_VERSION[index]);
return;
}
}
}Call
|
|
The downgrade finding is valid. Five fixtures using matching manifest/root/install versions below 1.427.2 failed with the old guard. The fix now enforces that minimum while keeping exact stable syntax, all equality checks, and the privacy assertions. All 159 website script tests pass, including patch/minor/major upgrades. I am applying the same correction to #1208 before requesting fix verification. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@coderabbitai Please verify the downgrade fix at exact head d5ba5b6, review pass two. Five matching manifest/root/install downgrade fixtures failed before the fix, and now 159 website scripts pass. The minimum is 1.427.2, with patch/minor/major upgrades accepted and exact stable syntax, lockfile equality and privacy assertions preserved. The full local gate passed in 347.17 seconds. The normal base reconciliation has no byte delta from fix commit 4121ca7. Please check this correction within the original dependency-guard scope. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
target='d5ba5b63e4d80bbdeba2787877e1fe92e3a2083e'
repo='CodesWhat/drydock'
pr='1209'
git rev-parse "${target}^{commit}"
printf '%s\n' '--- target metadata ---'
git show --no-ext-diff --format=fuller --no-renames --stat "$target"
printf '%s\n' '--- target diff ---'
git diff --no-ext-diff --no-renames "${target}^" "$target" -- .
printf '%s\n' '--- PR refs and commit membership ---'
gh pr view "$pr" --repo "$repo" --json baseRefOid,headRefOid,commits \
--jq '{baseRefOid,headRefOid,commits:[.commits[]|{oid,messageHeadline}]}'
printf '%s\n' '--- changed JavaScript outlines ---'
git diff-tree --no-commit-id --name-only -r "$target" | while IFS= read -r file; do
case "$file" in
*.js|*.mjs|*.cjs)
printf '### %s\n' "$file"
ast-grep outline "$file" --items all
;;
esac
done
printf '%s\n' '--- analytics dependency guard source ---'
nl -ba apps/web/scripts/analytics-integration.test.mjs | sed -n '1,260p'
printf '%s\n' '--- YAML lockfile guard source ---'
nl -ba ui/tests/security/yaml-lockfile.spec.ts | sed -n '1,230p'
printf '%s\n' '--- PostHog fixture and assertion references ---'
rg -n -C 5 --glob '*.{js,mjs,cjs,ts,tsx,json}' \
'(assertAnalyticsDependencies|POSTHOG|posthog-js|1\.427\.2|1\.427\.1|0\.0\.0|prerelease|stable)' \
apps/web ui -g '!node_modules/**' -g '!dist/**' -g '!build/**'
printf '%s\n' '--- manifest and lockfile PostHog entries ---'
jq -r '.dependencies["posthog-js"]' apps/web/package.json
jq -r '.packages[""].dependencies["posthog-js"], .packages["node_modules/posthog-js"].version' apps/web/package-lock.json
printf '%s\n' '--- nested YAML installs and override ---'
jq -r '.overrides.yaml' ui/package.json
jq -r '.packages | to_entries[] | select(.key == "node_modules/yaml" or endswith("/node_modules/yaml")) | [.key, (.value.version // "<missing>")] | `@tsv`' ui/package-lock.jsonLength of output: 147592 🏁 Script executed: #!/bin/bash
set -euo pipefail
target='d5ba5b63e4d80bbdeba2787877e1fe92e3a2083e'
fix='4121ca72ecb5180b5c0f2a52b9bc4862b7719fc8'
base='a3d1eedc1688444fe9e788274a24748bb00663cd'
printf '%s\n' '--- exact-head versus correction-commit diff ---'
git diff --no-ext-diff --no-renames "$fix" "$target" -- \
apps/web/scripts/analytics-integration.test.mjs \
ui/tests/security/yaml-lockfile.spec.ts \
apps/web/package.json \
package-lock.json
printf '%s\n' '--- complete PR dependency-guard diff ---'
git diff --no-ext-diff --no-renames "$base" "$target" -- \
apps/web/scripts/analytics-integration.test.mjs \
ui/tests/security/yaml-lockfile.spec.ts \
apps/web/package.json \
ui/package.json \
package-lock.json \
ui/package-lock.json
printf '%s\n' '--- tracked dependency manifests and lockfiles at exact head ---'
git ls-tree -r --name-only "$target" | rg '(^|/)(package\.json|package-lock\.json)$' | sort
printf '%s\n' '--- candidate lockfile PostHog root and install entries at exact head ---'
while IFS= read -r lockfile; do
printf '### %s\n' "$lockfile"
git show "${target}:${lockfile}" | jq -r '
[
.packages[""].dependencies["posthog-js"] // "<no-root-posthog>",
.packages["node_modules/posthog-js"].version // "<no-install-posthog>"
] | `@tsv`
' 2>/dev/null || true
done < <(git ls-tree -r --name-only "$target" | rg '(^|/)package-lock\.json$' | sort)
printf '%s\n' '--- correction commit parent diff ---'
git diff --no-ext-diff --no-renames "${fix}^" "$fix" -- apps/web/scripts/analytics-integration.test.mjs
printf '%s\n' '--- direct guard checks expressed as static fixture evaluation ---'
python3 - <<'PY'
import re
stable = re.compile(r'^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$')
minimum = (1, 427, 2)
accepted = ["1.427.2", "1.427.3", "1.428.0", "1.430.2", "2.0.0"]
rejected = ["0.0.0", "0.999.999", "1.426.999", "1.427.0", "1.427.1",
"^1.427.2", "1.427.2-beta.1", "1.427.2+build", "1.427.2\n"]
for value in accepted + rejected:
parsed = stable.fullmatch(value)
result = bool(parsed) and tuple(map(int, value.split("."))) >= minimum
print(f"{value!r}\t{result}")
PYLength of output: 11993 🏁 Script executed: #!/bin/bash
set -euo pipefail
target='d5ba5b63e4d80bbdeba2787877e1fe92e3a2083e'
fix='4121ca72ecb5180b5c0f2a52b9bc4862b7719fc8'
printf '%s\n' '--- guard blob identities ---'
for file in apps/web/scripts/analytics-integration.test.mjs ui/tests/security/yaml-lockfile.spec.ts; do
printf '%s\t%s\t%s\n' \
"$file" \
"$(git rev-parse "${fix}:${file}")" \
"$(git rev-parse "${target}:${file}")"
done
printf '%s\n' '--- exact-head PostHog dependency data ---'
git show "${target}:apps/web/package.json" | jq -r '.dependencies["posthog-js"]'
git show "${target}:apps/web/package-lock.json" | jq -r \
'[.packages[""].dependencies["posthog-js"], .packages["node_modules/posthog-js"].version] | `@tsv`'
printf '%s\n' '--- exact-head YAML dependency data ---'
git show "${target}:ui/package.json" | jq -r '.overrides.yaml'
git show "${target}:ui/package-lock.json" | jq -r \
'.packages | to_entries[] | select(.key == "node_modules/yaml" or endswith("/node_modules/yaml")) | [.key, .value.version] | `@tsv`'
printf '%s\n' '--- static PostHog guard matrix ---'
python3 - <<'PY'
import re
pattern = re.compile(r'^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$')
minimum = (1, 427, 2)
cases = {
"accepted": ["1.427.2", "1.427.3", "1.428.0", "1.430.2", "2.0.0"],
"rejected": ["0.0.0", "0.999.999", "1.426.999", "1.427.0", "1.427.1",
"^1.427.2", "~1.427.2", ">=1.427.2", "1.427.2-beta.1",
"1.427.2+build", "1.427.2\n"],
}
for expectation, values in cases.items():
for value in values:
matched = pattern.fullmatch(value)
accepted = bool(matched) and tuple(map(int, value.split("."))) >= minimum
print(f"{expectation}\t{value!r}\t{'accept' if accepted else 'reject'}")
PYLength of output: 2504 🏁 Script executed: #!/bin/bash
set -euo pipefail
target='d5ba5b63e4d80bbdeba2787877e1fe92e3a2083e'
printf '%s\n' '--- exact-head YAML installs ---'
git show "${target}:ui/package-lock.json" | jq -r '
.packages
| to_entries[]
| select((.key | type) == "string")
| select(.key == "node_modules/yaml" or (.key | endswith("/node_modules/yaml")))
| [.key, (.value.version // "<missing>")]
| `@tsv`
'
printf '%s\n' '--- static PostHog guard matrix ---'
python3 - <<'PY'
import re
pattern = re.compile(r'^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$')
minimum = (1, 427, 2)
cases = {
"accepted": ["1.427.2", "1.427.3", "1.428.0", "1.430.2", "2.0.0"],
"rejected": ["0.0.0", "0.999.999", "1.426.999", "1.427.0", "1.427.1",
"^1.427.2", "~1.427.2", ">=1.427.2", "1.427.2-beta.1",
"1.427.2+build", "1.427.2\n"],
}
for expected, values in cases.items():
for value in values:
match = pattern.fullmatch(value)
actual = "accepted" if match and tuple(map(int, value.split("."))) >= minimum else "rejected"
if actual != expected:
raise SystemExit(f"unexpected result for {value!r}: expected {expected}, got {actual}")
print(f"{expected}: {value!r}")
PYLength of output: 1788
The exact head retains the manifest, lockfile-root, installed-package, Vercel telemetry removal, and analytics privacy checks. The analytics and YAML guard files are byte-identical to correction commit If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
|
@coderabbitai Third and final pass: please verify the current head against dev/v1.8. The guard source is byte-identical to the d5ba5b6 correction you cleared in pass two. This normal merge only integrates the already-reviewed metrics, docs and reference-ownership fixes; the changelog conflict retained both entries. The PR delta remains three files. Full local gate passed in 343.51 seconds, including unchanged coverage thresholds, both builds, lint/static analysis, workflow tests and 162 website scripts. Check integration within the existing scope, not new guard features. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='CodesWhat/drydock'
pr='1209'
cleared='d5ba5b63e4d80bbdeba2787877e1fe92e3a2083e'
printf '%s\n' '--- pull request metadata ---'
gh pr view "$pr" --repo "$repo" --json number,url,baseRefName,baseRefOid,headRefName,headRefOid,commits,files \
--jq '{number,url,baseRefName,baseRefOid,headRefName,headRefOid,commits:[.commits[]|{oid,messageHeadline}],files:[.files[]|{path,additions,deletions}]}'
head=$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq .headRefOid)
base=$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)
printf '%s\n' "--- refs: base=$base head=$head ---"
git rev-parse "${head}^{commit}"
git rev-parse "${base}^{commit}"
git rev-parse "${cleared}^{commit}"
printf '%s\n' '--- complete PR changed paths and diff ---'
git diff --name-status --no-renames "$base" "$head"
git diff --no-ext-diff --no-renames "$base" "$head" -- .
printf '%s\n' '--- dependency guard blob identities: cleared vs current ---'
for file in apps/web/scripts/analytics-integration.test.mjs ui/tests/security/yaml-lockfile.spec.ts; do
printf '%s\tcleared=%s\tcurrent=%s\n' "$file" \
"$(git rev-parse "${cleared}:${file}")" \
"$(git rev-parse "${head}:${file}")"
done
printf '%s\n' '--- guard sources at current head ---'
nl -ba apps/web/scripts/analytics-integration.test.mjs | sed -n '1,260p'
nl -ba ui/tests/security/yaml-lockfile.spec.ts | sed -n '1,240p'
printf '%s\n' '--- dependency values at current head ---'
git show "${head}:apps/web/package.json" | jq -r '.dependencies["posthog-js"]'
git show "${head}:apps/web/package-lock.json" | jq -r \
'[.packages[""].dependencies["posthog-js"], .packages["node_modules/posthog-js"].version] | `@tsv`'
git show "${head}:ui/package.json" | jq -r '.overrides.yaml'
git show "${head}:ui/package-lock.json" | jq -r '
.packages | to_entries[]
| select(.key == "node_modules/yaml" or (.key | endswith("/node_modules/yaml")))
| [.key, (.value.version // "<missing>")] | `@tsv`'
printf '%s\n' '--- commits after cleared correction that lead to current head ---'
git log --format='%H%x09%s' "${cleared}..${head}" || true
printf '%s\n' '--- integration diff after cleared correction ---'
git diff --no-ext-diff --no-renames "$cleared" "$head" -- .Length of output: 184888
The current head is The PR delta contains three files only:
Both dependency guard files are byte-identical to the cleared correction at The current guards retain:
The current committed values remain consistent:
You are interacting with an AI system. |
Forward-port #1208 to the 1.8 line. Dependency tests now accept newer exact stable pins while retaining the YAML 2.9.0 security floor and strict manifest/lockfile consistency. Every nested YAML install is checked. Ranges, prereleases, missing entries and mismatches fail; analytics privacy tests and the removal of Vercel telemetry packages remain intact.
This branch includes the timezone build repair from #1206. Its guard-only delta against that branch is three files, with no dependency-version or runtime-policy changes.
Verification: 62 focused YAML tests and all 152 website-script tests pass. Full normal pre-push passed in 352.46 seconds with unchanged coverage thresholds, both builds, lint, Knip, Qlty, script tests and workflow security checks. No main, release or production change.