Add notification rule, project/team scoping, and publisher data source#1
Merged
Add notification rule, project/team scoping, and publisher data source#1
Conversation
Add support for configuring DependencyTrack notifications via Terraform: - dependencytrack_notification_rule: manages notification rules with full support for event-driven and scheduled triggers, all notification groups (SYSTEM and PORTFOLIO scopes), publisher config, notify_on, message, notify_children, log_successful_publish, schedule_cron, and schedule_skip_unchanged options. - dependencytrack_notification_rule_project: scopes a notification rule to a specific project (PORTFOLIO scope only). - dependencytrack_notification_rule_team: associates a team with a notification rule (for email publisher). - dependencytrack_notification_publisher (data source): looks up a notification publisher by name to retrieve its UUID. Uses SolarFactories/client-go fork with notification API support (PR DependencyTrack/client-go#56). https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
The Terraform Registry generates docs from the docs/ folder. The notification resources were missing doc files, causing them to not appear on the registry. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
Add SetAttribute (resource/datasource schema), NotificationRule, NotificationPublisher, GetAllRulesFilterOptions, and CreateScheduledNotificationRuleRequest to the exhaustruct exclude list, matching the existing pattern for other client-go and terraform-plugin-framework types. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
Implements CRUD operations for managing notification publishers, including create, read, update, delete, and import support. Registers the new resource in the provider. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
The NotificationRule struct's TriggerType JSON tag lacks omitempty, so an unset field serializes as "" which the server rejects. Set TriggerType explicitly when creating EVENT rules. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
When a publisher or rule is deleted externally, the Read method now removes it from state instead of returning an error, allowing Terraform to plan a recreation. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
Adds a new resource to associate notification rules with tags, allowing rules to be limited to specific tags (PORTFOLIO scope). Uses the TagService API (TagNotificationRules/UntagNotificationRules) which requires DependencyTrack API version >= 4.12. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
When is_latest is set to true, the data source now uses Project.Latest() to find the project by name without requiring a version. Either version or is_latest=true must be provided. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
DependencyTrack returns a 500 error when deleting a rule that still has project, team, or tag associations. The Delete method now removes all associations before attempting deletion. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
CreateScheduledRule sends a request type whose Publisher inner class only accepts uuid, but the Go client serializes extra fields (name, publisherClass, etc.) causing a 400 error. CreateRule accepts the full NotificationRule struct which handles both EVENT and SCHEDULE trigger types correctly. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
The post-create update request copied the API response which could return trigger_type as EVENT. This caused the API to reject scheduleCron with "scheduleCron can not be set for rule with trigger type EVENT". Now explicitly sets TriggerType from the plan value. https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q
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.
Add support for configuring DependencyTrack notifications via Terraform:
dependencytrack_notification_rule: manages notification rules with full
support for event-driven and scheduled triggers, all notification groups
(SYSTEM and PORTFOLIO scopes), publisher config, notify_on, message,
notify_children, log_successful_publish, schedule_cron, and
schedule_skip_unchanged options.
dependencytrack_notification_rule_project: scopes a notification rule
to a specific project (PORTFOLIO scope only).
dependencytrack_notification_rule_team: associates a team with a
notification rule (for email publisher).
dependencytrack_notification_publisher (data source): looks up a
notification publisher by name to retrieve its UUID.
Uses SolarFactories/client-go fork with notification API support
(PR DependencyTrack/client-go#56).
https://claude.ai/code/session_019ocavNKpCndi448shsGs4Q