-
Notifications
You must be signed in to change notification settings - Fork 83
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
Refactor opencontrol interface and clean common part 1. #217
Conversation
Current coverage is 92.03% (diff: 94.32%)
@@ add-result-package #217 diff @@
====================================================
Files 32 30 -2
Lines 968 979 +11
Methods 0 0
Messages 0 0
Branches 0 0
====================================================
+ Hits 888 901 +13
+ Misses 65 64 -1
+ Partials 15 14 -1
|
419e4cb
to
ecd0580
Compare
}) | ||
|
||
|
||
var _ = Describe("Entry", func() { |
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.
VCSEntry
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.
/me is assuming that's a TODO for yourself...?
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.
^yep!
table.DescribeTable("DownloadRepo", func(err error) { | ||
remoteSource := new(commonMocks.RemoteSource) | ||
remoteSource.On("GetURL").Return("") | ||
remoteSource.On("GetRevision").Return("") |
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.
Why would these be empty?
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.
these don't matter as much since it's not actually downloading something. but i can put something here so people know what to expect!
Phew, ok, a handful of notes. Let's please please please try and keep the pull requests smaller for reviewer sanity 😁 |
4bee222
to
13cd623
Compare
ecd0580
to
92d4c55
Compare
@afeld this should be ready! |
13cd623
to
f898b26
Compare
47f6fd6
to
9cbd029
Compare
This was neccessary to clean up `common` package
We can dot import table package because we no longer have a struct called Entry (now it's called VCSEntry)
"github.com/opencontrol/compliance-masonry/tools/mapset" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/mock" | ||
) |
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.
This many imports seems like a red flag that the setup for these structs/functions are too complicated, though I don't have specific suggestions about how to simplify 😕
Builds on #216
This was necessary to clean up
lib/common
package.The
lib/common
package had both interfaces and structs for the YAMLs.This led to weird import paths to get around circular dependencies.
This patch is just mostly moving stuff around.
Entry
toRemoteSource
in thelib/common
packageEntry
was. It really was a container of information to some remote (re)sourceRemoteSource
for the v1.0.0 of theOpenControl
is now calledVCSEntry
(Probably should be calledVCSSource
)Entry
/VCSEntry
(with the yaml tags) for v1.0.0 was in thelib/common
package. Not where things should be for implementation. Hence, it has moved tolib/opencontrol/versions/1.0.0/opencontrol.go
EntryDownloader
was renamed toDownloader
Entry
no longer exists due to the last point.lib/opencontrol
andcommands/get
.lib
package. (GetResources
,GetRemoteResources
,GetLocalResources
). This made it very hard to separate outlib/common
commands/get/resources
packagelib/opencontrol/versions/base
packageOpenControl
fromlib/opencontrol/versions/base/
tolib/common
Parse
,GetSchemaVersion
andGetResources
toGetCertifications
GetStandards
GetComponents
GetCertificationsDependencies
GetStandardsDependencies
GetComponentsDependencies
lib
andcommand
(which is also nice for plugins)Worker
struct. It created a circular dependency when trying to use with mocks.