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(prlint): ban 'breaking changes' clause on stable modules #14861

Merged
merged 14 commits into from
May 28, 2021

Conversation

nija-at
Copy link
Contributor

@nija-at nija-at commented May 25, 2021

The scripts/check-api-compatibility.sh script prevents breaking API
changes in stable CDK modules.
However, this does not prevent functional breaking changes. It is
infeasible to actually detect and prevent this.

The CDK must be more strict on preventing such changes and the impact
due to their perception.

A linter error when a 'BREAKING CHANGE' clause for a stable module is
encountered in the PR is a good way to communicate this information.


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

@nija-at nija-at self-assigned this May 25, 2021
@gitpod-io
Copy link

gitpod-io bot commented May 25, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label May 25, 2021
@nija-at nija-at requested a review from a team May 25, 2021 12:35
@nija-at nija-at changed the title chore(prlint): ban 'breaking changes' clause for stable modules chore(prlint): ban 'breaking changes' clause on stable modules May 25, 2021
@nija-at
Copy link
Contributor Author

nija-at commented May 25, 2021

Testing

@nija-at nija-at marked this pull request as ready for review May 25, 2021 13:59
Copy link
Contributor

@NetaNir NetaNir left a comment

Choose a reason for hiding this comment

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

Great addition, nice test coverage.

There is one issue that requires attention - using the relative path (see inline comment), the rest are suggestions.

tools/prlint/parser.ts Outdated Show resolved Hide resolved
tools/prlint/parser.ts Outdated Show resolved Hide resolved
tools/prlint/module.ts Outdated Show resolved Hide resolved
tools/prlint/module.ts Outdated Show resolved Hide resolved
@nija-at nija-at requested review from NetaNir and a team May 26, 2021 09:07
tools/prlint/lint.ts Outdated Show resolved Hide resolved
tools/prlint/lint.ts Outdated Show resolved Hide resolved
tools/prlint/module.ts Outdated Show resolved Hide resolved
tools/prlint/decs.d.ts Show resolved Hide resolved
const modules: string[] = [];

export function findModulePath(fuzz: string): string {
if (modules.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we extract this findAllModules into a separate function that will be called once (outside of the map) in assertStability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? It's run once now, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

Simply for code cleanliness and avoiding a global variable

tools/prlint/module.ts Outdated Show resolved Hide resolved
tools/prlint/test/lint.test.ts Outdated Show resolved Hide resolved
tools/prlint/test/lint.test.ts Outdated Show resolved Hide resolved
tools/prlint/test/module.test.ts Outdated Show resolved Hide resolved
@nija-at nija-at requested review from a team and BenChaimberg May 27, 2021 14:19
@nija-at nija-at force-pushed the nija-at/ban-breaking-changes branch from b7f3a9c to 89f1649 Compare May 28, 2021 09:28

function discoverModules() {
if (modules.length === 0) {
if (!process.env.REPO_ROOT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally don't see why we couldn't just default to CWD, but I'm fine with this.

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 will still need some way to configure this for unit tests.

@mergify
Copy link
Contributor

mergify bot commented May 28, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@nija-at nija-at enabled auto-merge (squash) May 28, 2021 12:27
@nija-at nija-at merged commit b5596c7 into master May 28, 2021
@nija-at nija-at deleted the nija-at/ban-breaking-changes branch May 28, 2021 12:52
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 19d188c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…4861)

The `scripts/check-api-compatibility.sh` script prevents breaking API
changes in stable CDK modules.
However, this does not prevent functional breaking changes. It is
infeasible to actually detect and prevent this.

The CDK must be more strict on preventing such changes and the impact
due to their perception.

A linter error when a 'BREAKING CHANGE' clause for a stable module is
encountered in the PR is a good way to communicate this information.
mergify bot pushed a commit that referenced this pull request Dec 21, 2021
…18102)

This PR introduces a proposed new label, `pr-linter/exempt-breaking-change` that, when added, circumvents the check that asserts stable modules do not have breaking changes. 

Motivation: A situation like #18027 where we have are willing to accept a functional breaking change to a stable module. The regular `allowed-breaking-changes.txt` file does not work here, since there is no breaking change to the API. We want to be able to document the breaking change, but by documenting we alert `prlint` that we are breaking a stable module.

Counterargument: Functional breaking changes were explicitly banned in #14861. From the PR description: "The CDK must be more strict on preventing such changes and the impact due to their perception."

I also added some "manual linting" to the file myself since it was bothering me, and now it muddies the diff. Sorry!

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…ws#18102)

This PR introduces a proposed new label, `pr-linter/exempt-breaking-change` that, when added, circumvents the check that asserts stable modules do not have breaking changes. 

Motivation: A situation like aws#18027 where we have are willing to accept a functional breaking change to a stable module. The regular `allowed-breaking-changes.txt` file does not work here, since there is no breaking change to the API. We want to be able to document the breaking change, but by documenting we alert `prlint` that we are breaking a stable module.

Counterargument: Functional breaking changes were explicitly banned in aws#14861. From the PR description: "The CDK must be more strict on preventing such changes and the impact due to their perception."

I also added some "manual linting" to the file myself since it was bothering me, and now it muddies the diff. Sorry!

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants