Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions .github/workflows/update-integration-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
timeout-minutes: 45
permissions:
contents: read
issues: write
steps:
- name: Create GitHub App token
id: app-token
Expand Down Expand Up @@ -177,6 +178,33 @@ jobs:
echo "Created $new_pr"
fi

- name: Report failure
if: ${{ failure() && github.event_name == 'schedule' }}
Comment on lines +181 to +182
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
shell: bash
run: |
set -euo pipefail

# One tracking issue for consecutive failures: comment on it while it is
# open, so a broken updater is noticed without a daily issue flood.
title="Integration Data Updater is failing"
existing=$(gh issue list \
--state open \
--search "\"$title\" in:title" \
--json number,title \
--jq "map(select(.title == \"$title\")) | .[0].number // empty")

if [ -n "$existing" ]; then
gh issue comment "$existing" --body "Scheduled run failed again: $RUN_URL"
else
gh issue create \
--title "$title" \
--body "The scheduled [Integration Data Updater]($RUN_URL) run failed. This issue is updated on each consecutive failure; close it once the workflow is green."
fi

- name: Summary
if: ${{ always() }}
shell: bash
Expand Down
18 changes: 13 additions & 5 deletions src/tools/PackageJsonGenerator/generate-package-json.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,26 @@ function Remove-StalePackageJsonFiles {

$integrationsFile = [System.IO.Path]::Combine($RepoRoot, "src", "frontend", "src", "data", "aspire-integrations.json")
$integrations = if (Test-Path $integrationsFile) {
# Entries marked `"apiReference": false` (third-party packages) are not documented here.
# Catalog fields are optional and StrictMode throws on missing properties, so
# read them through PSObject.Properties. Entries marked `"apiReference": false`
# (third-party packages) are not documented here.
@(Get-Content $integrationsFile -Raw | ConvertFrom-Json |
Where-Object { $_.apiReference -ne $false })
Where-Object {
$apiReference = $_.PSObject.Properties['apiReference']
-not $apiReference -or $apiReference.Value -ne $false
})
}
else {
@()
}
$catalogVersions = @{}
foreach ($integration in $integrations) {
if (-not [string]::IsNullOrWhiteSpace($integration.title) -and
-not [string]::IsNullOrWhiteSpace($integration.version)) {
$catalogVersions[$integration.title] = $integration.version
$title = $integration.PSObject.Properties['title']
$version = $integration.PSObject.Properties['version']
if ($title -and $version -and
-not [string]::IsNullOrWhiteSpace($title.Value) -and
-not [string]::IsNullOrWhiteSpace($version.Value)) {
$catalogVersions[$title.Value] = $version.Value
}
}

Expand Down
Loading