Skip to content

feat: Add compliance field to versions#20

Open
mtruj013 wants to merge 3 commits into
mainfrom
add-compliance-fields
Open

feat: Add compliance field to versions#20
mtruj013 wants to merge 3 commits into
mainfrom
add-compliance-fields

Conversation

@mtruj013

@mtruj013 mtruj013 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Done

  • Added compliance fields to version schema and related tests

QA

  • See that tests pass
  • Alternatively, check out this feature branch
  • Run the site using the commands docker compose up -d then dotrun
  • Test with the following curls

Issue / Card

https://warthogs.atlassian.net/browse/WD-37230

Copilot AI review requested due to automatic review settings June 16, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 compliance JSON column to the Version model and an Alembic migration to create/drop it.
  • Introduce ComplianceSchema and wire compliance into version create/update/request/response schemas with enum validation.
  • Add test coverage for creating/updating compliance and 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.

Comment thread tests/test_create_product_deployment_version.py Outdated
Comment thread tests/test_create_product_deployment_version.py Outdated
@mtruj013 mtruj013 marked this pull request as draft June 16, 2026 19:58
mtruj013 and others added 2 commits June 17, 2026 15:34
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>
@mtruj013 mtruj013 marked this pull request as ready for review June 17, 2026 19:46

@Onibenjo Onibenjo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants