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

refactor!: #388 update types to use pointers #410

Conversation

mike-winberry
Copy link
Contributor

@mike-winberry mike-winberry commented May 7, 2024

Description

...

Related Issue

#388
#403

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)
  • Breaking refactor

Checklist before merging

@mike-winberry mike-winberry linked an issue May 7, 2024 that may be closed by this pull request
3 tasks
Copy link

netlify bot commented May 7, 2024

Deploy Preview for lula-docs canceled.

Name Link
🔨 Latest commit a2e35b2
🔍 Latest deploy log https://app.netlify.com/sites/lula-docs/deploys/664faf03941c200008c183de

@mike-winberry mike-winberry added the enhancement New feature or request label May 7, 2024
@mike-winberry mike-winberry self-assigned this May 7, 2024
mike-winberry and others added 15 commits May 7, 2024 13:34
refactor!(component): change NewOscalComponentDefinitionFromBytes to return a pointer
…rce for the extension

refactor!(catalog): now uses pointers
… source in favor of oscal validation

refactor!(component): delete the NewOscalComponentDefinitionFromBytes method in favor of NewOscalComponentDefinition
refactor!(common): rename WriteFile -> WriteOscalModel
refactor(generate): WriteFile -> WriteOscalModel
refactor(composition): removed validation logic in favor of NewOscalCOmponentDefinition handling it
feat(common): WriteOscalModel now handles json file extensions
feat(evaluate): now runs file extension validation for json/yaml
feat(validate): now checks input file for extension
tests: update tests, update test data to pass oscal validation
…nstructors and updated all relavant constructors
…talog to use pointers

refactor(generate): update all refs to ComponentFromCatalog
@mike-winberry mike-winberry marked this pull request as ready for review May 15, 2024 00:54
Copy link
Collaborator

@meganwolf0 meganwolf0 left a comment

Choose a reason for hiding this comment

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

A couple things I noticed:

  • When I tried composing some local files I have, I noticed sometimes the rego would be just a giant string (which is real hard to read/edit) and other times it was actually formatted properly. I had both seemingly structured the same by the look of things in the editor, but I assume there's some hidden characters there that's messing with the input/output. Wondering if that's something we could fix? (see pepr_validations branch in compliance-artifacts for the pepr.yaml I composed.) I suppose it's down to if we intend people to edit these after they've been composed
  • During this exercise I also noticed that some empty fields in the validation.yaml were being rendered as well (for the respective 'spec' chosen, e.g., Kubernetes-spec shows empty field and wait fields). Wondering if we should pointer-ize those too? (also possibly add some omitempty's)

@mike-winberry
Copy link
Contributor Author

mike-winberry commented May 15, 2024

  • When I tried composing some local files I have, I noticed sometimes the rego would be just a giant string (which is real hard to read/edit) and other times it was actually formatted properly. I had both seemingly structured the same by the look of things in the editor, but I assume there's some hidden characters there that's messing with the input/output. Wondering if that's something we could fix? (see pepr_validations branch in compliance-artifacts for the pepr.yaml I composed.) I suppose it's down to if we intend people to edit these after they've been composed
  • this has to do with bad formatting in the yaml, usually spaces in the front of the string, if it is formatted/linted yaml it shouldn't do this
  • we had this issue before on the dev validate command, and I added something to go-oscal to strip the additional whitespace. Ill look and see if I can do the same when composing
  • added a note to Decompose OSCAL and Validations #397 to validate the formatting (strip whitespace) prior to outputting the validations.

meganwolf0
meganwolf0 previously approved these changes May 22, 2024
@mike-winberry mike-winberry merged commit 9c51d56 into main May 23, 2024
8 checks passed
@mike-winberry mike-winberry deleted the 388-discussion-should-we-move-our-types-to-pointers-similar-to-go-oscal branch May 23, 2024 21:10
This was referenced May 23, 2024
This was referenced Jun 29, 2024
This was referenced Jul 12, 2024
This was referenced Aug 5, 2024
This was referenced Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
3 participants