-
Notifications
You must be signed in to change notification settings - Fork 249
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(cdk-v2): Adding build scripts for CDK v2 #353
Conversation
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 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
// 1 - align the version in a package.json file to the version of the repo | ||
// 2 - Remove all entries starting with @aws-cdk/* and constructs from "dependencies": { ... } | ||
// 3 - Remove all entries starting with @aws-cdk/* and constructs from "peerDependencies": { ... }, Add { "aws-cdk-lib": "^2.0.0-rc.1", "constructs": "^10.0.0" } | ||
// 4 - Add { "aws-cdk-lib": "2.0.0-rc.1", "constructs": "^10.0.0" } to "devDependencies" |
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.
If someone runs v2/align-version, is there any way to go back to v1?
Seems like v1/align-version needs to reset things back to v1 - if someone screws up and checks in files already set to v2 there's going to be problems down the line if v1 doesn't reset it.
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.
Steps to go back to v1 is
1 - reset v2/align deployment/v2/align-version.sh revert
2 - set v1/align deployment/align-version.sh
function processPeerDependencies(section, file) { | ||
let newdependencies = {}; | ||
for (const [ name, version ] of Object.entries(section)) { | ||
// Remove all entries starting with @aws-cdk/* and constructs |
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.
hmmm - seeing what you're doing here makes it look like going backwards is not possible, there's no way to determine what aws-cdk module dependencies need to be included.
Are we relying on revert to undo all this?
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.
Yes, reverting back the files from git is how you can go back to v1 codebase
deployment/v2/build-patterns.sh
Outdated
|
||
echo "=============================================================================================" | ||
echo "reverting back TypeScript import statements for CDK v2..." | ||
git checkout `find . -name *.ts | grep -v node_modules | grep -v **/*.d.ts` |
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.
What's going on here - looks like we're refreshing the node_modules folder similar to npm install?
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.
Reverting back the *.ts file from Git which will essentially revert back the rewritten import statements
mv CHANGELOG.v2.md CHANGELOG.md | ||
|
||
# Rename lerna.json | ||
echo "Rename source/lerna.json to source/lerna.json.bak" |
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'm concerned that v1 is unchanged through all this, it leaves us open to making more changes when v2 becomes the standard build in 3 months. It would be better if both the v1 and v2 versions made the changes required to work.
eg - rather than the two changelog files being:
changelog.v2.md
changelog.md
and v1 gets pushed aside during rebuild, they should be
changelog.v2.md
changelog.v1.md
and the correct one gets put in place for a build. Similar with lerna.json. There is no changelog.md stored in the repo. Right now we're telling everyone that solutions constructs IS v1, but in 3 months that will change to v2.
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'm not following here, if the concern is to rename the existing changelog.md to changelog.v1.md and lerna.json to lerna.v1.json that's doable, is it more than that?
@@ -0,0 +1,201 @@ | |||
Apache License |
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.
Are we duplicating the cdk migration tool here?
Why would we do this?
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.
Unfortunately yes, for the same reason as cdk-integ-tools, it needed to be modified to handle special case of rewriting the import statments for IConstruct
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 |
Issue #, if available: 348
Description of changes:
Adding build scripts for CDK v2 build