-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add interfaces for workspace, other yamls. #212
Conversation
Current coverage is 88.40% (diff: 82.83%)@@ master #212 diff @@
==========================================
Files 26 31 +5
Lines 888 923 +35
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 822 816 -6
- Misses 52 91 +39
- Partials 14 16 +2
|
Having the interfaces for each type in it's own package was fine when it is the only one imported via it's "base" package. However, when you import all of them as in workspace, you have to start aliasing the package names and that's just sloppy.
@afeld yeppp.. I did it again. this is a mega elephant patch. A lot of it is moving files around though. Details above. This PR was one of those that started off one way then turned 90 degrees to something else so it was hard to break it up. Now that it's done, I can do that now. Let me know and I'll start to break this up later. Not a huge priority now so I'll get to it later probably. |
import ( | ||
"testing" | ||
"github.com/opencontrol/compliance-masonry/lib/mocks" | ||
commonMocks"github.com/opencontrol/compliance-masonry/lib/common/mocks" |
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.
Needs a space (right?)
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.
whoops! will fix
A few pieces of general feedback:
Sorry for the slow turnaround on the review, by the way!
If it's not hard, that would be good! |
Yeah, I agree. There are some things like |
@jcscottiii Are you planning to rebase this one (sooner or later) or should we just close it? |
Bump! |
Let's close this. The other recent PRs have been just parts of this one. On Mon, Oct 3, 2016, 5:50 PM Aidan Feldman [email protected] wrote:
|
To enable inter-operability between different versions of different things like standards and certifications (opencontrol.yaml and component.yaml already has it) and easy mocking, this patch introduces the use of more interfaces. Also, this patch introduces workspace interface which enables for external plugins to easily test by just using the interface to mock instead of worrying about fixtures.
Major Additions:
Certifications
,Control
,Standard
,Workspace
to thecommon
packageComponent
,Satisfies
, andSection
to thecommon
packageComponent
,Satisfies
,Certifications
,Control
,Section
,Standard
,Workspace
Standard
to it's own package for future versioning and loading by versions.lib
package.Certification
to it's own package for future versioning and loading by versions.lib
packageOther changes:
Standards
andComponents
and their methods private.Actual logic changes:
GetImplementationStatuses
returned an empty array. It should return the implementation status if it's there.For future PR:
verifications
tocommon
package.workspace
to also be added tocommon
without creating a circular dependency chain.Excerpt from
lib/README.md
:Lib Package
This package (and the sub packages) are the only packages that should be imported by external projects. This lib package is very helpful for those writing plugins to extend the functionality of Masonry.
Workspace
Workspace is the starting point for all the information available to plugins. For those using Go plugins, using the interface methods are all you need. It represents all the information collected into the
opencontrols
folder after running theget
command.YAML files
The yaml files are represented by:
Components
Certifications
Standards
Result Data
Justifications
is a data structure that is not represented in yaml but rather a post-processed map of data to help quickly getting component data for a particular control name - standard name combination.Plugin Developer Guide
Developers should not have to worry about loading real data / workspaces for their unit tests (they should for integration tests).
There is an example of developing your Go plugin and tests in
exampleplugin/example.go
andexampleplugin/example_test.go
respectively.