Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Create the initial stage to start running APIScan. #19828

Merged
merged 7 commits into from
Feb 6, 2024

Conversation

mandel-macaque
Copy link
Member

APIScan is slow (as per their own documentation). To ensure that the extra check does not slow our CI we create a matrix that will run APIScan in each of the platforms to later be uploaded to TSA via a funnel job.

APIScan is slow (as per their own documentation). To ensure that the
extra check does not slow our CI we create a matrix that will run
APIScan in each of the platforms to later be uploaded to TSA via a
funnel job.
@mandel-macaque mandel-macaque changed the title [CI] Create the inital stage to start running APIScan. [CI] Create the initial stage to start running APIScan. Jan 15, 2024
INCLUDE: $(INCLUDE_DOTNET_IOS)
PLATFORM: iOS
SECRET: $(ApiScanSecretiOS)
VERSION: 17.0
Copy link
Member

Choose a reason for hiding this comment

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

The VERSION field doesn't seem to be used (which is probably good, because it's outdated already... should be 17.2).

Copy link
Member Author

Choose a reason for hiding this comment

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

@rolfbjarne it will be used, but we will get it from the config step. It is a place holder atm. APIScan takes the version of the product as a parameter so that we can identify the actual problem.

Comment on lines 43 to 57
tvOS:
INCLUDE: $(INCLUDE_DOTNET_TVOS)
PLATFORM: tvOS
SECRET: $(ApiScanSecretiOS)
VERSION: 17.0
macCatalyst:
INCLUDE: $(INCLUDE_DOTNET_MACCATALYST)
PLATFORM: macCatalyst
SECRET: $(ApiScanSecretiOS)
VERSION: 17.0
macOS:
INCLUDE: $(INCLUDE_DOTNET_MACOS)
PLATFORM: macOS
SECRET: $(ApiScanSecretmacOS)
VERSION: 14.0
Copy link
Member

Choose a reason for hiding this comment

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

I'm not very fond of hardcoding the list of platforms in yet another place (visionOS...), so would it be possible to generate this somehow? The DOTNET_PLATFORMS variable (stageDependencies.configure_build.configure.outputs['configure_platforms.DOTNET_PLATFORMS']) should contain the list of enabled platforms.

Copy link
Member Author

Choose a reason for hiding this comment

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

lets see if I can do that, but there are certain problem with using a runtime variable in a template.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rolfbjarne the change you are asking, as we have everything is impossible. With he yaml template synstax we have 3 diff stages:

  • ${{ }} : This is a template expression. It gets executed BEFORE anything runs and expands the data.
  • $[]: Expanded at runtime.

A template cannot use a value that is generated and runtime. If we really wanted to get to the point in which we can generate things like the one you suggest, we should do a two step, in which we generate a yaml file with the variables/parameters needed by the templates and then generated. Else we can move to use template parameter form the pipeline and push them down. It will mean we need to update those params in a single place.

AZP does not give us many options. If we want to go that route, we need to move the new platforms param I added to the entry level yaml for both ci and pr.

Copy link
Member

Choose a reason for hiding this comment

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

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@mandel-macaque mandel-macaque force-pushed the download-workloads-apiscan branch 2 times, most recently from f63b675 to b77f489 Compare January 15, 2024 22:06
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@mandel-macaque mandel-macaque force-pushed the download-workloads-apiscan branch 2 times, most recently from 0843b4c to cc6523c Compare February 2, 2024 16:38
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@mandel-macaque mandel-macaque force-pushed the download-workloads-apiscan branch from cc6523c to c57b9e5 Compare February 2, 2024 18:46
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@mandel-macaque mandel-macaque force-pushed the download-workloads-apiscan branch 3 times, most recently from c890229 to 1794bd4 Compare February 2, 2024 19:32
@mandel-macaque mandel-macaque force-pushed the download-workloads-apiscan branch from 1794bd4 to bcaa9d6 Compare February 2, 2024 19:45
commit: ${{ parameters.commit }}

- pwsh: |
Write-Output "Performing APISCan for $(PLATFORM) using tenant $(TENANT) client id $(CLIENT_ID) and secret $(SECRET)."
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the secret be displayed like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Devops is super smart (for once), and knows not to display them:

Screenshot 2024-02-02 at 15 29 11

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 6b9cc52384957c0e8e6ea4c1d7c3f7ba4755d008 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 6b9cc52384957c0e8e6ea4c1d7c3f7ba4755d008 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 170 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ install-source: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 7 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac-binding-project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 41 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 6b9cc52384957c0e8e6ea4c1d7c3f7ba4755d008 [PR build]

Comment on lines 23 to 24
'tvOS': 'ApiScanSecretiOS',
'macCatalyst': 'ApiScanSecretiOS',
Copy link
Member

Choose a reason for hiding this comment

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

Should there be separate secrets for tvOS and Mac Catalyst?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, don't longer need that

variables:
${{ each p in parameters.platforms }}:
INCLUDE_DOTNET_${{ upper(p.key) }}: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_${{ upper(p.key)}}'] ]
INCLUDE_DOTNET_${{ upper(p.key) }}_VERSION: 17.0
Copy link
Member

Choose a reason for hiding this comment

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

17.0 is already passed... any way to not hardcode this value? It's also wrong for macOS.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same, I need cleaning

@mandel-macaque mandel-macaque merged commit b7f4bef into main Feb 6, 2024
6 checks passed
@mandel-macaque mandel-macaque deleted the download-workloads-apiscan branch February 6, 2024 21:47
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this pull request Feb 7, 2024
rolfbjarne added a commit that referenced this pull request Feb 7, 2024
mandel-macaque added a commit to mandel-macaque/xamarin-macios that referenced this pull request Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants