-
Notifications
You must be signed in to change notification settings - Fork 594
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
Migrate location-related structs to the file package #1751
Conversation
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
89ac5f5
to
690b920
Compare
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
690b920
to
eecf0b2
Compare
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Comments from the team during the offline/sync review:
|
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman Finished and LGTM after sync review - I'll 🟢 when the comments/changes are pushed from our call |
I made one change relative to the PR comments offline: the resolvers are in
Given these points, we still want a spot that keeps resolvers as internal concerns but shared amongst the core API (not the CLI packages). This makes I also renamed the new |
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
837ec75
to
936153d
Compare
Signed-off-by: <>
* main: (21 commits) chore(deps): bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3 (#1862) chore(deps): bump modernc.org/sqlite from 1.22.1 to 1.23.0 (#1863) feat: source-version flag (#1859) chore(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#1851) accept main.version ldflags even without vcs (#1855) feat: add scope to pom properties (#1779) chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#1852) chore(deps): bump github.com/docker/docker (#1849) Add test to ensure package metadata is represented in the JSON schema (#1841) Fix directory resolver to consider CWD and root path input correctly (#1840) Migrate location-related structs to the file package (#1751) chore(deps): bump github.com/go-git/go-git/v5 from 5.6.1 to 5.7.0 (#1843) fix: add panic recovery for license parse (#1839) chore: return both failures when failed to retrieve an image with a scheme (#1801) Extract go module versions from ldflags for binaries built by go (#1832) fix: duplicate packages, support pnpm lockfile v6 (#1778) chore(deps): update stereoscope to e14bc4437b2eac481c5b6f101890b22df4f33596 (#1834) chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#1829) chore(deps): bump github.com/docker/docker (#1833) Keep original FileInfo persisted on file.Metadata structs (#1794) ... Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
* migrate location structs to file package Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * replace source.Location refs with file package call Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix linting Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * remove hardlink test for file based catalogers Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * remove hardlink test for all-regular-files testing Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * migrate file resolver implementations to separate package Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix linting Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * [wip] migrate resolvers to internal Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * migrate resolvers to syft/internal Signed-off-by: Alex Goodman <alex.goodman@anchore.com> --------- Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: <>
Partially implements #558 by migrating the following resources from the
source
package to thefile
package:Location
,Locations
,LocationSet
Coordinates
,CoordinateSet
FileResolver
,PathResolver
,ContentResolver
,WritableFileResolver
,FileMetadataResolver
In doing so, type aliases have been left behind with deprecation warnings, allowing existing lib users to port over to the new types/functions without introducing a breaking change yet (See
syft/source/deprecated.go
).In order to do this, part of the plan in #558 needed to be executed, specifically to split up file type definitions from capabilities (catalogers). This means introducing the same package organization structure that exists today with the package catalogers:
Note: this is a breaking change for any lib consumer that is directly importing the file catalogers (which is not recommended).
I've also updated the existing places in the codebase that were leveraging the newly deprecated
source.*
types/functions.File resolver implementations have been moved to the
file/resolver
package and are all now exported for general use. This is under the same reasoning for splitting up definitions from capabilities, but in this case it's the first step in separating out source.Source definitions from general capabilities of the source object. Since no file resolvers have been exported in the past, this is not a breaking change.Lastly, a sizable 1.7 MB binary test fixture was removed from the repo 🎉 , but I had to remove an element from the tests that used it to do so.