Skip to content
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

Add azurerm_data_factory_trigger_tumbling_window resource #9127

Closed
wants to merge 5 commits into from

Conversation

dnlbunting
Copy link
Contributor

@dnlbunting dnlbunting commented Nov 2, 2020

Closes #9126

Couple of things to call out for the reviewer:

  • The triggers API manages trigger start/stopping separately from create/destroy, this resource is dealing touching start/stop, but the API won't allow updates to a running trigger, which can cause apply to fail with an error telling the user to pause the trigger and try again. I'm open to suggestion about the best way to handle this behaviour.

  • There's validation in the trigger_dependency block that I couldn't figure out how to handle at plan time, namely if trigger is not set offset must be negative

  • I added additional TestChecks that that verify that the trigger can successful be started, which should catch the class of bugs like Field pipelineReference missing in Data Factory triggers #6869, and stopped again with no diff because the going though a start/stop cycle changes the result of API get slightly, stuff like "" -> nil

  • I'm pretty new to Go so if anything looks awkward to not idiomatic let me know :)

@ghost ghost added the size/XL label Nov 2, 2020
@dnlbunting dnlbunting changed the title [WIP] Add azurerm_data_factory_trigger_tumbling_window resource closes #9126 [WIP] Add azurerm_data_factory_trigger_tumbling_window resource Nov 2, 2020
@ghost ghost added documentation size/XXL and removed size/XL labels Nov 5, 2020
@dnlbunting dnlbunting marked this pull request as ready for review November 5, 2020 16:27
@dnlbunting dnlbunting changed the title [WIP] Add azurerm_data_factory_trigger_tumbling_window resource Add azurerm_data_factory_trigger_tumbling_window resource Nov 5, 2020
@dnlbunting
Copy link
Contributor Author

Hey @tombuildsstuff @mbfrahry would it be possible to get a review on this, still keen to get this resources merged, thanks!

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dnlbunting - sorry its taken so long to review. I've given this a look over and it's off to a great start. Iv'e left some comments inline to address and it should be good to merge after they are resolved.


Manages a Tumbling Window Trigger inside an Azure Data Factory.

Datafactory triggers are created in the "Stopped" state and must be manually enabled to start triggering. The API prevents updates to triggers in the "Started" state, so they must be manually paused before running terraform apply.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we pause them, update, and restart if needed?

resource_group_name = "example"

pipeline_parameters = {
example = "@{formatDateTime(trigger().outputs.windowStartTime,'yyyy-MM-dd')}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we pass this in formatted instead of this rather unclear series of functions


* `data_factory_name` - (Required) The name of the Azure Data Factory to associate the Trigger with. Changing this forces a new Tumbling Window Trigger to be created.

* `pipeline_name` - (Required) The name of the pipeline to be triggered, there is a one to one relationship between pipelines and Tumbling Window Triggers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this make more sense as

Suggested change
* `pipeline_name` - (Required) The name of the pipeline to be triggered, there is a one to one relationship between pipelines and Tumbling Window Triggers.
* `triggered_pipeline_name` - (Required) The name of the pipeline to be triggered, there is a one to one relationship between pipelines and Tumbling Window Triggers.

})
}

func TestAccAzureRMDataFactoryTriggerTumblingWindow_complete(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this updates it should be

Suggested change
func TestAccAzureRMDataFactoryTriggerTumblingWindow_complete(t *testing.T) {
func TestAccAzureRMDataFactoryTriggerTumblingWindow_update(t *testing.T) {

@katbyte
Copy link
Collaborator

katbyte commented May 25, 2021

hey @dnlbunting - as its been about a month with no response and there are conflicts now i'm going to close this PR. but once you have time and fix it up please to open a new PR and we can get this merged!

@katbyte katbyte closed this May 25, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for datafactory tumbling window triggers
4 participants