-
Notifications
You must be signed in to change notification settings - Fork 124
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
Investigate alternative version ideas for manifest-sourced dependencies #129
Comments
Another idea would be to emit a warning if licensed is run on modified file, at cost of licensed having to invoke |
@mlinksva 👋 apologies for the essay that you're about to read 😆 😬
I'm a little hesitant for this approach because it wouldn't work well for automation or if logs of running licensed were unavailable down the line. I have something coded up and (mostly) working that gets a hash from the file contents for each source. I'm running into a block though and would appreciate your thoughts while I continue investigation on a fix. The versioning strategy would be used by the Go packages tend to be structured where a single Git repo can contain multiple packages, or at least multiple importable components. For example https://github.com/hashicorp/golang-lru has two packages, with two import paths
Licensed doesn't pay much attention to the package name, instead opting to use the package import path as the dependency The problem I'm finding is that it's common for all packages in a repo to share a single set of metadata files (README, LICENSE) that are in the root of the repo. If I'm looking at the Thoughts? For comparison, versioning based on Git uses the most recent Git commit SHA from the import path directory - it suffers from the same problem where an update to the repo |
When would an automated scenario create/modify files and expect licensed to test against those (ephemeral?) files? The block/problem you describe in the penultimate paragraph in the comment above ( |
Yep
Given it's a pre-existing issue I think I'm going to move forward with the source hashing PR and leave that for another day. |
Currently, the manifest source uses the most git commit hash of the files in each dependency to determine the version.
This mostly works well but has an annoying edge case when licensed is run on an updated file before the file is committed. When the file change is then committed, the dependency will have a new latest git commit hash.
licensed status
will then report an error for the cached dependency content as being out of date.It would be great to have an alternative method for finding the dependencies "version" that is reproducible.
One suggestion was to create a hash of the file contents for each file in the dependency. This would be great for small numbers of small files but if the dependency contains a large number of files or any number of very large files, calculating the hash could become expensive. Are there cheap ways to calculate hashes for large files and/or large numbers of files?
Any other ideas?
The text was updated successfully, but these errors were encountered: