Skip to content

Commit 3953d5a

Browse files
committed
refactor: extract record-registry-api as separate job
Move registry API recording out of record-connector-registry into its own job that depends on both legacy recording paths (dist + lambda). This ensures the registry API recording has the full picture: assets, images, config_schema, capabilities, documentation, and changelog. The three recording jobs now have clear separation: - record-connector-registry: legacy dist manifest + S3 upload - record-lambda-registry: legacy per-connector Lambda invocation - record-registry-api: new path, runs after both legacy jobs complete Removed continue-on-error from the recording step — failures should be visible since this is becoming the primary recording path.
1 parent 0c0dfef commit 3953d5a

1 file changed

Lines changed: 117 additions & 83 deletions

File tree

.github/workflows/release.yaml

Lines changed: 117 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -908,12 +908,12 @@ jobs:
908908
done < "$DIGEST_FILE"
909909
910910
record-connector-registry:
911-
# require binaries to succeed; windows, docker, and lambda recording may be skipped based on inputs
912-
# each optional job must succeed if it ran — a failure means incomplete release artifacts
913-
# waits for record-lambda-registry so the registry API recording has the full picture (config_schema, capabilities)
911+
# Legacy dist recording: manifest + S3 upload.
912+
# Require binaries to succeed; windows and docker may be skipped based on inputs.
913+
# Each optional job must succeed if it ran — a failure means incomplete release artifacts.
914914
# see: https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution
915-
if: ${{ !cancelled() && needs.goreleaser-binaries.result == 'success' && (needs.goreleaser-windows.result == 'success' || needs.goreleaser-windows.result == 'skipped') && (needs.goreleaser-docker.result == 'success' || needs.goreleaser-docker.result == 'skipped') && (needs.record-lambda-registry.result == 'success' || needs.record-lambda-registry.result == 'skipped') }}
916-
needs: [determine-workflows-ref, goreleaser-binaries, goreleaser-windows, goreleaser-docker, record-lambda-registry]
915+
if: ${{ !cancelled() && needs.goreleaser-binaries.result == 'success' && (needs.goreleaser-windows.result == 'success' || needs.goreleaser-windows.result == 'skipped') && (needs.goreleaser-docker.result == 'success' || needs.goreleaser-docker.result == 'skipped') }}
916+
needs: [determine-workflows-ref, goreleaser-binaries, goreleaser-windows, goreleaser-docker]
917917
permissions:
918918
id-token: write
919919
contents: read
@@ -1179,14 +1179,104 @@ jobs:
11791179
11801180
rm -f "$TMPFILE"
11811181
1182-
# ================================================================
1183-
# Registry API: record release with GitHub OIDC auth
1184-
# During migration, this runs alongside Lambda invocation (dual-write).
1185-
# The Lambda path remains the source of truth until cutover.
1186-
# Rollout controlled by which release workflow version each connector uses.
1187-
# ================================================================
1182+
record-lambda-registry:
1183+
if: inputs.lambda == true
1184+
# Legacy per-connector Lambda invocation — records to connectorreleases DynamoDB.
1185+
# Only needs binaries + docker (container images). Does not gate on windows/msi since
1186+
# the Lambda pipeline only cares about container images. Will be removed after cutover
1187+
# to the registry API (record-connector-registry replaces this path).
1188+
needs: [goreleaser-binaries, goreleaser-docker]
1189+
permissions:
1190+
id-token: write
1191+
contents: read
1192+
runs-on: ubuntu-latest
1193+
steps:
1194+
- name: Configure AWS credentials via OIDC
1195+
uses: aws-actions/configure-aws-credentials@v5
1196+
with:
1197+
role-to-assume: "arn:aws:iam::168442440833:role/GitHubActionsECRPushRole-${{ github.event.repository.name }}"
1198+
aws-region: us-west-2
1199+
1200+
- name: Invoke Lambda with retries
1201+
run: |
1202+
set +e # Disable default fail-fast to support retries
1203+
if [[ "$ACTIONS_STEP_DEBUG" == "true" ]]; then
1204+
set -x # Debug logging
1205+
fi
11881206
1189-
- name: Checkout connector repo (for docs)
1207+
TMPFILE=$(mktemp)
1208+
MAX_RETRIES=5
1209+
RETRY_DELAY=10 # seconds
1210+
1211+
for ((i=1; i<=MAX_RETRIES; i++)); do
1212+
echo "Attempt $i to invoke Lambda..."
1213+
1214+
RESPONSE=$(aws lambda invoke \
1215+
--function-name "${{ github.event.repository.name }}-releases" \
1216+
--payload "{\"tag\":\"${{ inputs.tag }}\"}" \
1217+
--cli-binary-format raw-in-base64-out \
1218+
"$TMPFILE" 2>&1)
1219+
EXIT_CODE=$?
1220+
1221+
echo "AWS CLI exited with code: $EXIT_CODE"
1222+
cat "$TMPFILE"
1223+
1224+
STATUS_CODE=$(jq -r '.statusCode' < "$TMPFILE" 2>/dev/null)
1225+
1226+
if [[ $EXIT_CODE -eq 0 && "$STATUS_CODE" == "200" ]]; then
1227+
echo "Lambda invoked successfully."
1228+
break
1229+
1230+
elif [[ "$RESPONSE" == *"CodeArtifactUserPendingException"* ]]; then
1231+
echo "Lambda not ready (CodeArtifactUserPendingException)."
1232+
1233+
if [[ $i -lt $MAX_RETRIES ]]; then
1234+
WAIT_TIME=$((i * RETRY_DELAY))
1235+
echo "Retrying in $WAIT_TIME seconds..."
1236+
sleep "$WAIT_TIME"
1237+
else
1238+
echo "Lambda still not ready after $MAX_RETRIES attempts."
1239+
rm -f "$TMPFILE"
1240+
exit 1
1241+
fi
1242+
1243+
else
1244+
echo "Lambda invoke failed with unexpected error: $RESPONSE"
1245+
rm -f "$TMPFILE"
1246+
exit 1
1247+
fi
1248+
done
1249+
1250+
rm -f "$TMPFILE"
1251+
1252+
# ================================================================
1253+
# Registry API: record release after all legacy recording completes.
1254+
# Depends on both dist (record-connector-registry) and lambda (record-lambda-registry)
1255+
# so the recording has the full picture: assets, images, config_schema, capabilities.
1256+
# continue-on-error on the recording step so failures don't block the release.
1257+
# Will become the sole recording path after cutover.
1258+
# ================================================================
1259+
record-registry-api:
1260+
if: ${{ !cancelled() && needs.record-connector-registry.result == 'success' && (needs.record-lambda-registry.result == 'success' || needs.record-lambda-registry.result == 'skipped') }}
1261+
needs: [determine-workflows-ref, goreleaser-binaries, goreleaser-windows, goreleaser-docker, record-connector-registry, record-lambda-registry]
1262+
permissions:
1263+
id-token: write
1264+
contents: read
1265+
runs-on: ubuntu-latest
1266+
steps:
1267+
- name: Checkout connector workflows
1268+
uses: actions/checkout@v5
1269+
with:
1270+
path: _workflows
1271+
repository: ConductorOne/github-workflows
1272+
ref: ${{ needs.determine-workflows-ref.outputs.ref }}
1273+
1274+
- name: Set up Go for workflows
1275+
uses: actions/setup-go@v6
1276+
with:
1277+
go-version-file: "_workflows/go.mod"
1278+
1279+
- name: Checkout connector repo
11901280
uses: actions/checkout@v5
11911281
with:
11921282
path: _connector
@@ -1219,9 +1309,22 @@ jobs:
12191309
run: |
12201310
gh api "repos/${{ github.repository }}/releases/tags/${{ inputs.tag }}" --jq .body > /tmp/changelog.md || true
12211311
1312+
- name: Merge manifests for registry API
1313+
working-directory: _workflows
1314+
env:
1315+
BINARIES_MANIFEST: ${{ needs.goreleaser-binaries.outputs.binaries_manifest }}
1316+
WINDOWS_MANIFEST: ${{ needs.goreleaser-windows.outputs.windows_manifest }}
1317+
IMAGES_MANIFEST: ${{ needs.goreleaser-docker.outputs.images_manifest }}
1318+
run: |
1319+
mkdir -p _output
1320+
go run ./cmd/merge-manifests \
1321+
-binaries-manifest "${BINARIES_MANIFEST:-{}}" \
1322+
-windows-manifest "${WINDOWS_MANIFEST:-}" \
1323+
-images-manifest "${IMAGES_MANIFEST:-}" \
1324+
| tee _output/manifest.json
1325+
12221326
- name: Record release via registry API
12231327
if: steps.registry-oidc.outcome == 'success'
1224-
continue-on-error: true
12251328
working-directory: _workflows
12261329
env:
12271330
REGISTRY_API_TOKEN: ${{ steps.registry-oidc.outputs.token }}
@@ -1260,76 +1363,6 @@ jobs:
12601363
$CONFIG_SCHEMA_FLAG \
12611364
$CAPABILITIES_FLAG
12621365
1263-
record-lambda-registry:
1264-
if: inputs.lambda == true
1265-
# Legacy per-connector Lambda invocation — records to connectorreleases DynamoDB.
1266-
# Only needs binaries + docker (container images). Does not gate on windows/msi since
1267-
# the Lambda pipeline only cares about container images. Will be removed after cutover
1268-
# to the registry API (record-connector-registry replaces this path).
1269-
needs: [goreleaser-binaries, goreleaser-docker]
1270-
permissions:
1271-
id-token: write
1272-
contents: read
1273-
runs-on: ubuntu-latest
1274-
steps:
1275-
- name: Configure AWS credentials via OIDC
1276-
uses: aws-actions/configure-aws-credentials@v5
1277-
with:
1278-
role-to-assume: "arn:aws:iam::168442440833:role/GitHubActionsECRPushRole-${{ github.event.repository.name }}"
1279-
aws-region: us-west-2
1280-
1281-
- name: Invoke Lambda with retries
1282-
run: |
1283-
set +e # Disable default fail-fast to support retries
1284-
if [[ "$ACTIONS_STEP_DEBUG" == "true" ]]; then
1285-
set -x # Debug logging
1286-
fi
1287-
1288-
TMPFILE=$(mktemp)
1289-
MAX_RETRIES=5
1290-
RETRY_DELAY=10 # seconds
1291-
1292-
for ((i=1; i<=MAX_RETRIES; i++)); do
1293-
echo "Attempt $i to invoke Lambda..."
1294-
1295-
RESPONSE=$(aws lambda invoke \
1296-
--function-name "${{ github.event.repository.name }}-releases" \
1297-
--payload "{\"tag\":\"${{ inputs.tag }}\"}" \
1298-
--cli-binary-format raw-in-base64-out \
1299-
"$TMPFILE" 2>&1)
1300-
EXIT_CODE=$?
1301-
1302-
echo "AWS CLI exited with code: $EXIT_CODE"
1303-
cat "$TMPFILE"
1304-
1305-
STATUS_CODE=$(jq -r '.statusCode' < "$TMPFILE" 2>/dev/null)
1306-
1307-
if [[ $EXIT_CODE -eq 0 && "$STATUS_CODE" == "200" ]]; then
1308-
echo "Lambda invoked successfully."
1309-
break
1310-
1311-
elif [[ "$RESPONSE" == *"CodeArtifactUserPendingException"* ]]; then
1312-
echo "Lambda not ready (CodeArtifactUserPendingException)."
1313-
1314-
if [[ $i -lt $MAX_RETRIES ]]; then
1315-
WAIT_TIME=$((i * RETRY_DELAY))
1316-
echo "Retrying in $WAIT_TIME seconds..."
1317-
sleep "$WAIT_TIME"
1318-
else
1319-
echo "Lambda still not ready after $MAX_RETRIES attempts."
1320-
rm -f "$TMPFILE"
1321-
exit 1
1322-
fi
1323-
1324-
else
1325-
echo "Lambda invoke failed with unexpected error: $RESPONSE"
1326-
rm -f "$TMPFILE"
1327-
exit 1
1328-
fi
1329-
done
1330-
1331-
rm -f "$TMPFILE"
1332-
13331366
verify-release:
13341367
# Verify release artifacts and attestations after publishing
13351368
# This job is not blocking - failures trigger Datadog notification but don't fail the release
@@ -1376,6 +1409,7 @@ jobs:
13761409
goreleaser-docker,
13771410
record-connector-registry,
13781411
record-lambda-registry,
1412+
record-registry-api,
13791413
verify-release,
13801414
]
13811415
if: failure()

0 commit comments

Comments
 (0)