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

Update content to use OSCAL v1.1.1 models #204

Merged
merged 25 commits into from
Oct 24, 2023

Conversation

aj-stein-nist
Copy link
Contributor

@aj-stein-nist aj-stein-nist commented Aug 3, 2023

Committer Notes

This updates oscal-content make-based orchestration and touches up catalogs for #116. Guidance on these changes, future development, and future governance are further detailed in usnistgov/OSCAL#1947.

Example content with the updated tooling work and simulating this branch being merged can be found on my work (the last commit changing the HOME_REPO variable to work on this branch has been dropped, but was used to complete this final testing).

aj-stein-nist/oscal-content@c8a5374#diff-ecf37eddbbe732cfc8cb391c407ae4ad8f00500d1590cc65bb08569c80697ff2

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions] (NOTE: Will do after review to aid review process and properly document many changes, big and small, potentially will not squash.) In this case, I believe it to be important that we keep all the commits for team understanding of significant changes in the repo. I will not squash these.
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?

@aj-stein-nist aj-stein-nist self-assigned this Aug 3, 2023
@iMichaela
Copy link
Contributor

@aj-stein-nist Is the title of the PR wrong? It lists OSCAL 1.0.0

@aj-stein-nist aj-stein-nist changed the title Update content to use OSCAL v1.0.0 models Update content to use OSCAL v1.1.0 models Aug 3, 2023
@aj-stein-nist
Copy link
Contributor Author

@aj-stein-nist Is the title of the PR wrong? It lists OSCAL 1.0.0

Woops, fixed. :-)

aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Aug 6, 2023
Add this back as part of sprint work to build new Makefile(s) and recreate profile resolution tooling for local and GHA CI/CD for usnistgov/oscal-content#204.
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Aug 6, 2023
This was removed in site migration work and did not appear to be relocated, as determined during the course of usnistgov/oscal-content#204. We can rely on the metaschema-xslt project, but given OSCAL has the profile resolver tool committed in its repo tree, it stands to reason to rely on its own independent Maven POM file, even if now redundant, as they may diverge in the future.
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Aug 7, 2023
* Correct relative path to previous Maven POM dep file

Add this back as part of sprint work to build new Makefile(s) and recreate profile resolution tooling for local and GHA CI/CD for usnistgov/oscal-content#204.

* Add back pom.xml for Maven deps

This was removed in site migration work and did not appear to be relocated, as determined during the course of usnistgov/oscal-content#204. We can rely on the metaschema-xslt project, but given OSCAL has the profile resolver tool committed in its repo tree, it stands to reason to rely on its own independent Maven POM file, even if now redundant, as they may diverge in the future.
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Aug 7, 2023
This script is being added to facilitate running XSLT stylesheets, such
as the XML/JSON JSON/XML conversion utilities that will be used in our
oscal-content and related pipelines.

This script will be committed to coincide with testing and review of the
Makefile in usnistgov/oscal-content#204.
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Aug 8, 2023
This script is being added to facilitate running XSLT stylesheets, such
as the XML/JSON JSON/XML conversion utilities that will be used in our
oscal-content and related pipelines.

This script will be committed to coincide with testing and review of the
Makefile in usnistgov/oscal-content#204.
@aj-stein-nist
Copy link
Contributor Author

This is important and still needs to be finished. I will continue work on this in the first half of Sprint 74 and intend to finish it as it is an important prerequisite for many upcoming changes given the tentative roadmap in usnistgov/OSCAL#1867.

@aj-stein-nist aj-stein-nist linked an issue Aug 24, 2023 that may be closed by this pull request
6 tasks
@aj-stein-nist aj-stein-nist mentioned this pull request Aug 25, 2023
5 tasks
@aj-stein-nist aj-stein-nist force-pushed the chore-submodule-v1.1.0-release branch 2 times, most recently from 65c7bc2 to 56a8e5e Compare September 8, 2023 23:23
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Sep 12, 2023
* Correct relative path to previous Maven POM dep file

Add this back as part of sprint work to build new Makefile(s) and recreate profile resolution tooling for local and GHA CI/CD for usnistgov/oscal-content#204.

* Add back pom.xml for Maven deps

This was removed in site migration work and did not appear to be relocated, as determined during the course of usnistgov/oscal-content#204. We can rely on the metaschema-xslt project, but given OSCAL has the profile resolver tool committed in its repo tree, it stands to reason to rely on its own independent Maven POM file, even if now redundant, as they may diverge in the future.
aj-stein-nist added a commit to usnistgov/OSCAL that referenced this pull request Sep 12, 2023
This script is being added to facilitate running XSLT stylesheets, such
as the XML/JSON JSON/XML conversion utilities that will be used in our
oscal-content and related pipelines.

This script will be committed to coincide with testing and review of the
Makefile in usnistgov/oscal-content#204.
Arminta-Jenkins-NIST pushed a commit to usnistgov/OSCAL that referenced this pull request Sep 12, 2023
* Correct relative path to previous Maven POM dep file

Add this back as part of sprint work to build new Makefile(s) and recreate profile resolution tooling for local and GHA CI/CD for usnistgov/oscal-content#204.

* Add back pom.xml for Maven deps

This was removed in site migration work and did not appear to be relocated, as determined during the course of usnistgov/oscal-content#204. We can rely on the metaschema-xslt project, but given OSCAL has the profile resolver tool committed in its repo tree, it stands to reason to rely on its own independent Maven POM file, even if now redundant, as they may diverge in the future.
Arminta-Jenkins-NIST pushed a commit to usnistgov/OSCAL that referenced this pull request Sep 12, 2023
This script is being added to facilitate running XSLT stylesheets, such
as the XML/JSON JSON/XML conversion utilities that will be used in our
oscal-content and related pipelines.

This script will be committed to coincide with testing and review of the
Makefile in usnistgov/oscal-content#204.
@aj-stein-nist aj-stein-nist linked an issue Sep 21, 2023 that may be closed by this pull request
@aj-stein-nist aj-stein-nist force-pushed the chore-submodule-v1.1.0-release branch 4 times, most recently from 3b14a16 to 74c7398 Compare October 6, 2023 22:02
@aj-stein-nist aj-stein-nist changed the title Update content to use OSCAL v1.1.0 models Update content to use OSCAL v1.1.1 models Oct 6, 2023
@aj-stein-nist aj-stein-nist requested a review from a team October 6, 2023 22:04
As picked up in review with Nikita, we are converting the source XML
files to JSON and YAML, but not all. We need to adjust the make vars
that collect the source files for conversion to minified JSON to Include
the resolved catalogs from profiles from the previous step. Reviewing
the auto-committed test content confirm these files were being missed in
conversion to JSON and YAML and we obviously need those.
Per discussion with Nikita during PR review and pairing, we should try
to adjust the jq and yq dep install and management approach to be a
little more ergonomic. As for xmllint, it was requested we align that
to work like the dep mgmt in the usnistgov/OSCAL repo, since that is a
compiled dep that is not offered statically and is best handled as a
concern by the developer in their operating system, or by a dedicated
install step in GHA workflows.

Additionally, for these reasons, the clean wrapper target will not
include deleting it as a default, but can be added later by a developer
by explicitly requesting it.
Per PR review and consultation from Nikita, add in additional wrapper
targets for artifacts and checks for better organization and to make a
cleaner hierarchy for the make all target.
As discussed in the branch under review in #204, we now have absolute
paths in the resolved catalogs based on the full paths to the profile,
which is less than idea for published catalogs.

Comment with explanation:
#204 (comment)

Example:
https://github.com/aj-stein-nist/oscal-content/blob/dc5500ed9371b485fc21cb095d2fb9db6e2a1fd3/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline-resolved-profile_catalog.xml#L11

To work around this for the time being, we are using sed in the Makefile
to clean up once profile resolution is done and before the XML source is
converted to the target JSON and YAML.
Per PR review with Nikita, cite documentation for `make` and `Makefile`
on how `$(@d)` is an alias to show to the the target wildcard file
without the filename, useful for creating nested directories of content
before copying.
After debugging with @nikitawootten-nist, we determined during pairing
that the SECONDEXPANSION calls, that are necessary to avoid some more
hacky kludges with macros and functions. As it stands, when running with
concurrent jobs (`-jN` with N>=2) it fails. We determined the cause of
the failures for `convert-min-json-content` and `convert-yaml-content`
targets are because those target prerequisites are flawed.

This change will be greedy and presume all respective XML files for JSON
targets and all JSON files for YAML targets. This will limit the upper
bound of concurrent jobs for these targets, but makes it correct and
safe.
@aj-stein-nist aj-stein-nist force-pushed the chore-submodule-v1.1.0-release branch from 99669b4 to bbdcac7 Compare October 20, 2023 19:59
@aj-stein-nist
Copy link
Contributor Author

Doing some more testing but the concurrency fix as I committed is still not working perfectly.

https://github.com/aj-stein-nist/oscal-content/actions/runs/6592140253/job/17912204423

Catching up on Makefile docs and tutorials while debugging locally and GHA to figure out if I did it in the wrong target location or this is not sufficient as discussed during pairing. 😭

@aj-stein-nist aj-stein-nist force-pushed the chore-submodule-v1.1.0-release branch from 65292a1 to 5a07896 Compare October 24, 2023 01:31
@aj-stein-nist
Copy link
Contributor Author

It seems with c881404 we are very close (thanks to @nikitawootten-nist for #219) but I still see a regression in the sed path transformation that is not being handled in the latest testing on my fork as of aj-stein-nist/oscal-content@7392f08. Once that is wrapped up, this is ready.

* Rearranged targets, fixed build race conditions

* Added a check for MacOS/Linux semantics
@aj-stein-nist aj-stein-nist force-pushed the chore-submodule-v1.1.0-release branch 2 times, most recently from f95c749 to e96e2b5 Compare October 24, 2023 18:21
@aj-stein-nist
Copy link
Contributor Author

aj-stein-nist commented Oct 24, 2023

I removed the testing commit to change the HOME_REPO, but this is ready for final review. Sample from my fork simiulating the merge to main is in aj-stein-nist/oscal-content@a45245e.

/cc @usnistgov/itl-oscal

Copy link
Contributor

@nikitawootten-nist nikitawootten-nist left a comment

Choose a reason for hiding this comment

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

All works, all approved. Small nitpick below but it can be safely ignored

Edit: I deleted the nit as it may cause confusion down the line if oscal content includes resolved profiles with multiple inputs.

@aj-stein-nist aj-stein-nist merged commit 1cad230 into develop Oct 24, 2023
@aj-stein-nist aj-stein-nist deleted the chore-submodule-v1.1.0-release branch October 24, 2023 19:13
aj-stein-nist added a commit that referenced this pull request Oct 24, 2023
As discussed in the branch under review in #204, we now have absolute
paths in the resolved catalogs based on the full paths to the profile,
which is less than idea for published catalogs.

Comment with explanation:
#204 (comment)

Example:
https://github.com/aj-stein-nist/oscal-content/blob/dc5500ed9371b485fc21cb095d2fb9db6e2a1fd3/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline-resolved-profile_catalog.xml#L11

To work around this for the time being, we are using sed in the Makefile
to clean up once profile resolution is done and before the XML source is
converted to the target JSON and YAML.
aj-stein-nist added a commit to aj-stein-nist/oscal-content-forked that referenced this pull request Oct 27, 2023
As discussed in the branch under review in usnistgov#204, we now have absolute
paths in the resolved catalogs based on the full paths to the profile,
which is less than idea for published catalogs.

Comment with explanation:
usnistgov#204 (comment)

Example:
https://github.com/aj-stein-nist/oscal-content/blob/dc5500ed9371b485fc21cb095d2fb9db6e2a1fd3/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline-resolved-profile_catalog.xml#L11

To work around this for the time being, we are using sed in the Makefile
to clean up once profile resolution is done and before the XML source is
converted to the target JSON and YAML.
aj-stein-nist added a commit to aj-stein-nist/oscal-content-forked that referenced this pull request Oct 27, 2023
As discussed in the branch under review in usnistgov#204, we now have absolute
paths in the resolved catalogs based on the full paths to the profile,
which is less than idea for published catalogs.

Comment with explanation:
usnistgov#204 (comment)

Example:
https://github.com/aj-stein-nist/oscal-content/blob/dc5500ed9371b485fc21cb095d2fb9db6e2a1fd3/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline-resolved-profile_catalog.xml#L11

To work around this for the time being, we are using sed in the Makefile
to clean up once profile resolution is done and before the XML source is
converted to the target JSON and YAML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants