Skip to content

Add CI for api surface area review verification #6099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented May 13, 2025

Motivation and Context

Add CI for api surface area review verification. It detects protected/public api changes by checking the code and exclude files in "internal", "codegen" or "test" folders. If there is protected/public api change, it requires no-api-surface-area-change or api-surface-area-approved-by-team label to be added

@zoewangg zoewangg force-pushed the zoewang/api-surface-area-review branch 23 times, most recently from 1714777 to bb5a4ce Compare May 13, 2025 22:53
@zoewangg zoewangg added no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team and removed no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required labels May 13, 2025
@zoewangg zoewangg force-pushed the zoewang/api-surface-area-review branch from a9ad817 to d824400 Compare May 13, 2025 23:41
@zoewangg zoewangg added changelog-not-required Indicate changelog entry is not required for a specific PR and removed api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team labels May 13, 2025
@zoewangg zoewangg marked this pull request as ready for review May 13, 2025 23:42
@zoewangg zoewangg requested a review from a team as a code owner May 13, 2025 23:42
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-api-surface-area-change') }}
run: |
git fetch origin ${{ github.base_ref }} --depth 1
FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(internal|test|codegen|v2-migration)/" || true)
Copy link
Contributor

@joviegas joviegas May 14, 2025

Choose a reason for hiding this comment

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

Nice CI action +1
I had below suggestions

  1. Would it be possible to narrow down the checks to only files containing SdkPublicInterface and SdkProtectedInterface annotations that way wee need not worry of skipping/adding the directories?
  2. Could we enhance the output to include the specific file names that failed the check?
  3. Would it be possible to add a tag to the PR using github.rest.issues.addLabels ? This way we can mark it as 'api-surface-area-review-required'

Copy link
Contributor Author

@zoewangg zoewangg May 15, 2025

Choose a reason for hiding this comment

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

  1. It's just more complexity and maintenance to inspect the exact diff for each file and may increase the check time. IMO we really shouldn't expand on internal|test|codegen|v2-migration since this repo is already huge, so I'm not sure if the effort it worth it.
  2. Yes, it is in the output.https://github.com/aws/aws-sdk-java-v2/pull/6099/files#diff-03e23d2b8990386383cd6d9efa82ad2dd53af6d72b4f33a6be1d0932442b71c1R21
  3. I actually thought about it and tried with the GH labeler action, I didn't go with that because it's a bit trickier to flag false positives since we want it to always automatically add api-surface-area-review-required (it's not straightforward to tell it to not re-add the label for new revision if the label was removed previously) and having both api-surface-area-review-required and no-api-surface-area-change is a bit confusing

@zoewangg zoewangg enabled auto-merge May 15, 2025 19:45
Copy link

@zoewangg zoewangg added this pull request to the merge queue May 15, 2025
Merged via the queue into master with commit 890899f May 15, 2025
22 checks passed
@zoewangg zoewangg deleted the zoewang/api-surface-area-review branch May 20, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-not-required Indicate changelog entry is not required for a specific PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants