-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
@@ -123,3 +123,72 @@ func getMappedCatalogControlsFromImport(importedCatalog *catalog.Catalog, profil | |||
} | |||
return newCatalog, nil | |||
} | |||
|
|||
func getCatalogForImport(ctx context.Context, i profile.Import, c chan *catalog.Catalog, e chan error) { |
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.
@anweiss
This method traverses the entire import
tree and finds the catalog concurrently. The first goroutine that finds it pushes it to the channel and all other goroutines get killed thanks to the context
package.
Let me know if this approach works better in stead of the old fashioned LNR
tree parsing
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.
@heavypackets @justincormack for review
1ad414d
to
56a14e9
Compare
Currently this PR is shutting down unit tests as |
56a14e9
to
c9cc98e
Compare
@minhaj10p would it be possible to include the mocks in this PR? |
Sure. I can create a folder and put some profiles in it. Another thing just occurred to me is that we always put the |
c9cc98e
to
6e4c915
Compare
@anweiss Tests updated. All are passing now with 73.0% code coverage |
1b25402
to
13ebd1e
Compare
@anweiss Let me know if theres anything you need changed in this pull request. Thanks. |
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.
@minhaj10p please add a space after //
in all comments.
@@ -123,3 +123,72 @@ func getMappedCatalogControlsFromImport(importedCatalog *catalog.Catalog, profil | |||
} | |||
return newCatalog, nil | |||
} | |||
|
|||
func getCatalogForImport(ctx context.Context, i profile.Import, c chan *catalog.Catalog, e chan error) { |
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.
@heavypackets @justincormack for review
@minhaj10p I tested this on my end with the FedRAMP High profile, and it looks like it's appending some erroneous structs. For example: Parts: []catalog.Part{
catalog.Part{
Id: "ir-9_smt",
Class: "statement",
Title: "",
},
catalog.Part{
Id: "ir-9_gdn",
Class: "guidance",
Title: "",
},
catalog.Part{
Id: "ir-9_obj",
Class: "objective",
Title: "",
},
catalog.Part{
Id: "",
Class: "assessment",
Title: "",
},
catalog.Part{
Id: "",
Class: "assessment",
Title: "",
},
catalog.Part{
Id: "",
Class: "assessment",
Title: "",
},
catalog.Part{
Id: "",
Class: "justification",
Title: "",
},
}, Note the empty "assessment" and "justification" parts. Also as far as the |
@anweiss
I haven't been able to implement nested It looks somewhat like this if just included in the template catalog.Part{
Id: "ir-9_obj",
Class: "objective",
Title: "",
Prose: "{{ } [] [p] [{{http://csrc.nist.gov/ns/oscal/1.0 p} [] [] [] [] [] [] [] [] [] [] [] Determine if the organization: }] [] [] []
}", |
@minhaj10p ah ok. That makes sense. I'll try to see what I can come up with re. nested parts and prose to help you out on this. |
29d8b41
to
aa73643
Compare
aa73643
to
2618aa0
Compare
@anweiss if you merge this, let me know so I can rebase the other dependent branches. |
@minhaj10p after speaking internally with @justincormack, we can go ahead and merge this. Thanks again for your patience. |
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.
LGTM
Description
Attempts to process
manipulation
attributes in the profilemodify
section.Linking to #12.
Feature set
import
chain traversal is enabled to fetch the root catalog for each importimport
chain for the controls/subcontrols referenced by the root profile foradd
manipulation attributepart
s with the sameclass
instead of adding a newpart