-
Notifications
You must be signed in to change notification settings - Fork 23
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(cmd): #281 Create upgrade command implementing go-oscal revise. #295
feat(cmd): #281 Create upgrade command implementing go-oscal revise. #295
Conversation
…utput to file. Wait on next go-oscal release for utilities needed to handle more succinctly
✅ Deploy Preview for lula-docs canceled.
|
…-a-tools-upgrade-command
…to handle upgrading. Update .gitignore to ignore launch.json
So I tried this out on the tempo validation I've been working and it had the mildly annoying result of moving all the fields around and smashing down my formatted |
hhmm... yeah this makes a lot of sense that it would do this given the underlying sting datatype and how we write validations. Unfortunate side-effect - if there is anything we can do to retain that structure then great - otherwise it certainly adds more evidence to needing a system that is more compatible. |
I will create a story to look into it and see what I can do today. My understanding right now as to why, is that the golang map is unordered, and since json and yaml are considered to also be unordered data, the marshalling and unmarshaling process doesn't guarantee order. I have some ideas on how to deal with that but will have to play a bit in go-oscal today and see what works out. I think another thing that could be done is looking at yaml formatters and run one before output. (for the string issue). |
…and to match new return values. Update upgrade command to use the new RevisionCommand from go-oscal
… formatting visually changing, but maintaining object equality.
…-a-tools-upgrade-command
…-a-tools-upgrade-command
… -r ResultFile optional param for the output of the ValidationResult file. Update pod_validation_test to upgrade the component-definition to a temp file and then use that temp file to run the assess tests, updated the associated oscal-component.yaml to pass linting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality is working as I would expect. Appreciate updates / modifications and testing in a manner that won't modify existing artifacts.
Also I found the issue that @meganwolf0 was encountering. It has to do with trailing whitespace. It is a current issue with the go yaml implementation go-yaml/yaml#880. But if all trailing spaces are removed it no longer serializes the block/folded strings into double quotes. And is something that could be brought into go-oscal where we trim all empty trailing spaces from lines. So it is a yaml formatting problem. I think that with the right linter it would be caught but an empty space after something like |
@mike-winberry I need to think more about edge cases but otherwise that sounds like a great issue for go-OSCAL |
Have this open right now. With the resulting after removing whitespace. |
lula tools upgrade
commanduprade
command will warn if not upgrading to latest version.lint
command will warn if not the latest version.lint
command now has optional-r
--result-file
param that will output theValidationResult
if defined.lula tools lint
with changes to ValidationCommandscenarios/pod-label/component-definition.yaml
to passlula lint
.