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

aws-cdk-lib/pipelines: CodePipelineSource.github documentation evokes questions #23237

Open
papiro opened this issue Dec 6, 2022 · 4 comments
Labels
@aws-cdk/pipelines CDK Pipelines library documentation This is a problem with documentation. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p3

Comments

@papiro
Copy link

papiro commented Dec 6, 2022

Describe the issue

CodePipelineSource.gitHub says "This is no longer the recommended method." but why not?

I tracked down the comment in question to this PR and specifically to this commit.

The odd thing is that the comment was added with the wording as such at the time the feature was being added. But the wording seems to imply that at one point the method was the recommended method, but the method didn't exist before the PR which introduced both it and the comment.

I am wondering why it wouldn't be a good idea to use this method, seeing as I am already using the GitHubSourceAction in one of my stacks and it is using the owner/repo/branch with the oauthToken as a SecretValue?

Links

https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/pipelines/lib/codepipeline/codepipeline-source.ts#L24

@papiro papiro added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Dec 6, 2022
@papiro papiro changed the title (module name): (short issue description) aws-cdk-lib/pipelines: CodePipelineSource.github documentation evokes questions Dec 6, 2022
@peterwoodworth
Copy link
Contributor

This is a recommendation from CodePipeline - see this page for more info. We should expand upon this in our own docs, so thank you for bringing this up 🙂

@peterwoodworth peterwoodworth added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 6, 2022
@papiro
Copy link
Author

papiro commented Dec 7, 2022

Hmmm, haven't seen this before! In my app, I am using CDK version 2 and I have this import:

import { GitHubSourceAction } from "aws-cdk-lib/aws-codepipeline-actions";

But that construct has owner, branch, etc as required properties. Where is the construct which is mentioned in the docs above? I see that the "version 2" of the GithubSourceAction is actually the CodeStarConnectionsSourceAction. Is that correct? It seems odd to call the first "version 1" and the second "version 2".

Edit: Also I wonder if the recommendation might not be as strong now that Github has fine-grained personal access tokens?

Edit: After digging into this, it looks like in order to create a CodeStarConnection, you are forced to create a CodeStarProject. If this is the case then I don't see how the connection can be the preferred method to connect to an existing github repo, like in the case of a bespoke code pipeline or cdk pipeline. Creation of the CodeStarProject ends up creating a repo for you, from what I can tell, which is too heavy-handed of a solution.

@peterwoodworth
Copy link
Contributor

Yes, CodePipeline's v1 matches with GithubSourceAction while v2 matches with CodeStarConnectionsSourceAction. This is CodePipeline's way of referring to these functionalities, I don't know if I agree with it either

You shouldn't be forced to create a project. You should be able to go to the codesuite console (CodeBuild, CodePipeline, etc) and go to settings -> connections to create a connection without any other setup other than what's necessary to link AWS with GitHub

Screen Shot 2022-12-07 at 1 44 28 PM

@papiro
Copy link
Author

papiro commented Dec 8, 2022

oh jeez... definitely never noticed that before! Sorry about the fuss above. I was quite confused.

@mrgrain mrgrain added the good first issue Related to contributions. See CONTRIBUTING.md label Feb 15, 2023
@peterwoodworth peterwoodworth added the feature-request A feature should be added or improved. label May 2, 2023
@peterwoodworth peterwoodworth removed their assignment Oct 16, 2023
@pahud pahud added p3 and removed p2 labels Jun 11, 2024
@moelasmar moelasmar added the @aws-cdk/pipelines CDK Pipelines library label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library documentation This is a problem with documentation. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p3
Projects
None yet
Development

No branches or pull requests

5 participants