feat(ts): add coverage_threshold input for quality gate#68
Merged
emmanuelm41 merged 1 commit intomainfrom Dec 26, 2025
Merged
Conversation
e6e6744 to
0df68d3
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds quality gate functionality to the TypeScript checks workflow by introducing configurable coverage thresholds for four metrics (lines, statements, functions, branches). The implementation parses the coverage-summary.json file generated by the test coverage command and fails the workflow if any enabled threshold is not met.
Key Changes:
- Added four input parameters for coverage thresholds (lines, statements, functions, branches), all defaulting to 0 for backwards compatibility
- Implemented a new quality gate step that validates coverage metrics against configured thresholds using bash and jq
- Positioned the quality gate after the Vitest Coverage Report step to ensure coverage data is available
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
Suggested threshold values for kunobi-frontendBased on current coverage:
ts-checks-linux:
uses: zondax/_workflows/.github/workflows/_checks-ts.yaml@v5
with:
enable_coverage: true
coverage_threshold_lines: 36
coverage_threshold_statements: 35
coverage_threshold_functions: 32
coverage_threshold_branches: 31 |
Add coverage enforcement to TypeScript checks workflow with separate thresholds: - `coverage_threshold_lines` - Minimum line coverage % - `coverage_threshold_statements` - Minimum statement coverage % - `coverage_threshold_functions` - Minimum function coverage % - `coverage_threshold_branches` - Minimum branch coverage % All default to 0 (disabled). Quality gate reads coverage/coverage-summary.json and fails CI if any enabled threshold is not met.
0df68d3 to
b3dddea
Compare
Member
Author
|
Addressed all Copilot review comments:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_checks-ts.yamlworkflow for all four metrics:coverage_threshold_linescoverage_threshold_statementscoverage_threshold_functionscoverage_threshold_branchescoverage/coverage-summary.jsonand fails if any enabled threshold is not metUsage
Test plan