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

Validation broken when loading split models via -t #1694

Open
rahearn opened this issue Sep 9, 2024 · 1 comment
Open

Validation broken when loading split models via -t #1694

rahearn opened this issue Sep 9, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation investigate

Comments

@rahearn
Copy link
Contributor

rahearn commented Sep 9, 2024

Describe the bug

Validation returns incorrect failures when called with the -t flag, at least for -t system-security-plan when the model has been split using trestle split

To Reproduce

Steps to reproduce the behavior:

  1. Create a new system-security-plan trestle create -t system-security-plan -o validate-test
  2. Edit ssp to put a valid profile href in
  3. Verify that trestle validate -f system-security-plans/validate-test/system-security-plan.json and trestle validate -t system-security-plan -n validate-test correctly report that the model is valid
  4. Split the model: trestle split -f system-security-plans/validate-test/system-security-plan.json -e "system-security-plan.metadata"
  5. Verify that trestle validate -f system-security-plans/validate-test/system-security-plan.json still reports that the model is valid
  6. Try to validate with trestle validate -t system-security-plan -n validate-test

Expected behavior

The model is still valid

Actual behavior

Step 6 reports that the model has extra fields.

Screenshots / Logs.

Screenshot 2024-09-09 at 3 40 45 PM

Environment

  • OS: docker
  • Python version: 3.11
  • Installed packages: compliance-trestle 3.4.0
@rahearn
Copy link
Contributor Author

rahearn commented Sep 9, 2024

It's popping that issue when assigning things to the pydantic.v1.main.SystemSecurityPlan stripped model, but I don't know why it's an issue for -t/-n and not for either -f or -a versions of the command.

@jpower432 jpower432 added this to the v3.5.0 milestone Sep 16, 2024
@jpower432 jpower432 added the documentation Improvements or additions to documentation label Oct 2, 2024
@jpower432 jpower432 removed this from the v3.4.1 milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation investigate
Projects
Status: Ready
Development

No branches or pull requests

3 participants