-
Notifications
You must be signed in to change notification settings - Fork 4k
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(codepipeline-actions): use IBaseService instead of BaseService in EcsDeployActionProps #6412
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…-> fromFargateServiceAttributes
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR got the below errors.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
See this comment on how to achieve this. You need to remove all of your breaking changes, these are stables modules, so no breaking changes are allowed. There is already a PR attempting these changes: #6203 , but it's not building ATM, and there's hasn't been much activity on it lately. |
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.
See: #6412 (comment)
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
/** | ||
* The name of the cluster that hosts the service. | ||
*/ | ||
readonly clusterName: string; |
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.
This needs to be ICluster
. Not clusterName
.
/** | ||
* The service ARN. | ||
*/ | ||
readonly serviceArn: string; |
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.
There should also be serviceName
, and one of serviceArn
or serviceName
is required.
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.
I added validation to prevent from setting both or neither. If both are set, it may be confusing.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
I will add |
No. I don't want to make this function a part of the public contract of the ECS module. Do this instead: // file: from-service-attributes.ts
export interface ServiceAttributes {
// serviceName, serviceArn, cluster
...
}
export function fromServiceAtrributes(scope: Construct, id: string, attributes: ServiceAttributes): IBaseService {
...
} Then call this function from |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@skinny85 please review again. Thanks |
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.
Thanks @atsushi-ishibashi , looking good! We're almost there. Just a few last comments before I'm comfortable shipping this.
import * as codepipeline from '@aws-cdk/aws-codepipeline'; | ||
import { FakeSourceAction } from '@aws-cdk/aws-codepipeline/test/fake-source-action'; |
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.
Please just use one of the source actions from this package. FakeSourceAction
is private to the @aws-codepipeline
package.
}); | ||
const artifact = new codepipeline.Artifact('Artifact'); | ||
|
||
test.doesNotThrow(() => { |
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.
Remove the test.doesNotThrow()
, it's redundant.
const stack = new cdk.Stack(); | ||
const service = ecs.FargateService.fromFargateServiceAttributes(stack, 'FargateService', { | ||
serviceName: 'my-http-service', | ||
cluster: new ecs.Cluster(stack, 'Cluster', { |
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.
Import the cluster with a well-known name as well.
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.
You mean like this?
const service = ecs.FargateService.fromFargateServiceAttributes(stack, 'FargateService', {
serviceName: 'service-name',
cluster: new ecs.Cluster(stack, 'Cluster', {
clusterName: 'cluster-name',
}),
});
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.
I meant more Cluster.fromClusterAttributes()
, but this should work as well (I want a specific name in the test assertion, not a CFN Ref
expression).
Name: 'Source', | ||
ActionTypeId: { | ||
Category: "Source", | ||
Provider: "Fake" |
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.
No reason for these assertions here, just leave it as:
Stages: [
{},
{
"Name": "Deploy",
"Actions": [
{
// ...
}
],
}
]
/** | ||
* The service ARN. | ||
* | ||
* @default - generated from serviceName |
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.
This comment is wrong (should be "either this, or {@link serviceName}, is required").
/** | ||
* The name of the service. | ||
* | ||
* @default - generated from serviceArn |
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.
This comment is wrong (should be "either this, or {@link serviceArn}, is required").
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.
Is @default - {@link serviceArn}, is required
what you want?
Optional property must have @default documentation.
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.
I want:
/**
* The name of the imported service.
*
* @default - either this, or {@link serviceArn}, is required
*/
readonly serviceName?: string;
/** | ||
* The service ARN. | ||
* | ||
* @default - generated from serviceName |
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.
This comment is wrong (should be "either this, or {@link serviceName}, is required").
/** | ||
* The name of the service. | ||
* | ||
* @default - generated from serviceArn |
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.
This comment is wrong (should be "either this, or {@link serviceArn}, is required").
/** | ||
* The service ARN. | ||
* | ||
* @default - generated from serviceName |
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.
This comment is wrong (should be "either this, or {@link serviceName}, is required").
/** | ||
* The name of the service. | ||
* | ||
* @default - generated from serviceArn |
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.
This comment is wrong (should be "either this, or {@link serviceArn}, is required").
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Ready for review👍 @skinny85 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@skinny85 I'd like you to include this PR in the next release:bow: In out product, we're constructing CD pipeline refering existing ECS services. So this feature is important to proceed it. |
@skinny85 really appreciate if you could merge this fix to next release of CDK (if it has solved the blocking issue). I have to carry forward my blocked pipeline ticket for the third sprint now. I was criticized during last sprint retro for picking CDK for this project :). I will be more careful next time when picking new AWS frameworks for my work place projects ... |
Hey all, sorry, I was out on vacation the last week and a half. Will review soon. Thanks, |
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.
Thanks for your patience @atsushi-ishibashi !
Thank you for contributing! Your pull request will be updated from master 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 |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
refer: #6408
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license