feat: added new "enabled" prop for project and patch status#23
feat: added new "enabled" prop for project and patch status#23MathurAditya724 merged 1 commit intomainfrom
Conversation
Codecov Results 📊✅ 172 passed | Total: 172 | Pass Rate: 100% | Execution Time: 264ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 742 uncovered lines. Files with missing lines (20)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 55.76% 55.70% -0.06%
==========================================
Files 24 24 —
Lines 1668 1670 +2
Branches 1158 1166 +8
==========================================
+ Hits 928 928 —
- Misses 740 742 +2
- Partials 94 94 —Generated by Codecov Action |
| if (coverageConfig.status?.project.enabled !== false) { | ||
| await statusReporter.reportStatus( | ||
| "codecov/project", | ||
| projectStatus.status, | ||
| projectStatus.description, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Bug: The failure logic for project and patch status checks runs even when enabled: false, causing the build to fail if failOnError: true.
Severity: MEDIUM
Suggested Fix
Wrap the failure logic for both project and patch status checks inside the same conditional that checks the enabled flag, ensuring that if a check is disabled, it can neither report a status nor trigger a build failure.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/index.ts#L287-L293
Potential issue: The `enabled: false` setting for project and patch status checks only
prevents the status from being reported. It does not prevent the subsequent failure
logic from executing. If a disabled check's status is `"failure"` and `failOnError` is
`true`, the `coverageChecksFailed` flag is still set to `true`. This causes the build to
fail, which is contrary to the expectation that disabling a check would prevent it from
causing a build failure. The issue is present in the `if (projectStatus.status ===
'failure')` and `if (patchStatus.status === 'failure')` blocks, which are not guarded by
the `enabled` flag.
Did we get this right? 👍 / 👎 to inform future reviews.
No description provided.