-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat: add parameter value origin field to parameters #1470
Conversation
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
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.
Need to discuss.
trestle/oscal/common.py
Outdated
@@ -1626,6 +1626,7 @@ class Config: | |||
values: Optional[List[constr(regex=r'^\S(.*\S)?$')]] = Field(None) | |||
select: Optional[ParameterSelection] = None | |||
remarks: Optional[str] = None | |||
param_value_origin: Optional[str] = None |
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 is wrong. We are not adding a field directly to param origin in OSCAL. We are just adding a property. So OSCAL schema should not be changed.
trestle/oscal/profile.py
Outdated
@@ -106,6 +106,7 @@ class Config: | |||
guidelines: Optional[List[common.ParameterGuideline]] = Field(None) | |||
values: Optional[List[constr(regex=r'^\S(.*\S)?$')]] = Field(None) | |||
select: Optional[common.ParameterSelection] = None | |||
param_value_origin: Optional[str] = Field(None, alias='parameter-value-origin') | |||
|
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 is wrong. We are not changing the schema.
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
…mpliance-trestle into fix/record-aditional-info
new_dict[const.PARAM_VALUE_ORIGIN] = param_value_origin | ||
else: | ||
# puts it empty for user to fill it out mandatorily | ||
new_dict[const.PARAM_VALUE_ORIGIN] = 'Added by Control Owner' |
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 value needs to be changed after Prashant confims which is the default value for the field. @vikas-agarwal76 . In the meantime I'm using a placeholder value
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.
Is it required to populate the value for param value origin?
|
||
# convert resolved profile catalog to markdown then assemble it after adding an item to a control | ||
# generate, edit, assemble | ||
test_args = f'trestle author profile-generate -n {assembled_prof_name} -o {md_name} -rs NeededExtra --force-overwrite'.split( # noqa E501 |
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.
Test includes overwrite of the profile at the end to proof that the markdown gets modified after a profile json is modified as well for param_value_origin prop
@vikas-agarwal76 after profile assemble, the prop for param_value_origin will look like this: |
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
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.
I didn't find any changes to profile code and Mardkown code for reading and writing param value origin. Where are those changes. Also if the param-value-origin was set in previous catalog or profile then how will you distinguish whether it wa set in this profile or pervious profile for including in profile->alters->set-params?
new_dict[const.PARAM_VALUE_ORIGIN] = param_value_origin | ||
else: | ||
# puts it empty for user to fill it out mandatorily | ||
new_dict[const.PARAM_VALUE_ORIGIN] = 'Added by Control Owner' |
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.
Is it required to populate the value for param value origin?
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
…mpliance-trestle into fix/record-aditional-info
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
@vikas-agarwal76 done. I have added the new test required for testing the inherited param-value-origin coming from another profile called: |
… in profile-param-value-origin Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
…mpliance-trestle into fix/record-aditional-info
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
…mpliance-trestle into fix/record-aditional-info
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
@vikas-agarwal76 , @mrgadgil I have changed the default value for param-value-origin correctly. Could you please approve so I can merge? Thanks |
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
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 for param-value-origin
@AleJo2995 Please open another issue and PR to fix the param-values issue that we discussed.
Types of changes
develop
->main
)Quality assurance (all should be covered).
Summary
Closes #1454
Key links:
Before you merge