Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/refresh-manifests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Refresh Manifests

on:
workflow_dispatch:
schedule:
- cron: '0 16 * * *' # 8am PST (16:00 UTC) - same schedule as API review
Comment on lines +4 to +6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be better if the manifest was updated on the PRs that made them change. Not in a separate batched PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does that look like?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like a test (or GH action) that runs on PRs and fails when they are out of date.


permissions:
contents: write
pull-requests: write

jobs:
generate-and-pr:
runs-on: windows-latest # Using Windows because the script uses PowerShell and build.cmd
if: ${{ github.repository_owner == 'dotnet' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Run RefreshManifests Script
shell: pwsh
run: |
./eng/refreshManifests.ps1

- name: Create or update pull request
uses: dotnet/actions-create-pull-request@e8d799aa1f8b17f324f9513832811b0a62f1e0b1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-manifests
base: main
labels: |
area-app-model
area-engineering-systems
title: "[Automated] Update Manifests"
body: "Auto-generated update to refresh the manifests. This PR will be updated automatically if new changes are detected. Fixes #9502."
Comment thread
davidfowl marked this conversation as resolved.
Outdated
49 changes: 47 additions & 2 deletions eng/refreshManifests.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
..\build.cmd
get-childitem ..\playground\*AppHost.csproj -Recurse | % { "Generating Manifest for: $_"; dotnet run --no-build --project $_.FullName --launch-profile generate-manifest }
#!/usr/bin/env pwsh

# Get the script directory
$scriptDir = $PSScriptRoot
$repoRoot = Split-Path -Parent $scriptDir

# Determine which build script to use based on OS
if ($IsWindows -or $env:OS -eq "Windows_NT") {
& "$repoRoot/build.cmd"
} else {
& "$repoRoot/build.sh"
}

# Find all AppHost projects in the playground directory
$playgroundDir = Join-Path -Path $repoRoot -ChildPath "playground"

if (Test-Path $playgroundDir) {
Get-ChildItem -Path $playgroundDir -Filter "*AppHost.csproj" -Recurse | ForEach-Object {
# Check if the project has a launchSettings.json file with a generate-manifest profile
$projectDir = Split-Path -Parent $_.FullName
$launchSettingsPath = Join-Path -Path $projectDir -ChildPath "Properties" -AdditionalChildPath "launchSettings.json"

Copilot AI May 26, 2025

Copy link

Choose a reason for hiding this comment

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

The Join-Path cmdlet does not support an '-AdditionalChildPath' parameter. Consider using nested Join-Path calls or joining 'Properties/launchSettings.json' as a single string to avoid runtime errors.

Suggested change
$launchSettingsPath = Join-Path -Path $projectDir -ChildPath "Properties" -AdditionalChildPath "launchSettings.json"
$launchSettingsPath = Join-Path -Path (Join-Path -Path $projectDir -ChildPath "Properties") -ChildPath "launchSettings.json"

Copilot uses AI. Check for mistakes.

@davidfowl davidfowl May 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot can you run the script to see if it works?

The Join-Path cmdlet does not support an '-AdditionalChildPath' parameter. Consider using nested Join-Path calls or joining 'Properties/launchSettings.json' as a single string to avoid runtime errors.

$hasManifestProfile = $false

if (Test-Path $launchSettingsPath) {
try {
$launchSettings = Get-Content -Raw -Path $launchSettingsPath | ConvertFrom-Json
if ($launchSettings.profiles -and $launchSettings.profiles.'generate-manifest') {
$hasManifestProfile = $true
}
}
catch {
Write-Warning "Failed to read or parse launch settings for $_"
}
}

if ($hasManifestProfile) {
Write-Host "Generating Manifest for: $_"
dotnet run --no-build --project $_.FullName --launch-profile generate-manifest
}
else {
Write-Warning "Skipping $_ - no generate-manifest profile found"
}
}
}
else {
Write-Error "Playground directory not found at: $playgroundDir"
}