Skip to content

Conversation

@rmarinho
Copy link
Member

@rmarinho rmarinho commented Aug 1, 2025

Description of Change

When moving to the new dnceng builds we stopped to run the api scan , this adds it back since the 1ES templates don t support it yet. Other sdl tools work fine .

image

This pull request introduces a new pipeline stage for API scanning and integrates it into the existing build pipeline. The changes primarily focus on adding the APIScan stage, configuring its parameters, and ensuring the necessary artifacts are prepared and consumed. Below are the most significant changes grouped by theme:

Addition of the APIScan Stage:

  • Added a new stage-api-scan.yml template to define the APIScan stage. This includes parameters for configuration (e.g., AppId, TenantId, ServiceConnectionId) and steps to run the APIScan task, publish analysis logs, and allow pre/post custom steps. (eng/pipelines/arcade/stage-api-scan.yml)

Integration with Existing Pipelines:

  • Integrated the APIScan stage into the internal pipeline by extending the azure-pipelines-internal.yml file. The APIScan stage is configured to depend on the Pack stage and uses the appropriate VM pool. (eng/pipelines/azure-pipelines-internal.yml)

Artifact Preparation for APIScan:

  • Updated the stage-pack.yml file to prepare and output the APIScanFiles artifact, which includes assemblies required for the API scan. This involves copying .dll and .pdb files to a temporary directory for use in the APIScan stage. (eng/pipelines/arcade/stage-pack.yml) [1] [2]

Cleanup of Deprecated Code:

  • Removed commented-out build script invocations in the stage-pack.yml file to improve readability and maintainability. (eng/pipelines/arcade/stage-pack.yml)

Copilot AI review requested due to automatic review settings August 1, 2025 18:57
@rmarinho rmarinho requested a review from a team as a code owner August 1, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds API scanning capability to the build pipeline by introducing a new APIScan stage and integrating it into the existing CI/CD workflow. The change addresses the gap left when transitioning to new dnceng builds, which stopped running API scans because 1ES templates don't support this functionality yet.

  • Adds a new APIScan stage with configurable parameters for scanning MAUI assemblies
  • Integrates the APIScan stage into the internal pipeline to run after the Pack stage
  • Prepares and publishes APIScanFiles artifacts containing assemblies (.dll and .pdb files) needed for scanning

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
eng/pipelines/azure-pipelines-internal.yml Integrates the new APIScan stage into the internal pipeline
eng/pipelines/arcade/stage-pack.yml Adds artifact preparation for APIScan and removes commented code
eng/pipelines/arcade/stage-api-scan.yml Defines the new APIScan stage template with job configuration

- task: CopyFiles@2
displayName: Copy assemblies for APIScan
inputs:
SourceFolder: '$(Build.SourcesDirectory)\artifacts\bin\Controls.Core'
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded path 'Controls.Core' makes this specific to one component. Consider using a parameter or variable to make this more flexible for scanning other components.

Suggested change
SourceFolder: '$(Build.SourcesDirectory)\artifacts\bin\Controls.Core'
SourceFolder: '$(Build.SourcesDirectory)\artifacts\bin\${{ parameters.componentName }}'

Copilot uses AI. Check for mistakes.
@rmarinho rmarinho changed the title [ci] Api scan on dnceng [ci] Enable api scan on dnceng Aug 1, 2025
@rmarinho rmarinho merged commit 2662929 into main Aug 5, 2025
123 of 129 checks passed
@rmarinho rmarinho deleted the api-scan-dnceng branch August 5, 2025 09:18
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request Aug 12, 2025
* [ci] List dlls

* Fix steps

* Again

* Again

* yml

* Execute post steps

* Try run apiscan

* Try add ids

* TRY AGAIN

* Try 1ES tasks

* Fxi ident

* Remove publish

* Try template context

* isProduction

* try outputs

* not release job

* Fix artifact name

* Try again fix variables

* Try push metadat files

* Try hardcode

* Try again

* Update variables
rmarinho added a commit that referenced this pull request Aug 13, 2025
* [ci] List dlls

* Fix steps

* Again

* Again

* yml

* Execute post steps

* Try run apiscan

* Try add ids

* TRY AGAIN

* Try 1ES tasks

* Fxi ident

* Remove publish

* Try template context

* isProduction

* try outputs

* not release job

* Fix artifact name

* Try again fix variables

* Try push metadat files

* Try hardcode

* Try again

* Update variables
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
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.

2 participants