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

fix(generate): proposed transition of generation annotation to props #574

Merged
merged 5 commits into from
Aug 9, 2024

Conversation

brandtkeller
Copy link
Member

@brandtkeller brandtkeller commented Jul 31, 2024

Description

Proposing the transition of the generation to a control-implementation props such that it can be discoverable and easily updated.

Also introduces the framework flag as used in #327 for purposes of establishing the framework for a control implementation early.

The previous implementation placed the annotation in the component remarks. Problem is that this generation command is primarily creating and updating control implementations, and as such a single component may have 1 -> M control implementations which means a single component may have many generate commands for reproducibility.

Placing the annotation at the control-implementation layer feels more appropriate to scope and intent.

Related Issue

Fixes #572

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@brandtkeller brandtkeller marked this pull request as ready for review August 6, 2024 19:42
@meganwolf0
Copy link
Collaborator

Looks like the remarks doesn't include the --framework tag when it gets generated (nor does it update on successive generations) - but looks like the new generation prop does. Do we need to keep remarks anymore?

Also, to maintain consistency, should we add a generation.md to the namespaces docs?

@brandtkeller
Copy link
Member Author

Looks like the remarks doesn't include the --framework tag when it gets generated (nor does it update on successive generations) - but looks like the new generation prop does. Do we need to keep remarks anymore?

Also, to maintain consistency, should we add a generation.md to the namespaces docs?

Will look into the first item and great call on the additional docs.

@brandtkeller brandtkeller marked this pull request as draft August 8, 2024 14:38
@brandtkeller
Copy link
Member Author

When I execute ./bin/lula generate component -c https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json -r ac-1,ac-3,ac-3.2,ac-4 -o oscal-component.yaml --remarks assessment-objective --framework il4 I see the following props:

props:
            - name: generation
              ns: https://docs.lula.dev/ns
              value: lula generate component --catalog-source https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json --component 'Component Title' --requirements ac-1,ac-3,ac-3.2,ac-4 --remarks assessment-objective --framework il4
            - name: framework
              ns: https://docs.lula.dev/ns
              value: il4

@meganwolf0
Copy link
Collaborator

When I execute ./bin/lula generate component -c https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json -r ac-1,ac-3,ac-3.2,ac-4 -o oscal-component.yaml --remarks assessment-objective --framework il4 I see the following props

yep those props look good and what I saw as well! I meant the remarks section that's in the control-implementation - that doesn't get updated and also feels redundant now

@brandtkeller
Copy link
Member Author

When I execute ./bin/lula generate component -c https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json -r ac-1,ac-3,ac-3.2,ac-4 -o oscal-component.yaml --remarks assessment-objective --framework il4 I see the following props

yep those props look good and what I saw as well! I meant the remarks section that's in the control-implementation - that doesn't get updated and also feels redundant now

Ah! great point - we do a decent job at retaining information while merging - and so a previously generated file with still contain the generation annotation in the remarks is what you are getting at?

This is tricky - given how early the functionality is it feels like an edge case.

@meganwolf0
Copy link
Collaborator

Ok had to sanity check what I was even saying - yeah I think I had a previously generated component and that's why the remarks were there - starting fresh I don't have remarks. Sorry, disregard this! Agreed it's a weird edge case that's most likely not going to be an issue

@brandtkeller brandtkeller marked this pull request as ready for review August 8, 2024 23:02
Copy link
Collaborator

@CloudBeard CloudBeard left a comment

Choose a reason for hiding this comment

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

Works on my machine.

Outside of the fix I noticed if I ran

bin/lula generate component --catalog-source https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/yaml/NIST_SP-800-53_rev5_catalog.yaml --component 'Component Title' --requirements ac-1,ac-3,ac-3.2,ac-4 --remarks assessment-objective --framework il4

and

bin/lula generate component --catalog-source https://raw.githubusercontent.com/usnistgov/oscal-content/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json --component 'Component Title' --requirements ac-1,ac-3,ac-3.2,ac-4 --remarks assessment-objective --framework il4

I get the two implemented-requirements but they are technically the same just used a different source format yaml/json. I don't see anything wrong with with this but maybe something extra later on to figure out.

@brandtkeller
Copy link
Member Author

I get the two implemented-requirements but they are technically the same just used a different source format yaml/json. I don't see anything wrong with with this but maybe something extra later on to figure out.

Two implemented-requirements or two control-implementations (that each have the 4 implemented-requirements)?

@CloudBeard
Copy link
Collaborator

I get the two implemented-requirements but they are technically the same just used a different source format yaml/json. I don't see anything wrong with with this but maybe something extra later on to figure out.

Two implemented-requirements or two control-implementations (that each have the 4 implemented-requirements)?

image

1 control-implementations with 2 implemented-requirements

@brandtkeller brandtkeller merged commit b7a936d into main Aug 9, 2024
7 checks passed
@brandtkeller brandtkeller deleted the 572_generate_annotation_update branch August 9, 2024 15:57
This was referenced Aug 9, 2024
meganwolf0 pushed a commit that referenced this pull request Aug 19, 2024
…574)

* fix(generate): generation annotation in a prop

* fix(generate): introduce framework flag to generate

* chore(docs): add generation ns docs
brandtkeller added a commit that referenced this pull request Aug 30, 2024
* feat!(tui): initial commit

* chore(deps): update actions/upload-artifact action to v4.3.6 (#575)

| datasource  | package                 | from   | to     |
| ----------- | ----------------------- | ------ | ------ |
| github-tags | actions/upload-artifact | v4.3.4 | v4.3.6 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update module github.com/open-policy-agent/opa to v0.67.1 (#577)

| datasource | package                          | from    | to      |
| ---------- | -------------------------------- | ------- | ------- |
| go         | github.com/open-policy-agent/opa | v0.67.0 | v0.67.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Megan Wolf <97549300+meganwolf0@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v3.26.0 (#582)

| datasource  | package              | from     | to      |
| ----------- | -------------------- | -------- | ------- |
| github-tags | github/codeql-action | v3.25.15 | v3.26.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(generate): proposed transition of generation annotation to props (#574)

* fix(generate): generation annotation in a prop

* fix(generate): introduce framework flag to generate

* chore(docs): add generation ns docs

* feat(validation-result)!: bump to go-oscal v0.6.0 jsonschema v6 update (#544)

* feat(validation-result)!: remove validation-result in favor of new go-oscal behavior
chore(go-oscal): update w/ go-oscal jsonschema v6 changes

* docs(reference): update jsonschema url, run go mod tidy to remove lingering jsonschemav5 inderect dep

* test: update w/ current branch sha from go-oscal

* chore(deps): bump go-oscal to v0.6.0

* fix(unit): cleanup whitespaces for composed artifact

---------

Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>

* fix(validate): get non-namespace scoped resources (#585)

* fix(validate): get non-namespace scoped resources

* fix(validate): alternate cluster-scoped resource get, schema mods

* fix: updated conditional statement

* docs: updated k8s domain doc

* chore(deps): update dependency commitlint to v19.4.0 (#583)

| datasource | package    | from   | to     |
| ---------- | ---------- | ------ | ------ |
| npm        | commitlint | 19.3.0 | 19.4.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): initial SSP generation research docs (#548)

* feat: initial-ssp-generate-doc

* updated some wording

* split ssp docs, updated some assessment result spellings.

* ssp doc updates

* broke assessment results at somepoint

* updated note location

* chore(docs): minor adjustments to intent and terms

* chore(docs): cleanup testing artifacts

* chore(docs): fix typos and add to dict

---------

Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>
Co-authored-by: Brandt Keller <43887158+brandtkeller@users.noreply.github.com>

* chore(main): release 0.5.0 (#578)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore(docs): update issue template with expected deliverables line item (#590)

* chore(deps): update anchore/sbom-action action to v0.17.1 (#593)

| datasource  | package             | from    | to      |
| ----------- | ------------------- | ------- | ------- |
| github-tags | anchore/sbom-action | v0.17.0 | v0.17.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v3.26.1 (#595)

| datasource  | package              | from    | to      |
| ----------- | -------------------- | ------- | ------- |
| github-tags | github/codeql-action | v3.26.0 | v3.26.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(docs): updated namespace doc locations and associated prop namespace url (#602)

* fix: updated ns docs, ns prop

* fix: remove test file

feat: more tui design

feat: more tui design

feat: more tui design

feat: more tui design

* fix: removed debug bin

* fix: removed rest files

* fix: removed rest files

* fix: fixed test expectations

* feat: tui sizing, fixes

* feat: updated keybindings, help

* docs: tui docs

* docs: updated tui docs

* fix: nil handling for empty control

* fix: additional nil pointer errors

* fix: renamed to console

* docs: updated console docs, lula-config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brandt Keller <43887158+brandtkeller@users.noreply.github.com>
Co-authored-by: Cole (Mike) Winberry <86802655+mike-winberry@users.noreply.github.com>
Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>
Co-authored-by: Andy Mills <61879371+CloudBeard@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
brandtkeller added a commit that referenced this pull request Sep 20, 2024
* feat!(tui): initial commit

* chore(deps): update actions/upload-artifact action to v4.3.6 (#575)

| datasource  | package                 | from   | to     |
| ----------- | ----------------------- | ------ | ------ |
| github-tags | actions/upload-artifact | v4.3.4 | v4.3.6 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update module github.com/open-policy-agent/opa to v0.67.1 (#577)

| datasource | package                          | from    | to      |
| ---------- | -------------------------------- | ------- | ------- |
| go         | github.com/open-policy-agent/opa | v0.67.0 | v0.67.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Megan Wolf <97549300+meganwolf0@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v3.26.0 (#582)

| datasource  | package              | from     | to      |
| ----------- | -------------------- | -------- | ------- |
| github-tags | github/codeql-action | v3.25.15 | v3.26.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(generate): proposed transition of generation annotation to props (#574)

* fix(generate): generation annotation in a prop

* fix(generate): introduce framework flag to generate

* chore(docs): add generation ns docs

* feat(validation-result)!: bump to go-oscal v0.6.0 jsonschema v6 update (#544)

* feat(validation-result)!: remove validation-result in favor of new go-oscal behavior
chore(go-oscal): update w/ go-oscal jsonschema v6 changes

* docs(reference): update jsonschema url, run go mod tidy to remove lingering jsonschemav5 inderect dep

* test: update w/ current branch sha from go-oscal

* chore(deps): bump go-oscal to v0.6.0

* fix(unit): cleanup whitespaces for composed artifact

---------

Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>

* fix(validate): get non-namespace scoped resources (#585)

* fix(validate): get non-namespace scoped resources

* fix(validate): alternate cluster-scoped resource get, schema mods

* fix: updated conditional statement

* docs: updated k8s domain doc

* chore(deps): update dependency commitlint to v19.4.0 (#583)

| datasource | package    | from   | to     |
| ---------- | ---------- | ------ | ------ |
| npm        | commitlint | 19.3.0 | 19.4.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): initial SSP generation research docs (#548)

* feat: initial-ssp-generate-doc

* updated some wording

* split ssp docs, updated some assessment result spellings.

* ssp doc updates

* broke assessment results at somepoint

* updated note location

* chore(docs): minor adjustments to intent and terms

* chore(docs): cleanup testing artifacts

* chore(docs): fix typos and add to dict

---------

Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>
Co-authored-by: Brandt Keller <43887158+brandtkeller@users.noreply.github.com>

* chore(main): release 0.5.0 (#578)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore(docs): update issue template with expected deliverables line item (#590)

* chore(deps): update anchore/sbom-action action to v0.17.1 (#593)

| datasource  | package             | from    | to      |
| ----------- | ------------------- | ------- | ------- |
| github-tags | anchore/sbom-action | v0.17.0 | v0.17.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v3.26.1 (#595)

| datasource  | package              | from    | to      |
| ----------- | -------------------- | ------- | ------- |
| github-tags | github/codeql-action | v3.26.0 | v3.26.1 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(docs): updated namespace doc locations and associated prop namespace url (#602)

* fix: updated ns docs, ns prop

* fix: remove test file

feat: more tui design

feat: more tui design

feat: more tui design

feat: more tui design

* fix: removed debug bin

* fix: removed rest files

* fix: removed rest files

* fix: fixed test expectations

* feat: tui sizing, fixes

* feat: updated keybindings, help

* docs: tui docs

* docs: updated tui docs

* fix: nil handling for empty control

* fix: additional nil pointer errors

* fix: renamed to console

* fix: overlay focus navigation

* fix: updating keys/help

* feat(console): adding edit fcns

* feat(console): edit functionality updates

updates to edit, plus other housekeeping/tech-debt modifications to try
and simplify update functions

* fix: go deps, removed debug.log

* fix: updated testdata, redundant fcns

* fix: updating model_test

* fix: trying tempfile

* fix: key-maps/help updates

* fix: updated test files, increased timeout

* fix: msgs, keys

* test(console): additional console edit tests, testhelpers

* fix: removed inject changes, dead code comment

* docs(console): updated docs, gifs; added vhs tapes

* fix: doc change, removed comments

* fix: updated teatest

* fix: save then close

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brandt Keller <43887158+brandtkeller@users.noreply.github.com>
Co-authored-by: Cole (Mike) Winberry <86802655+mike-winberry@users.noreply.github.com>
Co-authored-by: Brandt Keller <brandt.keller@defenseunicorns.com>
Co-authored-by: Andy Mills <61879371+CloudBeard@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

generate annotation does not support > 1 control-implementations
3 participants