Skip to content
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: adds implementation parts to This System component in markdown #1536

Merged
merged 14 commits into from
Jul 16, 2024

Conversation

jpower432
Copy link
Member

@jpower432 jpower432 commented Apr 15, 2024

Types of changes

  • Hot fix (emergency fix and release)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation (change which affects the documentation site)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Release (develop -> main)

Quality assurance (all should be covered).

  • My code follows the code style of this project.
  • Documentation for my change is up to date?
  • My PR meets testing requirements.
  • All new and existing tests passed.
  • All commits are signed-off.

Summary

Alters SSP markdown to write the heading for the implementation part if it exists in the control for This System

Note: This has been tested with the component markdown to ensure the original behavior is not altered and parts are only written when rules are attached

The default behavior when writing SSP is not changed. It can be altered by using the include-all-parts flag.
The --include-all-parts flag controls This System is written in the markdown. When --include-all-parts is set, all control parts will be written with the main component present under the ## Implementation for part <part> section. All other components will still be conditionally added based on the presence of rules.

Closes #1527

Key links:

Before you merge

  • Ensure it is a 'squash commit' if not a release.
  • Ensure CI is currently passing
  • Check sonar. If you are working for a fork a maintainer will reach out, if required.

Changes in assembly are due to changes in the markdown breaking the unit tests
because the This System component is associated with each statement

Signed-off-by: Jennifer Power <[email protected]>
The process_main_component was overwriting the first prose
response to all the parts

Signed-off-by: Jennifer Power <[email protected]>
@jpower432 jpower432 marked this pull request as ready for review June 6, 2024 21:40
@jpower432 jpower432 requested a review from degenaro June 25, 2024 16:44
@degenaro
Copy link
Collaborator

Similar comment to PR #1534. Is there a place in the docs that describes this feature for users? Otherwise, looks like you have all the bases covered.

@jpower432
Copy link
Member Author

jpower432 commented Jun 28, 2024

Per discussion at today's issue review, this need changes before for being accepted. The behavior should be opt-in instead of default. Moving this back into draft while this is being addressed.

@jpower432 jpower432 marked this pull request as draft June 28, 2024 16:15
jpower432 added 5 commits July 8, 2024 17:50
Resolves merge conflicts

Signed-off-by: Jennifer Power <[email protected]>
To ensure the default markdown is not overly verbose, writing all
implementation parts and the inclusion of This System is optional.

Signed-off-by: Jennifer Power <[email protected]>
The goal is to increase the usefulness of the comments

Signed-off-by: Jennifer Power <[email protected]>
@jpower432 jpower432 marked this pull request as ready for review July 9, 2024 20:17
@jpower432
Copy link
Member Author

jpower432 commented Jul 9, 2024

@degenaro @AleJo2995 @vikas-agarwal76 The logic has been updated based on the provided feedback. Please take another look.

"""
Check if a part should be skipped based on rules and context.

Notes: The default logic is to keep part inclusion rules-based. Using the control
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: English could be improved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @degenaro. I can update the docstring to make it more clear.

Copy link
Collaborator

@degenaro degenaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, by inspection.

One nit cited. Plus, I see Sonar coverage is > 97%, which is fine. I normally try for 100% for the PR if it's not too challenging. Definitely not a requirement, though.

@jpower432
Copy link
Member Author

LGTM, by inspection.

One nit cited. Plus, I see Sonar coverage is > 97%, which is fine. I normally try for 100% for the PR if it's not too challenging. Definitely not a requirement, though.

Thanks @degenaro . I will take a look at the new uncovered lines to see how difficult it would be to remedy.

@jpower432
Copy link
Member Author

@degenaro Looks like the new uncovered line was actually moved, not added - https://github.com/oscal-compass/compliance-trestle/pull/1536/files#diff-fcc1b0a823415ac243a1edf58a536c3ec86f7e3bbedacda17bf873c90288f9afR163. The reason that it is uncovered is ControlContext.prompt_responses is only set to true at the CLI level in the Component and SSP context. I tried testing with prompt_responses set to true with a generated Catalog context, but it lead to an error because the comp_dict is not set. If this is something we want to test, seems like it would be better to add a safeguard making sure prompt responses is not true unless in an appropriate context.

@degenaro
Copy link
Collaborator

@jpower432 Still looks good to me, comments were for over achievement. Already approved! Suggest waiting for @vikas-agarwal76 to chime in.

Copy link
Collaborator

@vikas-agarwal76 vikas-agarwal76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpower432 jpower432 merged commit 54706af into develop Jul 16, 2024
12 checks passed
@jpower432 jpower432 deleted the feat/add-impl-parts-ssp branch July 16, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Implementation part headers by default for main component in SSP Markdown
3 participants