Decouple diff-cover enforcement from integration test job#648
Merged
hdwhdw merged 5 commits intosonic-net:masterfrom Apr 21, 2026
Merged
Decouple diff-cover enforcement from integration test job#648hdwhdw merged 5 commits intosonic-net:masterfrom
hdwhdw merged 5 commits intosonic-net:masterfrom
Conversation
Remove DIFF_COVER_* variables from the build job so it can be renamed without breaking the wrapper's GitHub check name coupling. The DiffCoverageCheck job now sets DIFF_COVER_ENABLE and related variables, making it the sole hook point for the sonic-build-web coverage wrapper. The native diff-cover --fail-under step is removed since the wrapper handles threshold enforcement via GitHub checks. Also remove the now-unused global DIFF_COVER_THRESHOLD variable. Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Moves diff-coverage configuration out of the build job and into the dedicated DiffCoverageCheck job so the external coverage wrapper can rely on a single, stable job/check hook point.
Changes:
- Removed global
DIFF_COVER_THRESHOLDand thediff-cover --fail-underenforcement step. - Removed
DIFF_COVER_*variables from thebuildjob and added them toDiffCoverageCheck. - Added
DIFF_COVER_COVERAGE_FILESto point the wrapper at both integration and pure coverage XML artifacts.
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # azure-pipelines.yml Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Now that diff-cover enforcement is on DiffCoverageCheck, the build job name is no longer coupled to the wrapper's GitHub check name. Rename it to IntegrationTest to better describe what it does. Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Reuse the 'build' job id for the diff-coverage job so the wrapper's
GitHub check name remains coverage.{DefName}.build, matching existing
branch protection rules. No admin changes needed.
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines uses displayName (not job id) for the status context reported to GitHub. The wrapper also uses Agent.JobName which resolves to displayName. Set it back to 'build' so both the Azure Pipelines check (sonic-net.sonic-gnmi (Build build)) and the wrapper check (coverage.sonic-net.sonic-gnmi.build) match existing branch protection rules. Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
zbud-msft
approved these changes
Apr 21, 2026
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.
Why I did it
The
buildjob previously served double duty: running integration tests and hosting the diff-cover wrapper hook. This coupled the job displayName to the wrapper's GitHub check name (coverage.{DefinitionName}.{displayName}), preventing any renaming without breaking branch protection rules.How I did it
DIFF_COVER_ENABLE,DIFF_COVER_CHECK_THRESHOLD, and related variables from the integration test job to a dedicated lightweight job that only downloads coverage artifacts and hosts the wrapper decorator.buildtoIntegrationTestwith displayName "Integration Tests".buildto preserve the existing wrapper check name (coverage.sonic-net.sonic-gnmi.build) and avoid branch protection changes.diff-cover --fail-understep since the wrapper handles threshold enforcement via GitHub checks.DIFF_COVER_THRESHOLDvariable.DIFF_COVER_COVERAGE_FILESto explicitly point the wrapper at both pure and integration coverage XML artifacts.How to verify it
coverage.sonic-net.sonic-gnmi.buildstill appears and enforces the 80% threshold.Which release branch to backport (provide reason below if selected)
Description for the changelog
Decouple diff-cover wrapper hook from integration test job, allowing the test job to be renamed independently.
Link to config_db schema for YANG module changes
N/A
A picture of a cute animal (not mandatory but encouraged)