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

Node-related improvements #9732

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Node-related improvements #9732

merged 3 commits into from
Jan 14, 2025

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

This also moves the use of `packageJsonCache` closer to its declaration
for a better overview.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
While at it, rename the function parameter of `parsePackage` to make
clear that the package details do not need to come from a remote.

The `typealias` will be reused in an upcoming change.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
While at it, ensure to use the dedicated `projectType` instead of
`managerName` as the type of project IDs.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth sschuberth requested a review from a team as a code owner January 13, 2025 14:54
@sschuberth sschuberth enabled auto-merge (rebase) January 13, 2025 14:54
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 68.00%. Comparing base (b85af8b) to head (72c0d3a).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...s/node/src/main/kotlin/npm/NpmDependencyHandler.kt 37.50% 5 Missing ⚠️
...node/src/main/kotlin/pnpm/PnpmDependencyHandler.kt 0.00% 5 Missing ⚠️
...package-managers/node/src/main/kotlin/pnpm/Pnpm.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9732      +/-   ##
============================================
- Coverage     68.09%   68.00%   -0.10%     
+ Complexity     1294     1287       -7     
============================================
  Files           249      249              
  Lines          8846     8845       -1     
  Branches        923      923              
============================================
- Hits           6024     6015       -9     
- Misses         2433     2442       +9     
+ Partials        389      388       -1     
Flag Coverage Δ
funTest-non-docker 33.30% <ø> (ø)
test-ubuntu-24.04 35.91% <26.66%> (+0.02%) ⬆️
test-windows-2022 35.89% <26.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -137,14 +137,13 @@ internal fun parseVcsInfo(packageJson: PackageJson): VcsInfo {
)
}

typealias PackageDetailsFunction = (packageName: String) -> PackageJson?
Copy link
Member

Choose a reason for hiding this comment

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

Function is so generic, how about PackageDetailsProvider or GetPackageDetails?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had "Provider" initially, but compared to our other providers, like PackageCurationProvider, this is way more lightweight, which is why I went for "Function".

Also I didn't want to call it "GetPackageDetails", as that name IMO better fits for the variable / parameter name in line 146, and I didn't want to call the parameter and type basically the same, just with different capitalization.

Copy link
Member

Choose a reason for hiding this comment

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

I think it would not be bad to call it the same. But it's also not so important.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, as somewhat of a compromise, would you like GetPackageDetailsFun better?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's eventually change this later on.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #9738.

@sschuberth sschuberth disabled auto-merge January 14, 2025 08:31
@sschuberth
Copy link
Member Author

Merging despite the unrelated funTest-docker failure.

@sschuberth sschuberth merged commit 226d277 into main Jan 14, 2025
24 of 26 checks passed
@sschuberth sschuberth deleted the node-simplifications branch January 14, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants