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." diff --git a/clients/aws-sdk-bedrock-runtime/.changes/next-release/testing.json b/clients/aws-sdk-bedrock-runtime/.changes/next-release/testing.json new file mode 100644 index 0000000..c44ee7f --- /dev/null +++ b/clients/aws-sdk-bedrock-runtime/.changes/next-release/testing.json @@ -0,0 +1,4 @@ +{ + "type": "dependency", + "description": "this is a test" +} diff --git a/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing.json b/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing.json new file mode 100644 index 0000000..988ef23 --- /dev/null +++ b/clients/aws-sdk-transcribe-streaming/.changes/next-release/testing.json @@ -0,0 +1,4 @@ +{ + "type": "bugfix", + "description": "this is a test" +} diff --git a/codegen/aws-models/bedrock-runtime.json b/codegen/aws-models/bedrock-runtime.json index fc1ac68..28cd5fe 100644 --- a/codegen/aws-models/bedrock-runtime.json +++ b/codegen/aws-models/bedrock-runtime.json @@ -77,7 +77,7 @@ "aws.auth#sigv4", "smithy.api#httpBearerAuth" ], - "smithy.api#documentation": "

Describes the API operations for running inference using Amazon Bedrock models.

", + "smithy.api#documentation": "

testing Describes the API operations for running inference using Amazon Bedrock models.

", "smithy.api#httpBearerAuth": {}, "smithy.api#title": "Amazon Bedrock Runtime", "smithy.rules#endpointRuleSet": { @@ -7382,4 +7382,4 @@ } } } -} \ No newline at end of file +} diff --git a/codegen/aws-models/transcribe-streaming.json b/codegen/aws-models/transcribe-streaming.json index b5e6ff0..ac419ad 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": "

testing 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": {