-
Notifications
You must be signed in to change notification settings - Fork 1
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: supprt cdktf ^0.20.x
#445
base: main
Are you sure you want to change the base?
Conversation
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 opposed to this change but I would like to understand exactly why things don't work without it. Can you share your project setup and the error you are seeing?
Naively, there's nothing preventing peers from using 0.20.7 even now.
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.2" | ||
}, | ||
"peerDependencies": { | ||
"cdk8s": "^2.68.11", | ||
"cdktf": "^0.19.1", |
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 shouldn't be required because the ^
means any minor version above 19 can be used by peers.
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.
@iliapolo I don't believe that is how it works. When a package version has a zero as the major version the caret will not increment the minor version, only the patch.
See this for an example:
Use cdktf and specify ^0.19.0 as the version. You'll see 0.20 package versions are not listed.
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.
@BrentSouza is correct. The notion of patch versions only getting bumped on dependencies below 1.0.0 is npm update docs: https://docs.npmjs.com/cli/v10/commands/npm-update#caret-dependencies-below-100
@@ -43,37 +43,37 @@ | |||
}, | |||
"devDependencies": { | |||
"@cdk8s/projen-common": "0.0.530", | |||
"@cdktf/provider-aws": "^17.0.11", |
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.
Hmm, is this required by [email protected]
?
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. The version constraint on the provider package is incompatible with 0.20.7 of the main cdktf package.
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.
CDKTF version 0.20.0 support was added to @cdktf/provider-aws starting @ v19.0.0 which released January 10, 2024. Commit Release
The package.json for the release included typescript ~5.2.0.
"cdktf-cli": "^0.20.7", | ||
"constructs": "^10.3.0", | ||
"eslint": "^8", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"fs-extra": "^11.2.0", | ||
"jest": "^27", |
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.
How come?
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.
Jest needs to be updated to fix the warning that it has not been tested for typescript 5. Also the conversation in the fix notes indicates that even though some later versions said it worked, it didn't.
"jest-junit": "^15", | ||
"jsii": "^5", | ||
"jsii-diff": "^1.100.0", | ||
"jsii-docgen": "^9.2.2", |
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.
How come?
"jsii-pacmak": "^1.100.0", | ||
"jsii-rosetta": "^5", | ||
"projen": "^0.82.8", | ||
"standard-version": "^9", | ||
"ts-jest": "^27", |
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.
How come?
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.
All of the above version changes came about because I get the following error running npm install
:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/typescript
npm error typescript@"^5.5.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer typescript@">=3.8 <5.0" from [email protected]
npm error node_modules/ts-jest
npm error ts-jest@"^27" from the root project
Hi @iliapolo, I should note I'm also using both cdktf and cdk8s in python, which is where the version constraint produces an error for my project.
Granted, the package still installs. I just would like to clear out the errors. |
For javascript/typescript, here is a basic project setup that will fail: {
"name": "test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@cdk8s/cdktf-resolver": "^0.0.89",
"cdk8s": "^2.68.82",
"cdktf": "^0.20.7"
}
} Running
|
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.
IMO this looks clean and would be appreciated :)
The general theme here is that terraform-cdk is in the v0.20.0 range right now and because of the way npm handles carrot dependencies below 1.0.0 the cdktf and related dependencies need updating.
Side note, the project here itself is always in patch numbers but it can use minor due to NPM's handling of below 1.0.0 carrots too. I think what is expected i.e. that each minor bump isn't compatible with the next in the "zero-dots" (0.X.Y) is expected which would open up the "opportunity" to patch previous versions if needed.
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.2" | ||
}, | ||
"peerDependencies": { | ||
"cdk8s": "^2.68.11", | ||
"cdktf": "^0.19.1", |
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.
@BrentSouza is correct. The notion of patch versions only getting bumped on dependencies below 1.0.0 is npm update docs: https://docs.npmjs.com/cli/v10/commands/npm-update#caret-dependencies-below-100
@@ -43,37 +43,37 @@ | |||
}, | |||
"devDependencies": { | |||
"@cdk8s/projen-common": "0.0.530", | |||
"@cdktf/provider-aws": "^17.0.11", |
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.
CDKTF version 0.20.0 support was added to @cdktf/provider-aws starting @ v19.0.0 which released January 10, 2024. Commit Release
The package.json for the release included typescript ~5.2.0.
"@types/fs-extra": "^11.0.4", | ||
"@types/jest": "^27", | ||
"@types/jest": "^29", |
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.
Jest added support for typescript 5.x starting with version 29.1.0 (ts-jest 20.1.0 CHANGELOG.md 2023-03-26)
"cdktf-cli": "^0.20.7", | ||
"constructs": "^10.3.0", | ||
"eslint": "^8", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"fs-extra": "^11.2.0", | ||
"jest": "^27", |
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.
Jest needs to be updated to fix the warning that it has not been tested for typescript 5. Also the conversation in the fix notes indicates that even though some later versions said it worked, it didn't.
@BrentSouza a maintenance release (v0.0.91) got pushed out. you might want a merge in main (or rebase) and yarn install to update the lock. cdk8s-team maintainersThe development dependencies between Having everyone understand that caret dependencies below 1.0.0 don't float I hope the cdk8s-team will take these PRs more readily as part of their workflow and consider adopting a package manager that fails when peer dependencies fail to sync. Additional commentsThe project utilizes yarn and if you tried to npm install the current tree it'll fail too. This difference in results is due to after npm 7 was released the behavior was changed regarding peer dependencies. Before npm would warn about the peer dependencies being incompatible (and this is what yarn does today). npm 7+, released early 2021, will now fail if the peer dependencies are incompatible (probably a good thing!). See npm 7 is now generally available! - peer-dependencies. In the meantime if you are using a modern npm, you could set the project to use legacy-peer-deps, via yarn seems to ignore people reporting "Unmet Peer Dependencies should fail build" regarding this issue and suggests that projects could use a log filter which pretty much ignores the fact that peer dependencies are part of the ecosystem now. I think this node blog, from 2013(!), Peer Dependencies summarizes the best approach:
Sadly this project is in the unstable phase so the advice is good but doesn't have as much flexibility as one might desire at this time. I hope this gets merged. |
@joekiller Yup I keep rebasing every few days since the automated patches keep introducing conflicts. I’ll push an update this morning. |
@iliapolo Any additional questions or concerns with the changes outlined in this PR? |
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.
LGTM!
I was away for a bit but I've rebased once again on the latest from main. @iliapolo please let me know if you need any further information or would like to see additional changes. |
Keeping the fire burning on this one 🔥 Just rebased once again. @iliapolo Hopefully things are well with you. Please let me know if there's anything else I can do for this PR |
I too hope Eli is doing well. In the meantime, could anyone else of the @cdk8s-team provide a review here? |
@BrentSouza @joekiller Appreciate the work on this and the calrifications. LGTM 👍 |
@BrentSouza apologies but looks like we need to regenerate some snapshot files. Run Now that the PR is approved it should just merge once the snapshots are fixed. Thanks! |
^0.20.x
@iliapolo Running |
Looks like if I modify the task to use the
I'll wait to hear back on what the desired output is. |
Looking at it a bit more, this is because we're updating jsii-docgen to 10.x.x Seems like removal of the README content is an intended change for JSII projects since |
Signed-off-by: Brent Souza <[email protected]>
Signed-off-by: Brent Souza <[email protected]>
@iliapolo Unfortunately I have to bug you once more as the build step requires approval to run. |
I had to step away from this one for a bit, but I'm happy to rebase and resolve conflicts once more if we can coordinate on the pipeline approval @iliapolo? It's a chore to keep rebasing given the automated updates to the project. |
@BrentSouza yeah I understand. Please rebase and ping me on slack so I can merge before the next rebasing cycle :) |
This PR has not received a response in a while and will be closed soon. If you want to keep it open, please leave a comment below @mentioning a maintainer. |
@BrentSouza I hope you can rebase and connect with @iliapolo on slack. The link is on the website but here it is for convenience: https://cdk.dev/ |
Fixes #485
Hello. Just figured I would give this a shot! Please let me know if there is any additional work that should be completed. Tests seem to pass when run locally: