Fix Cause.Fail JSON error key#6469
Conversation
🦋 Changeset detectedLatest commit: a582988 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesCause.Fail JSON alignment
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
@coderabbitai investigate the CI failures |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="Effect-TS/effect"
pr="6469"
echo "=== Pull request and check rollup ==="
gh pr view "$pr" --repo "$repo" \
--json url,headRefName,headRefOid,statusCheckRollup \
--jq '{url, headRefName, headRefOid, checks: [.statusCheckRollup[] | {name, status, conclusion, detailsUrl, workflowName: .workflowName}]}'
echo
echo "=== Workflow runs for this PR ==="
gh run list --repo "$repo" --pr "$pr" --limit 100 \
--json databaseId,name,status,conclusion,event,headSha,url,createdAt,updatedAt \
--jq '.[] | select(.conclusion == "failure" or .status != "completed")'
echo
echo "=== Failed job details and available log excerpts ==="
while IFS= read -r run_id; do
[ -z "$run_id" ] && continue
echo "--- Run $run_id ---"
gh run view "$run_id" --repo "$repo" \
--json url,name,status,conclusion,jobs \
--jq '{url,name,status,conclusion,jobs: [.jobs[] | select(.conclusion == "failure") | {name,conclusion,startedAt,completedAt,steps: [.steps[] | select(.conclusion == "failure") | {name,number,conclusion}]}]}'
echo "--- Failed-step log output for run $run_id ---"
gh run view "$run_id" --repo "$repo" --log-failed 2>&1 || true
done < <(gh run list --repo "$repo" --pr "$pr" --limit 100 --json databaseId,conclusion --jq '.[] | select(.conclusion == "failure") | .databaseId')Length of output: 4680 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="Effect-TS/effect"
run_id="29595130308"
job_id="88064176955"
echo "=== Workflow run metadata ==="
gh api "repos/$repo/actions/runs/$run_id" \
--jq '{html_url, head_sha, head_branch, event, status, conclusion, created_at, updated_at}'
echo
echo "=== Failed job metadata ==="
gh api "repos/$repo/actions/jobs/$job_id" \
--jq '{html_url, name, status, conclusion, started_at, completed_at, steps: [.steps[] | {number, name, status, conclusion}]}'
echo
echo "=== Failed-step logs ==="
gh run view "$run_id" --repo "$repo" --log-failed 2>&1 || true
echo
echo "=== Context around failure markers in complete job log ==="
tmp_log="$(mktemp)"
trap 'rm -f "$tmp_log"' EXIT
gh api "repos/$repo/actions/jobs/$job_id/logs" > "$tmp_log"
rg -n -i -C 12 \
'(fail(?:ed|ure)?|error|assert(?:ion)?|expected|received|exit code|test summary)' \
"$tmp_log" || trueLength of output: 123956
The two failing assertions are:
Update both expected serialized |
|
@coderabbitai fix the tests |
|
@coderabbitai create a commit fixing the test issues |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Exit test structure ==="
ast-grep outline packages/effect/test/Exit.test.ts --items all
echo
echo "=== Cause.Fail serialization expectations in Exit tests ==="
rg -n -C 8 'failure|error|toJSON|toString' packages/effect/test/Exit.test.ts
echo
echo "=== Available test scripts ==="
if [ -f package.json ]; then
jq '{scripts}' package.json
fi
if [ -f packages/effect/package.json ]; then
jq '{scripts}' packages/effect/package.json
fiLength of output: 4397
|
|
❌ Failed to create commit: AGENT_CHAT: Failed to create commit |
1 similar comment
|
❌ Failed to create commit: AGENT_CHAT: Failed to create commit |
Type
Description
Cause.Failexposes its recoverable error through theerrorproperty, but itstoJSONand Node inspection output serialized the same value underfailure. This aligns the serialized key with the public property and updates the direct and nested regression expectations.The change includes a patch changeset and was validated with:
pnpm test packages/effect/test/Cause.test.tspnpm lint-fixpnpm checkpnpm buildpnpm docgenImplementation prepared with OpenAI Codex. No human code review has been performed.
Related
Summary by CodeRabbit
Bug Fixes
Cause.FailJSON serialization to use theerrorfield, aligning it with the corresponding error property.Documentation