feat: Add compliance field to versions#20
Open
mtruj013 wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new compliance field to product deployment versions, supporting structured compliance framework/status metadata end-to-end (DB model + migration, API schemas, and create/update flows), along with tests validating success and 400s for invalid values.
Changes:
- Add
complianceJSON column to theVersionmodel and an Alembic migration to create/drop it. - Introduce
ComplianceSchemaand wirecomplianceinto version create/update/request/response schemas with enum validation. - Add test coverage for creating/updating
complianceand for rejecting unknown framework/status values.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/views.py | Extends version creation to accept/persist compliance. |
| webapp/schemas.py | Adds ComplianceSchema and exposes/validates compliance across version schemas. |
| webapp/models.py | Adds compliance JSON column to Version. |
| webapp/constants.py | Defines allowed compliance frameworks and statuses for validation. |
| tests/test_update_product_deployment_version.py | Adds PUT tests for updating compliance and invalid values. |
| tests/test_create_product_deployment_version.py | Adds POST tests for creating compliance and invalid values. |
| tests/fixtures/models.py | Updates version fixture defaults to include compliance. |
| migrations/versions/d0dc7df37935_add_compliance_field_to_versions.py | Adds migration to create/drop the versions.compliance column. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Onibenjo
reviewed
Jun 17, 2026
Onibenjo
left a comment
There was a problem hiding this comment.
"compliance": [
{"framework": "CIS", "status": "Achieved"},
{"framework": "CIS", "status": "Expired"},
],
passing duplicate frameworks with different statuses are silently accepted.
We should have a validation to check for this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Done
QA
docker compose up -dthendotrunIssue / Card
https://warthogs.atlassian.net/browse/WD-37230