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

feat(scheduler-targets): add CodePipeline as target for scheduler #27799

Merged
merged 23 commits into from
Dec 18, 2023

Conversation

daschaa
Copy link
Contributor

@daschaa daschaa commented Nov 1, 2023

Closes #27449


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 the star-contributor [Pilot] contributed between 25-49 PRs to the CDK label Nov 1, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team November 1, 2023 19:12
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Nov 1, 2023
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.

@daschaa daschaa changed the title feat(scheduler-targets-alpha): add CodePipeline as target for scheduler feat(scheduler-targets): add CodePipeline as target for scheduler Nov 4, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 4, 2023 07:45

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@daschaa daschaa marked this pull request as ready for review November 4, 2023 07:46
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 4, 2023
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! 💪
Just an adjustment on region and account values for imported pipelines.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 4, 2023
@daschaa
Copy link
Contributor Author

daschaa commented Nov 4, 2023

Thanks, looks good! 💪

Just an adjustment on region and account values for imported pipelines.

I have created an issue for that: #27816

@daschaa
Copy link
Contributor Author

daschaa commented Nov 5, 2023

@lpizzinidev Do you think I should "fix" the fromPipelineArn function in this PR or do this seperately in #27816 ?
The issue still under investigating, so i'm not sure if the implementation in fromPipelineArn is intended?

What are your thoughts on that?

@lpizzinidev
Copy link
Contributor

lpizzinidev commented Nov 5, 2023

@daschaa
I encountered the same problem while implementing #27837 for SnsPublish.

In my opinion, this is a bug on imported resources from ARNs, as you state in #27816 and, for the CodePipeline target, it should be fixed in this PR since it's directly related to the implementation.

However, it's also good to have an issue open to keep track of the "bug", as it does affect multiple resources and some discussion might be needed to get to an ideal and consistent solution.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

3 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the MERGE CONFLICTS 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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 6, 2023
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!
Just some tests following the last changes are required in my opinion.

Comment on lines +64 to +75
const stack = new cdk.Stack(new cdk.App(), 'Stack', {
env: {
region: 'eu-west-1',
account: '234567890123',
},
});

const pipeline = codepipeline.Pipeline.fromPipelineArn(stack, 'Pipeline',
'arn:aws:codepipeline:us-east-1:123456789012:MyPipeline');

expect(pipeline.env.region).toEqual('us-east-1');
expect(pipeline.env.account).toEqual('123456789012');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const stack = new cdk.Stack(new cdk.App(), 'Stack', {
env: {
region: 'eu-west-1',
account: '234567890123',
},
});
const pipeline = codepipeline.Pipeline.fromPipelineArn(stack, 'Pipeline',
'arn:aws:codepipeline:us-east-1:123456789012:MyPipeline');
expect(pipeline.env.region).toEqual('us-east-1');
expect(pipeline.env.account).toEqual('123456789012');
const stack = new cdk.Stack();
const pipeline = codepipeline.Pipeline.fromPipelineArn(stack, 'Pipeline',
'arn:aws:codepipeline:us-west-1:123456789012:MyPipeline');
expect(pipeline.env.region).toEqual('us-west-1');
expect(pipeline.env.account).toEqual('123456789012');

Let's keep it simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer adding the env to the stack explicitly, because it shows that the import really does not use the environment of the stack 🤔

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

5 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 16, 2023
kaizencc
kaizencc previously approved these changes Dec 18, 2023
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Thanks @daschaa

return new Import(scope, id);
return new Import(scope, id, {
environmentFromArn: pipelineArn,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a bug fix to codepipeline that we should have had in a long time ago lol

Copy link
Contributor

mergify bot commented Dec 18, 2023

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 18, 2023
Copy link
Contributor

mergify bot commented Dec 18, 2023

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 dismissed kaizencc’s stale review December 18, 2023 18:19

Pull request has been modified.

Copy link
Contributor

mergify bot commented Dec 18, 2023

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 8c44f32 into aws:main Dec 18, 2023
9 checks passed
Copy link
Contributor

mergify bot commented Dec 18, 2023

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).

@daschaa daschaa deleted the 27449_codepipeline branch May 7, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-scheduler-targets-alpha): Add targets.CodePipelineStartPipelineExecution Target
4 participants