-
Notifications
You must be signed in to change notification settings - Fork 365
Gleam DependencyHandler #11221
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
base: main
Are you sure you want to change the base?
Gleam DependencyHandler #11221
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11221 +/- ##
=========================================
Coverage 57.41% 57.41%
Complexity 1705 1705
=========================================
Files 346 346
Lines 12875 12875
Branches 1228 1228
=========================================
Hits 7392 7392
Misses 5005 5005
Partials 478 478
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Use typed enums for Package.SourceType and Requirement.SourceType instead of raw strings like "hex", "git", and "local". This improves type safety and enables exhaustive when expressions. Signed-off-by: Jonatan Männchen <[email protected]>
Replace lazy property with factory function to ensure test isolation. Each test now gets its own Gleam instance instead of sharing one. Signed-off-by: Jonatan Männchen <[email protected]>
Move Link, Repository, and Dependency types inside GleamToml as nested classes. Rename GleamDependency to GleamToml.Dependency and convert findHomepageUrl from extension function to member function. Signed-off-by: Jonatan Männchen <[email protected]>
390d424 to
b9c3cae
Compare
Remove fields that are parsed but never used by the plugin: - GleamManifest.requirements map and Requirement class - GleamManifest.Package.buildTools and otpApp fields - HexPackageInfo.latestStableVersion field Signed-off-by: Jonatan Männchen <[email protected]>
Use default empty collections for packages and requirements fields, simplifying construction of empty manifests. Signed-off-by: Jonatan Männchen <[email protected]>
Replace scope-based dependency resolution with DependencyGraphBuilder for consistent graph format across package managers. Extract dependency handling logic into GleamDependencyHandler and introduce GleamPackageInfo and GleamProjectContext types to support the new architecture. Signed-off-by: Jonatan Männchen <[email protected]>
0d23fd4 to
ef2e56d
Compare
Fix isValidLocalPath to use startsWith for checking whether a resolved path is within the working directory. Add test coverage for invalid path dependencies. Signed-off-by: Jonatan Männchen <[email protected]>
ef2e56d to
0a91a26
Compare
| private fun isValidLocalPath(workingDir: File, path: String): Boolean { | ||
| val resolvedPath = workingDir.resolve(path).canonicalFile | ||
| return resolvedPath.relativeToOrNull(workingDir.canonicalFile) != null | ||
| return resolvedPath.startsWith(workingDir.canonicalFile) |
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.
Does the path really need to be within workingDir or would it suffice to check resolvedPath.startsWith(analysisRoot) ?
Check the individual commits for details.
Follow up of #11210 (review)