Repository navigation
Feat: add AiEventsOnly and ApiKeyIds to subscription filters - #502
Merged
Merged
Conversation
Leaving either field unset keeps the subscription's current value on update. An empty ApiKeyIds slice clears the API key filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gb-8
marked this pull request as ready for review
November 17, 2026 05:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
liam-mackie
approved these changes
Nov 17, 2026
liam-mackie
left a comment
Contributor
There was a problem hiding this comment.
Minor nit, but the code is fine ![]()
| Tenants []string `json:"Tenants"` | ||
| Users []string `json:"Users"` | ||
| // ApiKeyIds limits the subscription to events raised with these API keys. Leave it nil to keep the | ||
| // subscription's current API keys when updating it; an empty slice clears them. Older servers ignore it. |
Contributor
There was a problem hiding this comment.
Older servers ignore it
Nit: It would be nice if this comment was less verbose and stated the server version(s) this is supported from.
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.
Octopus Server now has two more subscription filters: AI events only and API keys (OctopusDeploy#50233). This adds them to
EventNotificationSubscriptionFilter, so the Terraform provider can manage them (LEV-2325).Changes
ApiKeyIds []string: the IDs of the API keys whose events the subscription is limited to.AiEventsOnly *bool: limits the subscription to events by AI agents.Leaving a filter unset keeps it
If an update sends either field as
nullor leaves it out, the server keeps its current value. That stops a client that doesn't know about a filter from clearing it by mistake. The JSON tags are set up so that:ApiKeyIdsis sent asnull(keep), and an empty slice is sent as[](clear).AiEventsOnlyis left out of the request (keep).NewSubscriptionleaves both nil, so code that builds a subscription and saves it won't clear either filter.When a subscription is created, an unset
ApiKeyIdsmeans no API key filter, and an unsetAiEventsOnlymeansfalse.Older servers ignore both fields.
Tests
Three JSON tests cover reading the fields, leaving them unset, and clearing the API keys with an empty slice. Each fails if its JSON tag is wrong.
Merging
OctopusDeploy#50233 is merged, and is in server builds from 2026.4.12560 onwards. It will be in the 2026.4 release. This is safe to merge and release before that, since older servers ignore both fields.
The Terraform provider change that uses this is OctopusDeploy/terraform-provider-octopusdeploy#324.
🤖 Generated with Claude Code