Skip to content

FIX BED-8688: Make Policy model validation requirements less strict#8

Open
d3vzer0 wants to merge 6 commits into
mainfrom
fix/BED-8688
Open

FIX BED-8688: Make Policy model validation requirements less strict#8
d3vzer0 wants to merge 6 commits into
mainfrom
fix/BED-8688

Conversation

@d3vzer0

@d3vzer0 d3vzer0 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Added several (Policy) model changes to fix/prevent issues for the following:

  • retry_event: Model validation fails when the retry_event field contains a value not defined in the Retry enum. This change removes the Enum and accepts any (string) value.
  • user_groups: It seems that the JAMF API can return user_groups in different formats. Added a secondary format to accept both a list containing a key/value dict or a list containing simple strings.
  • Various model changes: Modified several models to not interpret field values as type Any but force the value to be read (and stored) as a string. This does not fix an existing issue, but may prevent future issues where the API response may return multiple types for the same field, which may cause the pipeline to fail.

@d3vzer0 d3vzer0 marked this pull request as draft June 18, 2026 07:56

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 updates the Jamf Policy Pydantic models to be more tolerant of Jamf API response shape/typing variability, preventing validation failures in the collection pipeline.

Changes:

  • Removes strict enums for trigger and retry_event, accepting any string value.
  • Broadens model fields intended to handle inconsistent Jamf API formats (e.g., user group representations).
  • Refactors several nested structures (e.g., self service categories, packages, dock items) into dedicated models / stricter annotations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated
Comment thread src/openhound_jamf/models/policy.py Outdated

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/openhound_jamf/models/policy.py
Comment thread src/openhound_jamf/models/policy.py
@d3vzer0 d3vzer0 marked this pull request as ready for review June 18, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants