The existing Objective-C class to request an App Store review (SKStoreReviewController) is deprecated in Xcode 16+, and it doesn't even work on the corresponding OS versions.
The replacement API is Swift-only, but luckily it's a very simple API (just a static method), so it's possible to bind it manually.
This required a few other changes/improvements:
* Add support for Swift code in our runtime.
* Just to keep the changes to a minimum, bump the min OS version for legacy code to match the .NET min OS versions. This is because our build logic uses the legacy min versions when compiling native code (a more involved fix would be to update all the build logic to build native code to use the .NET min OS versions, but that's not the point of this PR, so I took the easy route). Fixes#10659.
I've tested the method locally, and it seems to work fine, but I've still marked
it as experimental for now. There are no unit tests because calling the method will
put up a dialog, which won't work correctly in unit tests.
Fixes https://github.com/xamarin/xamarin-macios/issues/21410.
Fixes https://github.com/xamarin/xamarin-macios/issues/10659.
* Unify the code to collect diagnostic information about a bot.
* Unify some of the cleanup code to prepare a bot as well.
* Implement code to terminate processes on a bot that's used more than a day
of CPU (presumably these processes are stuck for some reason).
We still need some of the source files from the legacy Mono library, but it's
only a few files, so just add them to the git repo.
Also implement caching of the .NET download, which speeds up clean rebuilds
significantly.
Note: all the files in the `builds/mono-ios-sdk-destdir` are a straight import
from the Mono archive, so those shouldn't need much reviewing (nor will I
change them unless absolutely necessary).
This new pipeline will only be executed when the CI build is completed
by any of the branches that have been listed to be included in the
trigger.
This pipeline because it does a release has to extend the 1ES template.
---------
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Due to the way that resource triggers are implemented in VSTS, we are
triggering tests more than once. To solve the issue, we need to move the
diff stages to different pipelines. This is the first step to allow use
to get less stages in the build so that we can reduce the number of
tests that are triggered.
Clean the CI from all references to the old pkg notarisation and
signing.
- Remove the templates that did the jobs.
- Remove the parameters that allowed to skip the signing and
notarisation.
- Remove the references to the scripts.
This simplifies greatly the yaml.
Split the variables and document their usage. Because we are going to
have to add more pipelines we want to limit the amount of secrets a new
pipeline requests and uses.
The split is as follows:
- variables/common.yml: needed by all.
- variables/api-scan.yml: needed by the api scan pipeline.
- variables/signing.yml: needed by pipeline that need to perform
signing.
---------
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
* Whenever we add a GitHub comment, also provide a comment id.
* When adding a GitHub comment, use that comment id to hide any previous comments with the same id.
It turns out this simplifies the code a lot, and additionally we now correctly
hide every comment we report whenever a step or stage is re-executed.
This should speed up getting bots ready, since now we only run the
provisionator once for each bot, and we also don't try to provision the
same thing multiple times.
This will typically save between 1 and 2 minutes for every test run.
But potentially much more if GitHub happens to be slow:
```
[...]
Working on a PR, Undoing the github merge with main.
##[error]The task has timed out.
[...]
```
It's old, hasn't been executed in years and quite bitrotten by now (it only
builds legacy Xamarin samples for instance).
We could port it to .NET, but first we'd need sample apps, and there
aren't many of those yet.
Append to the agent log, instead of creating the file, when an exception occcurs.
The problem is that creating the file fails if it already exists:
Exception occurred: Exception calling "Parse" with "1" argument(s): "String '' was not recognized as a valid DateTime."
New-Item: /Users/builder/azdo/_work/4/s/xamarin-macios/tools/devops/automation/scripts/generate_agent_logs.ps1:52
Line |
52 | New-Item -Path $Output -Value "$_"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The file '/Users/builder/azdo/_work/4/s/agent-logs.log' already exists.
The consumers of the API stage already passes a value, so a default is not needed.
This reduces the number of places we have to change every time we switch between stable and beta.
We need the AzDo.BearerToken in later steps that have the 'always()'
condition, and unless we actually get the AzDo.BearerToken under the same
conditions, those later steps will fail.
One example is if the job was cancelled, or previous steps failed (which is
common when running tests).
Example failure for re-enabling macOS bots:
```
AzDO.BearerToken : The term 'AzDO.BearerToken' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\AzDO\_work\_temp\9b207e8a-c163-4c97-93d3-e7e3bb908583.ps1:6 char:23
+ $azdoBearerToken = "$(AzDO.BearerToken)"
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (AzDO.BearerToken:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
```
This problem causes a lot of bots to end up disabled, because we fail to
re-enable them after using them.