Repository navigation
fix(lib): match the exact dotnet package name in debug output - #537
Conversation
jsteinich
left a comment
There was a problem hiding this comment.
Thanks for the fix. Matching the exact token after > is the right change, and it fixes more than the title says: getPackageVersion(language, "cdktn" | "cdktf") also feeds cdktn provider add. That command passes cdktfVersion ?? cdktnVersion, so the old > HashiCorp.Cdktf substring match on HashiCorp.Cdktf.Providers.* could hand it a provider's version as the cdktf version.
I checked the new match against sample dotnet list package --include-transitive output:
Io.Cdktnthat only appears transitively, next to a top-levelIo.Cdktn.Providers.Aws: the old code returned the provider's version, the new code returns the core version.- The same for legacy
HashiCorp.Cdktfnext toHashiCorp.Cdktf.Providers.*: fixed. Constructs,Amazon.JSII.Runtime, and rows with the(A)auto-reference marker: unchanged.
The one thing blocking this is a regression test; details inline. The other comments are optional.
Two nits that GitHub won't let me attach inline:
debug.ts:223: the comment about waiting on NuGet/Home#7752 is out of date:dotnet list package --format jsonshipped in .NET SDK 7.0.200. You don't need to switch here, but the comment could be updated or removed.- PR title: this is CLI behaviour (
cdktn debug,cdktn provider add) living in@cdktn/commons. Earlier fixes to this file usedfix(cli)(#280, #412), andlibis the scope for the core construct library in the changelog. Could you rename the title tofix(cli): …?
acff5dd to
9a291e9
Compare
9a291e9 to
0032da5
Compare
jsteinich
left a comment
There was a problem hiding this comment.
Thanks, the four tests each fail on the old substring match and pass with the fix, and the case-insensitive comparison closes the io.cdktn gap. LGTM.
Related issue
Fixes #31
Description
A substring match picked up prebuilt provider packages such as
Io.Cdktn.Providers.Awsinstead ofIo.Cdktn.Checklist