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: add inheritance view to ssp-generate and ssp-assemble #1441

Merged
merged 27 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1500914
feat: adds ability to process exports from SSP and write Markdown by …
Jul 27, 2023
c5d6f4d
feat: adds InheritanceMarkdownReader for reading leveraged statement …
jpower432 Aug 1, 2023
f59cf18
feat: Adds reader class for inheritance markdown
afflom Aug 10, 2023
7c572ff
docs: updates documentation with usage and API references updates for…
jpower432 Aug 24, 2023
2f7f217
chore: updates AgileAuthoring class for ssp-generate arg changes
jpower432 Aug 28, 2023
e6897af
docs: updates returns section in InheritanceMarkdownReader docstring
jpower432 Aug 30, 2023
db08a0f
fix: updates line length on return statement in InheritanceMarkdownRe…
jpower432 Aug 30, 2023
01a5a33
refactor: updates markdown heading and comment strip function to remo…
jpower432 Aug 30, 2023
3e1ce19
test: adds inheritance view testing for ssp-assemble
jpower432 Sep 1, 2023
33119d5
chore: adds more context to ExportReader class comments
jpower432 Sep 6, 2023
7fd10e8
Merge branch 'develop' into feat/add-inheritance-view
jpower432 Sep 11, 2023
8baa8bb
feat: updates ssp-generate to filter control implementation for lever…
jpower432 Sep 12, 2023
59dbaa5
refactor: updates ExportWriter to reduce code duplication
jpower432 Sep 12, 2023
b1d438e
fix: updates ExportReader to add new statements if present in the inh…
jpower432 Sep 12, 2023
80b41e7
fix: update logging to debug in ExportReader
jpower432 Sep 13, 2023
7ce56f3
Merge branch 'develop' into feat/add-inheritance-view
jpower432 Sep 15, 2023
27b28e6
refactor: simplify code in read_exports_from_markdown
jpower432 Sep 15, 2023
d78567e
tests: simplify tests for ExportReader test data generation
jpower432 Sep 22, 2023
648085d
refactor: reduce code duplication in ExportReader methods
jpower432 Sep 22, 2023
6de26a1
fix: allows inheritance info to be removed when component is unmapped
jpower432 Sep 25, 2023
8442cfe
feat: adds leveraged authorization updates to system implementation
jpower432 Sep 28, 2023
f87e467
docs: add docs updates for SSPInheritanceAPI class
jpower432 Sep 28, 2023
807bb28
chore: updates warning message for leveraged authorization with comps
jpower432 Sep 28, 2023
725f698
fix: updates ssp-assemble to ensure existing leveraged comps persist
jpower432 Sep 28, 2023
a10ba54
fix: adds fixes to address PR feedback
jpower432 Oct 27, 2023
b1f601d
refactor: polishes SSPInheritanceAPI class to reduce complexity
jpower432 Oct 27, 2023
5319028
Merge branch 'develop' into feat/add-inheritance-view
jpower432 Nov 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ site
tmp_bin_test
.mypy_cache

/venv.trestle/

2 changes: 2 additions & 0 deletions docs/api_reference/trestle.core.crm.bycomp_interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
::: trestle.core.crm.bycomp_interface
handler: python
2 changes: 2 additions & 0 deletions docs/api_reference/trestle.core.crm.export_reader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
::: trestle.core.crm.export_reader
handler: python
2 changes: 2 additions & 0 deletions docs/api_reference/trestle.core.crm.export_writer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
::: trestle.core.crm.export_writer
handler: python
2 changes: 2 additions & 0 deletions docs/api_reference/trestle.core.crm.leveraged_statements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
::: trestle.core.crm.leveraged_statements
handler: python
2 changes: 2 additions & 0 deletions docs/api_reference/trestle.core.crm.ssp_inheritance_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
::: trestle.core.crm.ssp_inheritance_api
handler: python
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,131 @@ As with all the `assemble` tools, you may optionally specify a `--name` for a co

If you do not specify component-defintions during assembly, the markdown should not refer to any components other than `This System`. Thus you may first generate markdown with `ssp-generate` and no component-definitions specified - and then you may assemble that ssp with `ssp-assemble` and no component-definitions specified - but only if there are no components other than `This System` referenced in the markdown. You may add new component implementation details to the markdown later, but any new components must be defined in a component-defintion file, and that file must be specified when `ssp-assemble` is run.

## Inheritance view

The inheritance view is generated by setting the `--leveraged-ssp` flag with `trestle author ssp-generate`. It contains information relating to exported information such as inherited capabilities and consumer responsibilities that can be used to populate the inheritance information in the assembled SSP. When used, a directory named "inheritance" is created within the markdown directory. This directory serves as a designated space for mapping inherited capabilities and responsibilities onto components in the assemble SSP and authoring satisfied statements for responsibilities.
vikas-agarwal76 marked this conversation as resolved.
Show resolved Hide resolved

Example usage for creation of the markdown:

`trestle author ssp-generate --profile my_prof --compdefs "compdef_a,compdef_b" --yaml /my_yaml_dir/header.yaml --leveraged-ssp my_provider_ssp --output my_ssp`

In this example the leveraged ssp has previously been imported into the trestle directory, but it can be fetched from remote location.

The generated markdown output with the inheritance view will be placed in the trestle subdirectory `my_ssp/inheritance` with a subdirectory for each component in the leveraged ssp with directories separated by control and statement id below.

An example of this directory structure is below.

```text
.
├── Application
│ ├── ac-1_stmt.a
│ │ └── 11111111-0000-4000-9009-001001002006.md
│ ├── ac-2.1
│ │ └── 11111111-0000-4000-9009-001001002004.md
│ └── ac-2_stmt.a
│ └── 11111111-0000-4000-9009-002001002001_11111111-0000-4000-9009-002001002002.md
└── This System
├── ac-1_stmt.a
│ └── 11111111-0000-4000-9009-001002002001.md
├── ac-2.1
│ └── 11111111-0000-4000-9009-001001002001.md
└── ac-2_stmt.a
└── 11111111-0000-4000-9009-002001001001.md
```

The leveraged components are used as the top level directory to allow any non-leveraged components to be easily skipped or removed. Each markdown file is named in accordance with the uuid of the exported statement to ensure statement description updates can be applied.

There are three types of markdown files that can be generated from this process.

The examples below demonstrate these types:

<details markdown>

<summary>Example of inheritance provided only markdown after ssp-generate</summary>

```markdown
---
x-trestle-statement:
# Add or modify leveraged SSP Statements here.
provided-uuid: 11111111-0000-4000-9009-001002002001
x-trestle-leveraging-comp:
# Leveraged statements can be optionally associated with components in this system.
# Associate leveraged statements to Components of this system here:
- name: REPLACE_ME
---

# Provided Statement Description

Consumer_appropriate description of what may be inherited.
vikas-agarwal76 marked this conversation as resolved.
Show resolved Hide resolved
```

</details>

<details markdown>

<summary>Example of inheritance consumer responsibility only markdown after ssp-generate</summary>

```markdown
---
x-trestle-statement:
# Add or modify leveraged SSP Statements here.
responsibility-uuid: 11111111-0000-4000-9009-002001001001
x-trestle-leveraging-comp:
# Leveraged statements can be optionally associated with components in this system.
# Associate leveraged statements to Components of this system here:
- name: REPLACE_ME
---

# Responsibility Statement Description

Leveraging system's responsibilities with respect to inheriting this capability.

# Satisfied Statement Description

<!-- Use this section to explain how the inherited responsibility is being satisfied. -->
```

</details>

<details markdown>

<summary>Example of inheritance shared responsibility markdown after ssp-generate</summary>

```markdown
---
x-trestle-statement:
# Add or modify leveraged SSP Statements here.
provided-uuid: 11111111-0000-4000-9009-002001002001
responsibility-uuid: 11111111-0000-4000-9009-002001002002
x-trestle-leveraging-comp:
# Leveraged statements can be optionally associated with components in this system.
# Associate leveraged statements to Components of this system here:
- name: REPLACE_ME
---

# Provided Statement Description

Consumer-appropriate description of what may be inherited.

# Responsibility Statement Description

Leveraging system's responsibilities with respect to inheriting this capability.

# Satisfied Statement Description

<!-- Use this section to explain how the inherited responsibility is being satisfied. -->
```

</details>

Some additional information and tips about this markdown are below:

- Do not change the statement UUIDs in the YAML header. This is used in the assembled JSON to link the statements in the leveraged SSP to the components in the leveraging SSP.
- When mapping components in the YAML header, use the component title. If you do not wish to map a component to a particular inherited capability or responsibility, just leave the file as is. Files without mapped components or that contain the default "REPLACE ME" entry will be skipped.
- If the file exists, just the editable information will be preserved when regenerating existing inheritance view markdown. This includes the information under `Satisfied Statement Description` and the mapped components in the YAML header.

After manually editing the inheritance view markdown, the `trestle author ssp-assemble` command can be run without modifications for the inheritance view use case. During assemble, the inheritance directory is detected and the information will be assembled into the SSP. The by-component assemblies will be updated or added under existing implemented requirement or statement sections with the information from the markdown.

</details>

<details markdown>
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ nav:
- control_interface: api_reference/trestle.core.control_interface.md
- control_reader: api_reference/trestle.core.control_reader.md
- control_writer: api_reference/trestle.core.control_writer.md
- crm:
- bycomp_interface: api_reference/trestle.core.crm.bycomp_interface.md
- export_reader: api_reference/trestle.core.crm.export_reader.md
- export_writer: api_reference/trestle.core.crm.export_writer.md
- leveraged_statements: api_reference/trestle.core.crm.leveraged_statements.md
- ssp_inheritance_api: api_reference/trestle.core.crm.ssp_inheritance_api.md
- docs_control_writer: api_reference/trestle.core.docs_control_writer.md
- draw_io: api_reference/trestle.core.draw_io.md
- duplicates_validator: api_reference/trestle.core.duplicates_validator.md
Expand Down
Loading
Loading