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

fix(cdk): fix a bug with CodePipelineSource to create nested repositories #27668

Closed
wants to merge 5 commits into from

Conversation

anshikam
Copy link
Contributor

Closes #27504.


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 bug This issue is a bug. effort/small Small work item – less than a day of effort p1 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Oct 24, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team October 24, 2023 21:05
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@scanlonp
Copy link
Contributor

@anshikam, good addition. This will require an integ test. Other than that it looks good!

@scanlonp scanlonp self-assigned this Oct 24, 2023
@anshikam
Copy link
Contributor Author

Thanks @scanlonp for reviewing this :) I can try adding that based on guidance provided in https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#integration-tests.

@scanlonp
Copy link
Contributor

@anshikam you can look here too https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md. I also recently added an example using a pipelines test, so that is (hopefully) doubly helpful!

Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Other than the integ test, I think we actually need a bit more.

We will need a change to the readme with an example of using a nested repository.
We will need a separate validation function with more descriptive error messages and that catches edge cases.
We will need a test of the validation function with allowed and non-allowed strings.

Each of these should be fairly minor. Thanks!

Comment on lines +259 to 260
if (Token.isUnresolved(repoString) || parts.length < 2) {
throw new Error(`GitHub repository name should be a resolved string like '<owner>/<repo>', got '${repoString}'`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets move this validation into a function. It should cover the edge case of a string such as 'owner/group1//repo' and give a specific error message.

Comment on lines +428 to 429
if (Token.isUnresolved(repoString) || parts.length < 2) {
throw new Error(`CodeStar repository name should be a resolved string like '<owner>/<repo>', got '${repoString}'`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here.

Copy link

@davemeech davemeech Oct 30, 2023

Choose a reason for hiding this comment

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

We might also consider changing the verbiage in the error message regarding the expected resolved string format. As an example, the same repository name field in the console expresses the format as group/subgroup/project.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@jgilewski-siili
Copy link

Hi! What is the status of this PR?

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@scanlonp
Copy link
Contributor

@jgilewski-siili looks like the review comments need to be addressed. If you would like to pick it up, go for it!

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Nov 25, 2023
@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

@anshikam
Copy link
Contributor Author

I got sidetracked with other work. @jgilewski-siili feel free to take up if you have bandwidth

@jgilewski-siili
Copy link

@anshikam Yap, the bandwidth is the problem. I will probably have some time in the next week.

@tim-finnigan
Copy link

@jgilewski-siili is this something you have looked into revisiting?

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 bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pipelines: unable to reference GitLab repositories nested under a group with CodePipelieneSource.connection
6 participants