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
10 changes: 5 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ jobs:
STABLE_SHAPE=false
if cmp -s "$EXPECTED_PATHS" "$CHANGED"; then
STABLE_SHAPE=true
while IFS='|' read -r TRANSITION PATH; do
while IFS='|' read -r TRANSITION MANIFEST_PATH; do
NAME=${TRANSITION%%=*}; REST=${TRANSITION#*=}; OLD=${REST%%=*}; NEW=${REST##*=}
OLD_NAME=$(git show "$BASE:$PATH" | jq -er .name) || STABLE_SHAPE=false
OLD_VERSION=$(git show "$BASE:$PATH" | jq -er .version) || STABLE_SHAPE=false
NEW_NAME=$(jq -er .name "$PATH") || STABLE_SHAPE=false
NEW_VERSION=$(jq -er .version "$PATH") || STABLE_SHAPE=false
OLD_NAME=$(git show "$BASE:$MANIFEST_PATH" | jq -er .name) || STABLE_SHAPE=false
OLD_VERSION=$(git show "$BASE:$MANIFEST_PATH" | jq -er .version) || STABLE_SHAPE=false
NEW_NAME=$(jq -er .name "$MANIFEST_PATH") || STABLE_SHAPE=false
NEW_VERSION=$(jq -er .version "$MANIFEST_PATH") || STABLE_SHAPE=false
[ "$OLD_NAME" = "$NAME" ] && [ "$NEW_NAME" = "$NAME" ] && [ "$OLD_VERSION" = "$OLD" ] && [ "$NEW_VERSION" = "$NEW" ] || STABLE_SHAPE=false
done < "$STABLE_TRANSITIONS"
if [ "$STABLE_SHAPE" = true ]; then
Expand Down
12 changes: 8 additions & 4 deletions scripts/release-policy-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,13 @@
"@effectify/solid-query=0.5.13-beta.0=0.5.13|packages/solid/query/package.json",
])
if (!active.includes(transition)) violations.push(`beta stable transition ${transition}`)
if (/\bread\s+-r\s+TRANSITION\s+PATH\b/.test(active)) violations.push("beta stable reserved PATH shadowing")
for (const pattern of [
/cmp -s "\$EXPECTED_PATHS" "\$CHANGED"/,
/git show "\$BASE:\$PATH" \| jq -er \.name/,
/git show "\$BASE:\$PATH" \| jq -er \.version/,
/git show "\$BASE:\$MANIFEST_PATH" \| jq -er \.name/,
/git show "\$BASE:\$MANIFEST_PATH" \| jq -er \.version/,
/jq -er \.name "\$MANIFEST_PATH"/,
/jq -er \.version "\$MANIFEST_PATH"/,
/\[ "\$OLD_NAME" = "\$NAME" \] && \[ "\$NEW_NAME" = "\$NAME" \] && \[ "\$OLD_VERSION" = "\$OLD" \] && \[ "\$NEW_VERSION" = "\$NEW" \]/,
])
if (!pattern.test(active)) violations.push(`beta stable structural check ${String(pattern)}`)
Expand Down Expand Up @@ -712,10 +715,10 @@

const releasePolicyBootstrapViolations = (source) => {
const steps = extractSteps(extractJob(source, "release-policy"))
const setupNodeIndex = steps.findIndex((step) => /^actions\/setup-node@/.test(step.uses))

Check warning on line 718 in scripts/release-policy-contract.test.mjs

View workflow job for this annotation

GitHub Actions / 🔍 Lint & Format

unicorn(prefer-string-starts-ends-with)

Prefer String#startsWith over a regex with a caret.
if (setupNodeIndex === -1) return ["release-policy setup-node"]

const pnpmIndex = steps.findIndex((step) => /^pnpm\/action-setup@/.test(step.uses))

Check warning on line 721 in scripts/release-policy-contract.test.mjs

View workflow job for this annotation

GitHub Actions / 🔍 Lint & Format

unicorn(prefer-string-starts-ends-with)

Prefer String#startsWith over a regex with a caret.
const cacheDisabled = steps[setupNodeIndex].packageManagerCache === "false"
return pnpmIndex !== -1 && pnpmIndex < setupNodeIndex ? [] : cacheDisabled ? [] : ["release-policy setup-node cache"]
}
Expand Down Expand Up @@ -1067,8 +1070,9 @@
["add path", "packages/solid/query/package.json | sort", "README.md packages/solid/query/package.json | sort"],
["alter source", "0.1.0-beta.0=0.1.0|packages/hatchet", "0.1.0-beta.1=0.1.0|packages/hatchet"],
["alter target", "1.0.0-beta.1=1.0.0|packages/react/query", "1.0.0-beta.1=1.0.1|packages/react/query"],
["ignore old JSON", 'OLD_VERSION=$(git show "$BASE:$PATH" | jq -er .version)', "OLD_VERSION=$OLD"],
["ignore new JSON", 'NEW_VERSION=$(jq -er .version "$PATH")', "NEW_VERSION=$NEW"],
["ignore old JSON", 'OLD_VERSION=$(git show "$BASE:$MANIFEST_PATH" | jq -er .version)', "OLD_VERSION=$OLD"],
["ignore new JSON", 'NEW_VERSION=$(jq -er .version "$MANIFEST_PATH")', "NEW_VERSION=$NEW"],
["restore reserved PATH loop binding", "read -r TRANSITION MANIFEST_PATH", "read -r TRANSITION PATH"],
[
"message authorizes suppression",
'if cmp -s "$EXPECTED_PATHS" "$CHANGED"; then',
Expand Down
Loading