From e1344b08b97029600829191bf1822caa0947508e Mon Sep 17 00:00:00 2001 From: jonathan343 Date: Mon, 5 Jan 2026 18:30:36 -0600 Subject: [PATCH 1/4] Add workflow to ensure changelog entries are added when manually updating AWS models. --- .github/workflows/api-changelog-check.yml | 67 +++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/api-changelog-check.yml diff --git a/.github/workflows/api-changelog-check.yml b/.github/workflows/api-changelog-check.yml new file mode 100644 index 0000000..6d1ea1c --- /dev/null +++ b/.github/workflows/api-changelog-check.yml @@ -0,0 +1,67 @@ +name: API Changelog Check + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + paths: + - 'codegen/aws-models/**' + +permissions: + contents: read + +jobs: + check-changelog: + runs-on: ubuntu-latest + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} + steps: + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + with: + fetch-depth: 0 + + - name: Get changed model files + id: changed-models + run: | + changed_models=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) + echo "models<> $GITHUB_OUTPUT + echo "$changed_models" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Check for changelog entries + run: | + missing_changelogs="" + + while IFS= read -r service; do + [ -z "$service" ] && continue + + changelog_dir="clients/aws-sdk-${service}/.changes/next-release" + + if [ ! -d "$changelog_dir" ]; then + missing_changelogs="${missing_changelogs}\n - ${service} (directory does not exist: ${changelog_dir})" + continue + fi + + # Check for valid changelog JSON files with required fields + valid_entry_found=false + for file in "$changelog_dir"/*.json; do + [ -e "$file" ] || continue + if jq -e '.type == "api-change" and .description' "$file" > /dev/null 2>&1; then + valid_entry_found=true + break + fi + done + + if [ "$valid_entry_found" = false ]; then + missing_changelogs="${missing_changelogs}\n - ${service} (no valid changelog entry in ${changelog_dir})" + fi + done <<< "${{ steps.changed-models.outputs.models }}" + + if [ -n "$missing_changelogs" ]; then + printf "::error::Missing changelog entries for the following services:%b\n" "$missing_changelogs" + echo "" + echo "Please add a changelog entry in clients/aws-sdk-/.changes/next-release/ for each modified model." + echo "Entry must be a JSON file with 'type: \"api-change\"' and 'description' fields." + exit 1 + fi + + echo "All modified models have corresponding changelog entries." From 2b9515d3df10b17b8ccf18197500d3292d488d36 Mon Sep 17 00:00:00 2001 From: jonathan343 Date: Sat, 10 Jan 2026 23:12:35 -0500 Subject: [PATCH 2/4] Apply zizmor fixes --- .github/workflows/api-changelog-check.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/api-changelog-check.yml b/.github/workflows/api-changelog-check.yml index 6d1ea1c..a1482b3 100644 --- a/.github/workflows/api-changelog-check.yml +++ b/.github/workflows/api-changelog-check.yml @@ -18,11 +18,12 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: fetch-depth: 0 + persist-credentials: false - name: Get changed model files id: changed-models run: | - changed_models=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) + changed_models=$(git diff --name-only origin/${GITHUB_BASE_REF}...HEAD -- 'codegen/aws-models/*.json' | xargs -I {} basename {} .json) echo "models<> $GITHUB_OUTPUT echo "$changed_models" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -54,7 +55,7 @@ jobs: if [ "$valid_entry_found" = false ]; then missing_changelogs="${missing_changelogs}\n - ${service} (no valid changelog entry in ${changelog_dir})" fi - done <<< "${{ steps.changed-models.outputs.models }}" + done <<< "${STEPS_CHANGED_MODELS_OUTPUTS_MODELS}" if [ -n "$missing_changelogs" ]; then printf "::error::Missing changelog entries for the following services:%b\n" "$missing_changelogs" @@ -65,3 +66,5 @@ jobs: fi echo "All modified models have corresponding changelog entries." + env: + STEPS_CHANGED_MODELS_OUTPUTS_MODELS: ${{ steps.changed-models.outputs.models }} From cfcc7f21f79868d42ef6eed89e8f382a2eef6451 Mon Sep 17 00:00:00 2001 From: jonathan343 Date: Sat, 10 Jan 2026 23:15:20 -0500 Subject: [PATCH 3/4] test model change --- codegen/aws-models/transcribe-streaming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/aws-models/transcribe-streaming.json b/codegen/aws-models/transcribe-streaming.json index b5e6ff0..19b5aa2 100644 --- a/codegen/aws-models/transcribe-streaming.json +++ b/codegen/aws-models/transcribe-streaming.json @@ -52,7 +52,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of possible alternative transcriptions for the input audio. Each alternative may contain\n one or more of Items, Entities, or Transcript.

" + "smithy.api#documentation": "

This is a test. A list of possible alternative transcriptions for the input audio. Each alternative may contain\n one or more of Items, Entities, or Transcript.

" } }, "com.amazonaws.transcribestreaming#AlternativeList": { From 068e825a1a7cc364af3c20b61c988c89e043c0e8 Mon Sep 17 00:00:00 2001 From: jonathan343 Date: Sat, 10 Jan 2026 23:24:27 -0500 Subject: [PATCH 4/4] add test changelog entry --- .../.changes/next-release/testing123.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 clients/aws-sdk-transcribe-streaming/.changes/next-release/testing123.json diff --git a/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing123.json b/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing123.json new file mode 100644 index 0000000..2a36a76 --- /dev/null +++ b/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing123.json @@ -0,0 +1,4 @@ +{ + "type": "api-change", + "description": "This is a test entry." +}