Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Azure Queue Storage Source - Add Visibility timeout parameter#1383

Merged
FranBarrera merged 6 commits intotriggermesh:mainfrom
FranBarrera:azqueuestoragesource-timeout
Mar 31, 2023
Merged

Azure Queue Storage Source - Add Visibility timeout parameter#1383
FranBarrera merged 6 commits intotriggermesh:mainfrom
FranBarrera:azqueuestoragesource-timeout

Conversation

@FranBarrera
Copy link
Contributor

Closes #1382

This PR adds a new optional parameter to set the visibility timeout to Azure Queue Storage Source following the ISO8601, more info: https://en.wikipedia.org/wiki/ISO_8601

@FranBarrera FranBarrera requested a review from a team March 30, 2023 16:21
@FranBarrera FranBarrera self-assigned this Mar 30, 2023
@tzununbekov
Copy link
Member

nit: k8s' duration format is documented as Go's time.Duration. Timeouts in our components (visibilityTimeout, timeout) are also based on Go's duration format. Some other common K8s components that I was able to check also use time.Duration format. It feels a bit weird to have the same attribute use different input formats inside the same project (even the same "visibilityTimeout" parameter). Why did you decide to switch to ISO format? Is it because of OpenAPI 3.0 spec? Maybe we could do something to make it consistent across the components?

@FranBarrera
Copy link
Contributor Author

nit: k8s' duration format is documented as Go's time.Duration. Timeouts in our components (visibilityTimeout, timeout) are also based on Go's duration format. Some other common K8s components that I was able to check also use time.Duration format. It feels a bit weird to have the same attribute use different input formats inside the same project (even the same "visibilityTimeout" parameter). Why did you decide to switch to ISO format? Is it because of OpenAPI 3.0 spec? Maybe we could do something to make it consistent across the components?

I agree on having something consistent across the components but go time is language specific, while ISO is a standard.

Knative uses ISO for durations too: https://knative.dev/docs/eventing/event-delivery/#configuring-subscription-event-delivery
Maybe we should move other components to ISO? We already have brokers using ISO.

@tzununbekov
Copy link
Member

Go time format is natively supported by k8s, so I don't see why we can't keep using it. Personally, I'm not a fan of the ISO format because it's not intuitive, but having the same attributes declared in different formats is even worse than that. Hence, if you think that switching to the ISO is essential and worth introducing breaking change, then go for it. Hopefully, we will not follow Knative's specification style in the future.

@FranBarrera
Copy link
Contributor Author

Ok, no problem, I'll revert it to go time and then we can discuss what standard we should use

@tzununbekov
Copy link
Member

That works for me, thank you. I noticed that the core k8s components use <param>Seconds attribute name to avoid any confusion in formats. Maybe we could use a similar approach. The only concern is backward compatibility for SQS source spec.

@FranBarrera FranBarrera merged commit f9085f9 into triggermesh:main Mar 31, 2023
@FranBarrera FranBarrera deleted the azqueuestoragesource-timeout branch March 31, 2023 10:21
sameersbn pushed a commit that referenced this pull request Apr 5, 2023
* Azure Queue Storage Source - Add visibility timeout parameter

* Azure Queue Storage Source - Add visibility timeout parameter

* Check timeout is a maximum of 7 days

* Change to go time

* Fix go.mod

* Add sample
@jmcx
Copy link
Contributor

jmcx commented May 12, 2023

Sources_-_TriggerMesh

@FranBarrera any chance we can get some better documentation for the attribute to appear in the CRD?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AzureQueueStorageSource - Configurable Timeout Support

4 participants