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
Adding support for servicehooks (azure storage queue consumer) #914
Conversation
…r-azuredevops into feat-subscription
@rdalbuquerque can you help add documentation for |
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.
@rdalbuquerque Thanks for submit this PR. There is so many consumer and publisher types and they have a relation m <-> m
. What I think is add new resource based on the consumer type and publisher type.
azuredevops/internal/service/servicehook/resource_servicehook_storage_queue.go
Outdated
Show resolved
Hide resolved
ok so you are proposing we have a resource per publisher type per consumer type. if so, this resource would be changed to: resource "azuredevops_servicehook_pipelines_storage_queue" "this" {
project_id = data.azuredevops_project.this.id
account_name = "mystorageacc"
account_key = random_string.account_key.result
queue_name = "myqueue"
visi_timeout = 30
stage_state_changed {
state_filter = "Completed"
result_filter = "Succeeded"
}
} I will continue to the other comments after you confirmation. Thanks! |
@rdalbuquerque I prefer to name it in the format of |
Some acceptance tests are still failing. Debugging it, looks like it's something related to the resource "azuredevops_servicehook_storage_queue_pipelines" "example" {
project_id = azuredevops_project.example.id
account_name = azurerm_storage_account.example.name
account_key = azurerm_storage_account.example.primary_access_key
queue_name = azurerm_storage_queue.example.name
visi_timeout = 30
published_event = "RunStateChanged"
event_config {
run_state_filter = "Completed"
run_result_filter = "Succeeded"
}
} |
Ok, added more acceptance tests and they are passing now. :) refactored again so it's easier to validate and more intuitive to read imo resource "azuredevops_servicehook_storage_queue_pipelines" "example" {
project_id = azuredevops_project.example.id
account_name = azurerm_storage_account.example.name
account_key = azurerm_storage_account.example.primary_access_key
queue_name = azurerm_storage_queue.example.name
visi_timeout = 30
published_event = "RunStateChanged"
run_state_changed_event {
run_state_filter = "Completed"
run_result_filter = "Succeeded"
}
} |
azuredevops/internal/service/servicehook/pipelines_publisher.go
Outdated
Show resolved
Hide resolved
|
All Submissions:
What about the current behavior has changed?
Adding support for servicehooks with a first resource
azuredevops_servicehook_storage_queue
Does this introduce a change to
go.mod
,go.sum
orvendor/
?servicehooks
fromazure-devops-go-api
wasn't available yetDoes this introduce a breaking change?
Other information
Servicehooks has consumers and publishers. In the proposed design for Servicehooks, each consumer will have its own dedicated resource. This resource will include a publisher block, allowing users to configure their preferred publisher. The design is intended to be flexible, accommodating new publishers as user needs evolve. Accordingly, new resources will be developed to support these emerging consumers.
I guess there is 4 options:
This is currently how the resource looks like:
Looking forward to discussing the options and the code 😄