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(linter): require a test label for CLI changes #22187

Merged
merged 5 commits into from
Sep 22, 2022
Merged

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Sep 22, 2022

Require a label a human must add for PRs that change CLI code. The linter will give instructions on how to push the code to the right pipeline branch.

Also add strong typing to the linter, there were a couple of bugs in there because of the anys.


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

Require a label a human must add for PRs that change CLI code. The
linter will give instructions on how to push the code to the right
pipeline branch.

Also add strong typing to the linter, there were a couple of bugs
in there because of the `any`s.
@rix0rrr rix0rrr requested a review from a team September 22, 2022 09:48
@rix0rrr rix0rrr self-assigned this Sep 22, 2022
@gitpod-io
Copy link

gitpod-io bot commented Sep 22, 2022

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 22, 2022
@github-actions github-actions bot added the p2 label Sep 22, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team September 22, 2022 09:48
Copy link
Contributor

@Naumel Naumel left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 385 to 394
function noCliChanges(pr: GitHubPr, files: GitHubFile[]): TestResult {
const branch = `pull/${pr.number}/head`;

const cliCodeChanged = files.some(f => f.filename.toLowerCase().includes('/packages/aws-cdk/lib/') && f.filename.endsWith('.ts'));

return TestResult.fromFailure(
cliCodeChanged,
`CLI code has changed. A maintainer must run the code through the testing pipeline (git fetch origin ${branch} && git push -f origin FETCH_HEAD:test-main-pipeline), then add the '${Exemption.CLI_INTEG_TESTED}' label when the pipeline succeeds.`);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

A test would be swell

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, added it.

@Naumel
Copy link
Contributor

Naumel commented Sep 22, 2022

Mentioning #22175 here due to the output

@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2022

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

@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2022

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

@mergify mergify bot merged commit 4ad4567 into main Sep 22, 2022
@mergify mergify bot deleted the huijbers/linter-cli branch September 22, 2022 11:39
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 60c0234
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

homakk pushed a commit to homakk/aws-cdk that referenced this pull request Dec 1, 2022
Require a label a human must add for PRs that change CLI code. The linter will give instructions on how to push the code to the right pipeline branch.

Also add strong typing to the linter, there were a couple of bugs in there because of the `any`s.

----

*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. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants