Skip to content
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

chore: add @InternalApi to binary compatibility checks; introduce new PR check to verify no API-breaking changes #1030

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

ianbotsf
Copy link
Contributor

@ianbotsf ianbotsf commented Feb 5, 2024

Issue #

awslabs/aws-sdk-kotlin#1191

Description of changes

This change tightens backwards compatibility guarantees by:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… PR check to verify no API-breaking changes
@ianbotsf ianbotsf requested a review from a team as a code owner February 5, 2024 21:35
@ianbotsf ianbotsf added the acknowledge-api-break Acknowledge that a change is API breaking and may be backwards-incompatible. Review carefully! label Feb 5, 2024
@ianbotsf ianbotsf added no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. and removed acknowledge-api-break Acknowledge that a change is API breaking and may be backwards-incompatible. Review carefully! labels Feb 5, 2024

on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason to specify these types? Our other workflows look like they apply to all types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied the job definition from changelog-verification.yml which also explicitly specifies PR events. I think, in general, we could be more conservative in the subtypes of events which trigger action runs and reduce some of the churn/cost associated with them.

Do you have a reason to prefer running on all event subtypes?

Copy link
Contributor

Choose a reason for hiding this comment

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

No actually, I think the current types cover all the cases where this should run, so it's good to leave it as is. I just never saw these types specified (I did not look at the changelog-verification.yml job) and was curious

Copy link
Contributor

Choose a reason for hiding this comment

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

In practice for us these are likely about the same but it's fine as is, here is the full list for reference if you leave it unspecified and just have pull_request:

if: ${{ failure() }}
run: |
echo "::error ::This change modifies the public API in a way that may be backwards-incompatible. Carefully"
echo "::error ::review this pull request and either:"
Copy link
Contributor

Choose a reason for hiding this comment

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

style: It might be better to combine L29 and L30 because GitHub's CI output autowraps the text
(I think it looks good on one line)

Copy link

sonarcloud bot commented Feb 5, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@@ -116,8 +116,6 @@ configureLinting(lintPaths)

// Binary compatibility
apiValidation {
nonPublicMarkers.add("aws.smithy.kotlin.runtime.InternalApi")
Copy link
Contributor

Choose a reason for hiding this comment

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

In general I agree with this change but I am wondering about what we will do when we do need/want to break internal APIs. Presumably we'd deprecate the APIs and leave them in place for some period of time or perhaps indefinitely and switch codegen to use whatever the replacement is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline and decided largely on what @aajtodd suggested: if we need to deprecate an @InternalApi declaration, we'll mark the API as @Deprecated and leave it in place for some number of releases. It will be considered for (potentially-breaking) removal if it is determined to be actively harming something (e.g., security, critical bugs, etc.).

@ianbotsf ianbotsf merged commit 2e099f9 into main Feb 6, 2024
13 of 14 checks passed
@ianbotsf ianbotsf deleted the chore-tighten-api-compat branch February 6, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants