ROX-13722: [Prefactor] Do not use scanner protos in node.proto#4392
ROX-13722: [Prefactor] Do not use scanner protos in node.proto#4392
Conversation
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
|
Images are ready for the commit at 2bed400. To use with deploy scripts, first |
Maddosaurus
left a comment
There was a problem hiding this comment.
I spotted some well placed small additions, addressing feedback we discussed in the initial review of #3757.
Well done, thanks for the updates!
|
|
||
| // TODO(ROX-12240, ROX-13053): Do something meaningful with the nodeInventory | ||
| log.Infof("Central received NodeInventory: %+v", nodeInventory) | ||
| log.Debugf("Central received NodeInventory: %+v", nodeInventory) |
There was a problem hiding this comment.
I see you already incorporated the feedback regarding loglevels. Great job!
That said, we're keeping the pipeline only until #3757 is merged, as NodeInventory is still an independent message here, and we depend on this pipeline to print the inventory, correct?
| Path: executable.Path, | ||
| RequiredFeatures: nil, | ||
| } | ||
| if executable.GetRequiredFeatures() != nil { |
There was a problem hiding this comment.
Thanks for switchting to getters here, as discussed in the sync review!
proto/storage/node.proto
Outdated
| string version = 4; | ||
| string arch = 5; | ||
| string module = 6; | ||
| repeated string cpes = 7; |
There was a problem hiding this comment.
With rhel_content_sets we don't need cpes anymore.
rhybrillou
left a comment
There was a problem hiding this comment.
Good work.
Some additional bulletproofing can be added in some places.
|
|
||
| convertedComponents := make(map[string]*scannerV1.RHELComponent, 0) | ||
| convertedComponents := make(map[string]*storage.NodeInventory_Components_RHELComponent, 0) | ||
| for i, rhelc := range rc.Packages { |
There was a problem hiding this comment.
It might be worth adding a guard here for the case where rhelc is a nil pointer.
| arr := make([]*storage.NodeInventory_Components_RHELComponent_Executable, len(exe)) | ||
| for i, executable := range exe { | ||
| arr[i] = &storage.NodeInventory_Components_RHELComponent_Executable{ | ||
| Path: executable.Path, |
| if executable.GetRequiredFeatures() != nil { | ||
| arr[i].RequiredFeatures = make([]*storage.NodeInventory_Components_RHELComponent_Executable_FeatureNameVersion, len(executable.GetRequiredFeatures())) | ||
| } | ||
| for i2, fnv := range executable.GetRequiredFeatures() { |
There was a problem hiding this comment.
nit: would it make sense to nest this for loop in the previous block after the array allocation ?
| // Components represents a subset of the scannerV1.Components proto message containing only fields required for RHCOS node scanning | ||
| // We are not using scannerV1.Components here for the following reasons: | ||
| // - to avoid conflicts between v1 and scannerV1 APIs when generating the code in central/graphql/resolvers/generated.go | ||
| // - to not expose scanner v1 API over stackrox graphql API |
There was a problem hiding this comment.
Should there be a note to keep scannerV1.Components and storage.NodeInventory_Components in sync ?
|
Thank you for all the reviews. I will merge this as it is as this state is a good starting point for further changes. After meeting with Mandar yesterday, we might need to abandon #3757, readd |

Description
This PR is a prefactor for #3757. It contains all changes that are safe
to land as they do not affect other parts of the system than RHCOS node
scanning feature.
The changes here are:
node.protorhel_content_setsfield instorage.NodeInventory_Components- see Scanner #1053Checklist
Do not apply
If any of these don't apply, please comment below.
Testing Performed