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): add pagination to listFiles in PR #22555

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Conversation

cplee
Copy link
Contributor

@cplee cplee commented Oct 19, 2022

Currently, the prlint tool lists the files on a PR to enforce new integration tests are created for feat changes. The tool is not using pagination for list files and is using the default of 30 files per page. This means a PR could be incorrectly flagged for missing integration tests if the test files occur after the first 30 files in the PR.

Example of this can be seen in #22455

This PR enables pagination on the listFiles call to ensure the validation rules are looking at all files in the PR, not just the first 30.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Oct 19, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 19, 2022 06:35
@gitpod-io
Copy link

gitpod-io bot commented Oct 19, 2022

@cplee cplee marked this pull request as ready for review October 19, 2022 06:38
@Naumel
Copy link
Contributor

Naumel commented Oct 19, 2022

Hi, thank you for taking the time to make and submit the change.

While it looks good, seems that it has side-effects:

@aws-cdk/aws-ec2: Snapshot Results: 
@aws-cdk/aws-ec2: Tests:    1 failed, 24 total
@aws-cdk/aws-ec2: Error: Some tests failed!

Mind checking what that failing build is all about?

Look at that, a merge solved it!

@Naumel
Copy link
Contributor

Naumel commented Oct 19, 2022

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Oct 19, 2022

update

✅ Branch has been successfully updated

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@Naumel Naumel self-requested a review October 19, 2022 13:10
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.

🐙

@@ -275,7 +275,7 @@ export class PullRequestLinter {
const pr = (await this.client.pulls.get(this.prParams)).data;

console.log(`⌛ Fetching files for PR number ${number}`);
const files = (await this.client.pulls.listFiles(this.prParams)).data;
const files = await this.client.paginate(this.client.pulls.listFiles, this.prParams);
Copy link
Contributor

Choose a reason for hiding this comment

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

@mergify
Copy link
Contributor

mergify bot commented Oct 19, 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 914185b into aws:main Oct 19, 2022
mrgrain pushed a commit to mrgrain/aws-cdk that referenced this pull request Oct 24, 2022
Currently, the `prlint` tool lists the files on a PR to enforce new integration tests are created for `feat` changes. The tool is not using pagination for list files and is using the default of `30` files per page. This means a PR could be incorrectly flagged for missing integration tests if the test files occur after the first 30 files in the PR.

Example of this can be seen in aws#22455 

This PR enables pagination on the `listFiles` call to ensure the validation rules are looking at all files in the PR, not just the first 30.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*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
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants