-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
tools/@aws-cdk/prlint/lint.ts
Outdated
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.`); | ||
} | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, added it.
Mentioning #22175 here due to the output |
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). |
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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*
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