Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
79ec998
[NSUrlSessionHandler] Reject unsupported auth methods to allow fallba…
rolfbjarne May 22, 2026
4176951
[NSObject] Store the super handle in a ConditionalWeakTable. (#25454)
rolfbjarne May 22, 2026
7717e7b
[mtouch] Make mtouch work without Xcode, since we don't really need X…
rolfbjarne May 22, 2026
c56223b
[main] Update dependencies from dotnet/macios (#25499)
dotnet-maestro[bot] May 22, 2026
97204e7
Fix 'dotnet checkout' typos in docs/guides/HowToBranch.md (#25500)
rolfbjarne May 22, 2026
3c6edce
[tests] Upgrade remaining tests to NUnit v4 Assert.That syntax. (#25501)
rolfbjarne May 22, 2026
e3f0f38
[Foundation] Simplify memory management of NSObjectData for CoreCLR. …
rolfbjarne May 25, 2026
c284e3e
[devops] Remove the fix to avoid using a leaked GitHub ssh key. (#25504)
rolfbjarne May 25, 2026
97a86d5
[tests] Upload expected app size files as artifacts on test failure (…
rolfbjarne May 25, 2026
26af1ee
[msbuild] Improve how we handle the path to Xcode. (#24021)
rolfbjarne May 25, 2026
58f44c5
Fix missing 'don't' in docs/os-onboarding.md that reverses sentence m…
rolfbjarne May 26, 2026
ff427e0
[github] Update to gh aw v0.74.8 (#25514)
rolfbjarne May 26, 2026
c7e3139
[github] Add autoformat-v2.yml: single zizmor-clean workflow (#25510)
rolfbjarne May 26, 2026
181d135
[dotnet-linker] Add a trimmer step to inline calls to Class.GetHandle…
rolfbjarne May 26, 2026
9dc9c38
Make NSUrlSessionHandler handle redirects like the .NET handlers do (…
dalexsoto May 27, 2026
7a656b3
[bgen] Remove support for ZeroCopyStrings (#25515)
rolfbjarne May 27, 2026
fc4f229
[main] Update dependencies from dotnet/dotnet (#25533)
dotnet-maestro[bot] May 27, 2026
b8e66aa
[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test. (…
rolfbjarne May 27, 2026
90f96d5
[main] Update dependencies from dotnet/macios (#25520)
dotnet-maestro[bot] May 27, 2026
04c0a31
[devops] If SYSTEM_PULLREQUEST_PULLREQUESTNUMBER is set, always use t…
rolfbjarne May 27, 2026
70bac4a
[aw] Align Code Radiator base-branch policy with safe-output glob mat…
Copilot May 27, 2026
3a676cc
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 May 27, 2026
0ab164c
[src] NSBindingSelectionMarker is in AppKit. (#25523)
rolfbjarne May 27, 2026
ca43e4a
[bgen] Replace XPath lookups with Dictionary in DocumentationManager …
rolfbjarne May 27, 2026
5092c58
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 May 27, 2026
9be4da4
[tests] Misc improvements to the app size tests (#25522)
rolfbjarne May 27, 2026
963bc34
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 May 27, 2026
90bc033
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 May 27, 2026
eeb0a42
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 May 27, 2026
1becd48
[dotnet] Don't enable InlineClassGetHandle if we're using the static …
rolfbjarne May 27, 2026
8eb8f4b
Bump actions/upload-artifact from 4.6.2 to 7.0.1 (#25550)
dependabot[bot] May 27, 2026
1605355
[runtime] Show the error code if calling coreclr_initialize fails. (#…
rolfbjarne May 27, 2026
cad4a4b
[github] Fix workflows to pin actions & drop credentials when possibl…
rolfbjarne May 27, 2026
b2159ab
[CI] Add retry count on task failure for AzureCLI step in provision.y…
dalexsoto May 28, 2026
52b5249
[github] Add zizmor GitHub Actions security linter workflow (#25560)
rolfbjarne May 28, 2026
a584d6e
[github] Fix Code Radiator: prevent upstream unsetting that breaks sa…
Copilot May 28, 2026
05a0941
[main] Update dependencies from dotnet/dotnet (#25557)
dotnet-maestro[bot] May 29, 2026
32352a1
[tools] Make csproj.inc generation parallel-safe. (#25547)
rolfbjarne May 29, 2026
ed01fc2
[msbuild] Fix Content items with PublishFolderType losing files that …
rolfbjarne Jun 1, 2026
4381948
[msbuild] Improve diagnostics when simulator runtimes aren't availabl…
rolfbjarne Jun 1, 2026
67b8de6
Add support for Composer Icons (#24722)
rolfbjarne Jun 1, 2026
75e59fc
[docs] Fix reference to the ReferenceNativeSymbol item group. (#25579)
rolfbjarne Jun 1, 2026
53ffc72
[github] Raise Code Radiator PR patch-file limit to 1000 for inter-br…
Copilot Jun 1, 2026
1fb4e7e
[src] Add opt-in to build the platform assemblies serially. (#25546)
rolfbjarne Jun 2, 2026
957df39
[src] Remove NSPrintPreviewGraphicsContext. (#25527)
rolfbjarne Jun 2, 2026
56ffb2f
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Jun 2, 2026
d3a1bda
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Jun 2, 2026
151a329
Localized file check-in by OneLocBuild Task: Build definition ID 1441…
vs-mobiletools-engineering-service2 Jun 2, 2026
9d4392d
[docs] Minor update to docs about how to update api docs. (#25595)
rolfbjarne Jun 2, 2026
18077ca
[tests] Fix flaky BasicAuthWorksWhenBearerIsAdvertisedFirst test. Fix…
rolfbjarne Jun 2, 2026
47eb243
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Jun 2, 2026
58bb1f6
[main] Update dependencies from dotnet/dotnet (#25587)
dotnet-maestro[bot] Jun 2, 2026
194f285
[bgen] Cache raw GetCustomAttributesData() results per provider (#25564)
rolfbjarne Jun 2, 2026
a6b6c3c
[tools] Use instance-based Log methods. (#25566)
rolfbjarne Jun 2, 2026
d1a9361
[devops] yaml-templates go back to use main (#25600)
dalexsoto Jun 2, 2026
c3564ff
[tests] Update NUnit packages to latest stable versions (#25516)
rolfbjarne Jun 2, 2026
5c525a5
[make] Serialize AppleDocReader doc injection (#25568)
dalexsoto Jun 2, 2026
7d44c0f
[github] Update & recompile agentic workflows. (#25608)
rolfbjarne Jun 2, 2026
dbc04b5
[make] Allow configuring the Xcode path (#25622)
dalexsoto Jun 2, 2026
4fa8644
[sharpie] Ignore warnings about long paths when packaging sharpie. (#…
rolfbjarne Jun 3, 2026
e39f97b
[src] Mark MKDistanceFormatter as thread-safe. Fixes #25617. (#25620)
rolfbjarne Jun 3, 2026
621547e
[github] Disable signed-commit replay in Code Radiator merge PR pushe…
Copilot Jun 3, 2026
bb47971
[sharpie] Fix a parallel build issue by building before packing. (#25…
rolfbjarne Jun 3, 2026
ad81f10
[apidiff] Add nullability support to mono-api-info and mono-api-html …
rolfbjarne Jun 3, 2026
b53046a
[.github] Bump .github/workflows/inter-branch-merge-base.yml from b36…
dependabot[bot] Jun 4, 2026
5873232
[github] Bump actions/setup-dotnet from 5.2.0 to 5.3.0 (#25638)
dependabot[bot] Jun 4, 2026
90011e1
[tools] Remove most static state from the tools. (#25619)
rolfbjarne Jun 4, 2026
c102699
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Jun 4, 2026
e7e1795
[tests] Ignore any tests using CFNetworkHandler. Fixes #25634. (#25635)
rolfbjarne Jun 4, 2026
063c4ad
[tests] Don't strip symbols on any platform. (#25643)
rolfbjarne Jun 4, 2026
ac15946
[github] Increase Code Radiator safe-output patch size limit (#25642)
Copilot Jun 4, 2026
dc96511
[github] Disable weekly schedule trigger for CI Post-Mortem Analysis …
Copilot Jun 4, 2026
2743052
[tools] Don't inline calls to Class.GetHandle for BrowserEngineKit/Br…
rolfbjarne Jun 4, 2026
c513ce7
[tests] Filter out any warnings about using deprecated locations for …
rolfbjarne Jun 4, 2026
15b2113
[src] Remove CIFilterGenerator from iOS and Mac Catalyst. (#25630)
rolfbjarne Jun 4, 2026
72081d0
[msbuild] Fix getting an x64 simulator if asked to build for x64. (#2…
rolfbjarne Jun 4, 2026
4d39e1b
[CI] Use ACES in CI builds (#25572)
dalexsoto Jun 4, 2026
cb474e4
[monotouch-test] Add timeouts to all Thread.Join calls (#25644)
rolfbjarne Jun 5, 2026
4c9e983
[xtro] Don't report !unknown-type! for types with an [UnsupportedOSPl…
rolfbjarne Jun 5, 2026
4b5f49e
Merge branch 'main' into 'net11.0'
github-actions[bot] Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 53 additions & 13 deletions .github/agents/agentic-workflows.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ This is a **dispatcher agent** that routes your request to the appropriate speci
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
- **Fixing Dependabot PRs**: Routes to `dependabot` prompt — use this when Dependabot opens PRs that modify generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`). Never merge those PRs directly; instead update the source `.md` files and rerun `gh aw compile --dependabot` to bundle all fixes
- **Analyzing test coverage**: Routes to `test-coverage` prompt — consult this whenever the workflow reads, analyzes, or reports on test coverage data from PRs or CI runs
- **Rendering ASCII charts in markdown**: Routes to `asciicharts` guide — consult this whenever the workflow needs compact charts that render reliably in GitHub issues, comments, or discussions
- **CLI commands and triggering workflows**: Routes to `cli-commands` guide — consult this whenever the user asks how to run, compile, debug, or manage workflows from the command line, or when they need the MCP tool equivalent of a `gh aw` command
- **Reducing token consumption / cost optimization**: Routes to `token-optimization` guide — consult this whenever the user asks how to reduce token usage, lower costs, speed up workflows, or measure the impact of prompt changes with experiments
- **Choosing workflow architectures and design patterns**: Routes to `patterns` guide — consult this whenever the user asks for strategy, architecture, operating models, or pattern selection for agentic workflows

> [!IMPORTANT]
> For architecture/pattern-selection requests, load `https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/patterns.md` first.

Workflows may optionally include:

Expand All @@ -31,7 +37,7 @@ Workflows may optionally include:
- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
- Workflow lock files: `.github/workflows/*.lock.yml`
- Shared components: `.github/workflows/shared/*.md`
- Configuration: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/github-agentic-workflows.md
- Configuration: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/github-agentic-workflows.md

## Problems This Solves

Expand All @@ -53,7 +59,7 @@ When you interact with this agent, it will:
### Create New Workflow
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/create-agentic-workflow.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/create-agentic-workflow.md

**Use cases**:
- "Create a workflow that triages issues"
Expand All @@ -63,7 +69,7 @@ When you interact with this agent, it will:
### Update Existing Workflow
**Load when**: User wants to modify, improve, or refactor an existing workflow

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/update-agentic-workflow.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/update-agentic-workflow.md

**Use cases**:
- "Add web-fetch tool to the issue-classifier workflow"
Expand All @@ -73,7 +79,7 @@ When you interact with this agent, it will:
### Debug Workflow
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/debug-agentic-workflow.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/debug-agentic-workflow.md

**Use cases**:
- "Why is this workflow failing?"
Expand All @@ -83,7 +89,7 @@ When you interact with this agent, it will:
### Upgrade Agentic Workflows
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/upgrade-agentic-workflows.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/upgrade-agentic-workflows.md

**Use cases**:
- "Upgrade all workflows to the latest version"
Expand All @@ -93,7 +99,7 @@ When you interact with this agent, it will:
### Create a Report-Generating Workflow
**Load when**: The workflow being created or updated produces reports — recurring status updates, audit summaries, analyses, or any structured output posted as a GitHub issue, discussion, or comment

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/report.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/report.md

**Use cases**:
- "Create a weekly CI health report"
Expand All @@ -103,7 +109,7 @@ When you interact with this agent, it will:
### Create Shared Agentic Workflow
**Load when**: User wants to create a reusable workflow component or wrap an MCP server

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/create-shared-agentic-workflow.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/create-shared-agentic-workflow.md

**Use cases**:
- "Create a shared component for Notion integration"
Expand All @@ -113,7 +119,7 @@ When you interact with this agent, it will:
### Fix Dependabot PRs
**Load when**: User needs to close or fix open Dependabot PRs that update dependencies in generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`)

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/dependabot.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/dependabot.md

**Use cases**:
- "Fix the open Dependabot PRs for npm dependencies"
Expand All @@ -123,24 +129,58 @@ When you interact with this agent, it will:
### Analyze Test Coverage
**Load when**: The workflow reads, analyzes, or reports test coverage — whether triggered by a PR, a schedule, or a slash command. Always consult this prompt before designing the coverage data strategy.

**Prompt file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/test-coverage.md
**Prompt file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/test-coverage.md

**Use cases**:
- "Create a workflow that comments coverage on PRs"
- "Analyze coverage trends over time"
- "Add a coverage gate that blocks PRs below a threshold"

### Render ASCII Charts in Markdown
**Load when**: The workflow needs in-markdown charts (sparklines, bars, table+trend views) that must align cleanly and render reliably across GitHub surfaces, including mobile.

**Reference file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/asciicharts.md

**Use cases**:
- "Show a compact trend chart in an issue comment"
- "Render a dashboard table with sparkline trends"
- "Generate aligned ASCII bars for service metrics"

### CLI Commands Reference
**Load when**: The user asks how to run, compile, debug, or manage workflows from the command line; needs the MCP tool equivalent of a `gh aw` command; or is in a restricted environment (e.g., Copilot Cloud) without direct CLI access.

**Reference file**: https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/cli-commands.md
**Reference file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/cli-commands.md

**Use cases**:
- "How do I trigger workflow X on the main branch?"
- "What's the MCP equivalent of `gh aw logs`?"
- "I'm in Copilot Cloud — how do I compile a workflow?"
- "Show me all available gh aw commands"

### Token Consumption Optimization
**Load when**: The user asks how to reduce token usage, lower workflow costs, make a workflow faster or cheaper, or measure the impact of prompt or configuration changes.

**Reference file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/token-optimization.md

**Use cases**:
- "How do I reduce the token cost of this workflow?"
- "My workflow is too expensive — how do I optimize it?"
- "How do I compare token usage between two runs?"
- "Should I use gh-proxy or the MCP server?"
- "How do I use sub-agents to reduce costs?"
- "How do I measure the impact of a prompt change?"

### Workflow Pattern Selection
**Load when**: The user asks for architecture, strategy, operating model selection, or pattern recommendations for building agentic workflows.

**Reference file**: https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/patterns.md

**Use cases**:
- "Which pattern should I use for multi-repo rollout?"
- "How should I structure this workflow architecture?"
- "What pattern fits slash-command triage?"
- "Should this be DispatchOps or DailyOps?"

## Instructions

When a user interacts with you:
Expand Down Expand Up @@ -185,12 +225,12 @@ gh aw compile --validate

## Important Notes

- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/github-agentic-workflows.md for complete documentation
- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/github-agentic-workflows.md for complete documentation
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
- Follow security best practices: minimal permissions, explicit network access, no template injection
- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/network.md for the full list of valid ecosystem identifiers and domain patterns.
- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/network.md for the full list of valid ecosystem identifiers and domain patterns.
- **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself.
- **Triggering runs**: Always use `gh aw run <workflow-name>` to trigger a workflow on demand — not `gh workflow run <file>.lock.yml`. `gh aw run` handles workflow resolution by short name, input parsing and validation, and correct run-tracking for agentic workflows. Use `--ref <branch>` to run on a specific branch.
- **CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see https://github.com/github/gh-aw/blob/v0.72.1/.github/aw/cli-commands.md
- **CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see https://github.com/github/gh-aw/blob/v0.74.8/.github/aw/cli-commands.md
6 changes: 3 additions & 3 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"version": "v7.0.1",
"sha": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"
},
"github/gh-aw-actions/setup@v0.72.1": {
"github/gh-aw-actions/setup@v0.77.5": {
"repo": "github/gh-aw-actions/setup",
"version": "v0.72.1",
"sha": "bc56a0cad2f450c562810785ef38649c04db812a"
"version": "v0.77.5",
"sha": "3ea13c02d765410340d533515cb31a7eef2baaf0"
}
},
"containers": {
Expand Down
5 changes: 5 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ interface SomeClass {

## MSBuild Integration

### FileWrites

If a target or task creates a file, that file must be added to the `FileWrites` item group. This ensures MSBuild's incremental clean can delete generated files. Additionally, if a target produces multiple output files, all of them should be listed in the target's `Outputs` attribute for correct incremental build behavior.


### Custom MSBuild Tasks

Located in `msbuild/` directory:
Expand Down
16 changes: 9 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
- cooldown:
default-days: 7
directory: /
ignore:
- dependency-name: "github/gh-aw-actions/**" # Managed by gh aw compile. Version-locked to the gh-aw compiler; do not bump.
package-ecosystem: github-actions
schedule:
interval: weekly
version: 2
126 changes: 126 additions & 0 deletions .github/skills/update-expected-app-size/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
name: update-expected-app-size
description: >-
Download updated expected app size files from Azure DevOps CI artifacts for
the current branch. Use when app size tests fail in CI and the user wants to
update the expected files locally. Trigger on "update app size", "download
expected files", "fix app size test", or "update expected app size files".
---

# Update Expected App Size Files

Download updated expected app size files from Azure DevOps artifacts for the current branch's PR build, and apply them to the repository.

## When to Use

- App size tests failed in CI and the user wants to update the expected files
- User asks to "update app size", "download expected files", or "fix app size test failures"
- User wants to pull the updated expected files from a recent CI build

## Background

The app size tests (`tests/dotnet/UnitTests/AppSizeTest.cs`) compare the built app's size and preserved APIs against expected files stored in `tests/dotnet/UnitTests/expected/`. When the test detects a difference and `WRITE_KNOWN_FAILURES` is not set, it writes the updated expected file to `$(Build.ArtifactStagingDirectory)/updated-expected-sizes/`, and a pipeline step publishes this directory as a build artifact.

The artifact name follows the pattern `{uploadPrefix}updated-expected-sizes-{testPrefix}-{attempt}` (e.g., `updated-expected-sizes-dotnettests_ios-1`). Inside the artifact, files are named after the test variant:
- `{Platform}-{Variant}-size.txt` — e.g., `iOS-MonoVM-size.txt`, `iOS-MonoVM-interpreter-size.txt`, `iOS-NativeAOT-TrimmableStatic-size.txt`, `MacOSX-CoreCLR-Interpreter-size.txt`
- `{Platform}-{Variant}-preservedapis.txt` — e.g., `iOS-MonoVM-preservedapis.txt`, `MacCatalyst-MonoVM-interpreter-preservedapis.txt`

The expected files on disk are at:
- `tests/dotnet/UnitTests/expected/{Platform}-{Variant}-size.txt`
- `tests/dotnet/UnitTests/expected/{Platform}-{Variant}-preservedapis.txt`

## Workflow

### 1. Determine the current branch and PR

```bash
BRANCH=$(git branch --show-current)
# Find the PR number for this branch
gh pr list --head "$BRANCH" --repo dotnet/macios --json number,url --jq '.[0]'
```

If no PR is found, inform the user that this skill requires a PR to exist for the current branch (so that CI has run).

### 2. Find the Azure DevOps build

The CI builds for PRs in dotnet/macios run in the `devdiv` Azure DevOps organization, project `DevDiv`.

Use the GitHub PR checks to find the Azure DevOps build URL:

```bash
gh pr checks <PR_NUMBER> --repo dotnet/macios
```

Look for a check that links to Azure DevOps. The build URL will look like:
```
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=XXXXXXX
```

Extract the `buildId` from the URL.

### 3. Download the artifacts

Use the Azure DevOps REST API to list and download artifacts:

```bash
# List artifacts for the build
TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv)
curl -s "https://devdiv.visualstudio.com/DevDiv/_apis/build/builds/{buildId}/artifacts?api-version=7.0" \
-H "Authorization: Bearer $TOKEN"
```

Look for artifacts whose names contain `updated-expected-sizes` (e.g., `updated-expected-sizes-dotnettests_ios-1`). Get the artifact's `downloadUrl` and download it:

```bash
# Get the download URL for a specific artifact
ARTIFACT_INFO=$(curl -s "https://devdiv.visualstudio.com/DevDiv/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&api-version=7.0" \
-H "Authorization: Bearer $TOKEN")
DOWNLOAD_URL=$(echo "$ARTIFACT_INFO" | python3 -c "import sys,json; print(json.load(sys.stdin)['resource']['downloadUrl'])")

# Download the artifact zip
curl -sL "$DOWNLOAD_URL" -H "Authorization: Bearer $TOKEN" -o artifact.zip
```

If `az` is not available or not authenticated, direct the user to download manually from the Azure DevOps build artifacts page.

### 4. Place the files

Extract the downloaded artifact zip and place the files in the expected directory:

```bash
EXPECTED_DIR="tests/dotnet/UnitTests/expected"
unzip -o artifact.zip -d /tmp/updated-sizes/
cp /tmp/updated-sizes/*/*.txt "$EXPECTED_DIR/"
```

The files inside the zip already have the correct names (e.g., `iOS-MonoVM-size.txt`) and can be copied directly.

### 5. Verify and commit

After placing the files:
1. Run `git diff` to show what changed
2. Ask the user if the changes look correct
3. If confirmed, commit the changes:
```bash
git add tests/dotnet/UnitTests/expected/
git commit -m "[tests] Update expected app size files"
```

## Fallback: Manual Download

If automated download fails (auth issues, etc.), provide the user with:
1. The Azure DevOps build URL
2. Instructions to navigate to the build → Summary → Artifacts section
3. Look for individual artifacts whose names contain `updated-expected-sizes`
4. Download the artifact zip, extract it, and copy the `.txt` files (e.g., `iOS-MonoVM-interpreter-size.txt`) into `tests/dotnet/UnitTests/expected/`

## Fallback: Run Locally

If the user can build locally, they can update the expected files directly:

```bash
WRITE_KNOWN_FAILURES=1 tests-dotnet AppSizeTest
```

This runs the tests, updates the expected files in place, and marks the tests as passed.

Loading