-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ORCA-4600] Add support for cache variables #149
[ORCA-4600] Add support for cache variables #149
Conversation
type EventOrchestrationCacheVariable struct { | ||
ID string `json:"id,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Disabled bool `json:"disabled,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think omitempty
needs to be removed from the Disabled
property because it drops "falsy" fields from the payload. And here is what's classified as a falsy field, according to the docs:
The "omitempty" option specifies that the field should be omitted from the encoding if the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, slice, map, or string.
So basically if they want to send disabled: false
they won't be able to do it. We had a similar issue with EOs where a customer created a Router with disabled rules first, then tried setting them to disabled: false
, and the new values kept getting ignored because they were never sent to the API.
ID string `json:"id,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Disabled bool `json:"disabled,omitempty"` | ||
Conditions []*EventOrchestrationCacheVariableCondition `json:"conditions,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And same with Conditions
- because we want to be able to send empty arrays we should remove omitempty
.
} | ||
} | ||
|
||
func TestGlobalOrchestrationICacheVariableUpdate(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in TestGlobalOrchestrationICacheVariableUpdate
func TestGlobalOrchestrationICacheVariableUpdate(t *testing.T) { | |
func TestGlobalOrchestrationCacheVariableUpdate(t *testing.T) { |
} | ||
} | ||
|
||
func TestGlobalOrchestrationIntegrationDelete(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in TestGlobalOrchestrationIntegrationDelete
func TestGlobalOrchestrationIntegrationDelete(t *testing.T) { | |
func TestGlobalOrchestrationCacheVariableDelete(t *testing.T) { |
setup() | ||
defer teardown() | ||
|
||
oId := "a64f9c87-6adc-4f89-a64c-2fdd8cba4639" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Let's maybe change the oId
here and in all service Cache Var tests below to a valid obfuscated service ID to reflect the real world scenario more accurately?
} | ||
} | ||
|
||
func TestServiceOrchestrationICacheVariableUpdate(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in TestServiceOrchestrationICacheVariableUpdate
func TestServiceOrchestrationICacheVariableUpdate(t *testing.T) { | |
func TestServiceOrchestrationCacheVariableUpdate(t *testing.T) { |
} | ||
} | ||
|
||
func TestServiceOrchestrationIntegrationDelete(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in TestServiceOrchestrationIntegrationDelete
func TestServiceOrchestrationIntegrationDelete(t *testing.T) { | |
func TestServiceOrchestrationCacheVariableDelete(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Probably worth it to leave it as a draft PR since we can't merge this until the Public API docs go live
5279d06
to
c11bc4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c-kaieong there are a couple of comments to address before moving forward with merge/approval. Other than that, good job 👍🏽
I'd also prefer to leave this as a Draft PR in the meantime. |
@imjaroiswebdev I just now published pubic REST API docs that are used by this API. For example: https://developer.pagerduty.com/api-reference/a87e8f7117af9-create-a-cache-variable-for-a-global-event-orchestration The Cache Variables feature in Event Orchestration is now officially GA for all customers so we're ready to merge this PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! We are ready to merge now 💪🏽
Add CRUD support for Event Orchestration Cache Variables