Skip to content

Commit f336fde

Browse files
committed
fix: change codecov configuration
Signed-off-by: mamoralesiob <miguelangel@io.builders>
1 parent 8cff8d6 commit f336fde

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/100-flow-ats-test.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "packages/ats/**"
99
- "apps/ats/**"
1010
- "package.json"
11+
- "codecov.yml"
1112
- ".github/workflows/*ats*.yaml"
1213
workflow_dispatch:
1314

@@ -17,6 +18,7 @@ defaults:
1718

1819
permissions:
1920
contents: read
21+
statuses: read # gate step reads the codecov/project commit status
2022

2123
jobs:
2224
test-ats:
@@ -99,3 +101,50 @@ jobs:
99101
- name: Upload coverage report
100102
if: ${{ steps.generate_coverage.outcome == 'success' }}
101103
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v5.4.0
104+
105+
# TEMPORARY DIAGNOSTIC (non-blocking).
106+
# The prior enforcement step only read commit *statuses* and never found
107+
# `codecov/project` (state='<none>' for 5 min), producing a false failure.
108+
# Codecov may instead report via the *check-runs* API, post under a
109+
# different SHA, or not post at all. This step dumps BOTH commit statuses
110+
# and check-runs for the PR head SHA each poll so the next run shows
111+
# exactly what Codecov posts and where. It NEVER fails the job — re-enable
112+
# enforcement once we know the reporting mechanism.
113+
- name: Diagnose Codecov status/check-run posting
114+
if: ${{ github.event_name == 'pull_request' && steps.generate_coverage.outcome == 'success' }}
115+
env:
116+
GH_TOKEN: ${{ github.token }}
117+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
118+
REPO: ${{ github.repository }}
119+
run: |
120+
echo "Inspecting Codecov reporting for head SHA ${HEAD_SHA} in ${REPO}"
121+
for attempt in $(seq 1 30); do
122+
echo "----- attempt ${attempt}/30 -----"
123+
124+
echo "[commit statuses]"
125+
gh api "repos/${REPO}/commits/${HEAD_SHA}/statuses" \
126+
--jq '.[] | " status: \(.context) = \(.state)"' \
127+
|| echo " (statuses query failed)"
128+
129+
echo "[check runs]"
130+
gh api "repos/${REPO}/commits/${HEAD_SHA}/check-runs" \
131+
--jq '.check_runs[] | " check : \(.name) = status:\(.status) conclusion:\(.conclusion // "n/a")"' \
132+
|| echo " (check-runs query failed)"
133+
134+
# Stop early once anything Codecov-related has posted in either place.
135+
found=$(
136+
{
137+
gh api "repos/${REPO}/commits/${HEAD_SHA}/statuses" --jq '.[].context' 2>/dev/null
138+
gh api "repos/${REPO}/commits/${HEAD_SHA}/check-runs" --jq '.check_runs[].name' 2>/dev/null
139+
} | grep -i codecov || true
140+
)
141+
if [ -n "${found}" ]; then
142+
echo "✓ Found Codecov entries (note whether they are statuses or checks above):"
143+
echo "${found}" | sed 's/^/ /'
144+
break
145+
fi
146+
147+
echo " no codecov entry yet — waiting 10s"
148+
sleep 10
149+
done
150+
echo "Diagnostic complete (non-blocking; job will not fail here)."

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ coverage:
1010
default:
1111
target: auto
1212
threshold: 0%
13+
if_ci_failed: error
1314
project:
1415
default:
1516
target: auto
1617
threshold: 0%
18+
if_ci_failed: error # don't report success if the test job itself failed
19+
informational: false # blocking status, not advisory (this is the default — explicit here)
1720

1821
ignore:
1922
- "packages/*/dist"

0 commit comments

Comments
 (0)