Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[Api Compat] Add support for excluding classes in compatibility check - #5124

Merged
M Rivera (mrivera-ms) merged 2 commits into
microsoft:mainfrom
southworks:southworks/add/apicompat-class-exclusion
Jan 26, 2021
Merged

[Api Compat] Add support for excluding classes in compatibility check#5124
M Rivera (mrivera-ms) merged 2 commits into
microsoft:mainfrom
southworks:southworks/add/apicompat-class-exclusion

Conversation

@denscollo

Copy link
Copy Markdown
Contributor

Description

This PR adds support for excluding classes from the API Compatibility checks.
We introduced a new pipeline variable (ApiCompatExcludeClasses) that will let you define a comma separated list of excluded classes. Each class has to be defined as [Package]+[Class], e.g. Microsoft.Bot.Builder.AdapterExtensions, ...
Then, the Compare Binaries task has been modified to not fail on issue leaving the pipeline with a SuccessWithIssues state when it founds compatibility issues.
Finally, a new PowerShell task will compare the compatibility issues found on the previous step with the list of excluded classes. If all issues have been excluded, the task will set the status as Success, otherwise it will be set as Failed.

Specific Changes

  • Updated Compare Binaries task on ci-api-validation-steps.yml to failOnIssue: false.
  • Updated post_results_to_gitHub job to depend on check_api_for instead of generate_multiconfig_var, occasionally it executes the GitHub PR Comment task before the Api Compat ones.
  • Added Compatibility Check PowerShell script after the Compare Binaries task, that will evaluate the result of Compare Binaries and process the output based on the excluded classes.
    • Filter out wanted classes from the found issues in Compare Binaries.
    • Updates Api Compat result file with the remaining issues from the exclusion or with a No Binary Compatibility issues.
  • Added succeededOrFailed() on PublishBuildArtifacts task to upload the previous task result, either succeed or failed.
  • Removed Insert nuget link into ApiCompat results file. task in favor of Compatibility Check and included some code from this task to maintain current functionality.

Testing

In the following image there is a sneak peek for the pipeline output and the GitHub Pr Comments.
image

@denscollo
Denise Scollo (denscollo) requested a review from a team as a code owner January 26, 2021 17:34
@mrivera-ms
M Rivera (mrivera-ms) merged commit e542cc0 into microsoft:main Jan 26, 2021
@sw-joelmut
Joel Mut (sw-joelmut) deleted the southworks/add/apicompat-class-exclusion branch September 21, 2021 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants