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

buildkite_pipeline provider settings docs appear to be incorrect concerning some default values #601

Open
erikkrieg opened this issue Dec 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@erikkrieg
Copy link

erikkrieg commented Dec 23, 2024

Describe the bug
I was trying out Buildkite for the first time and setting it up using the official Terraform provider. I got a cluster, agent and pipeline setup with access to my GitHub repo but was having trouble getting jobs to actually trigger on my pull request (only had success triggering new builds manually from the Buildkite web app).

When reading over settings in the TF docs, I saw:

  • build_branches (Boolean) Whether to create builds when branches are pushed. Defaults to true when trigger_mode is set to code.
  • build_pull_requests (Boolean) Whether to create builds for commits that are part of a pull request. Defaults to true when trigger_mode is set to code.

Based on this, I was under the impression that all I needed for my provider settings to enable my desired pipeline triggers was:

  provider_settings = {
    trigger_mode = "code"
  }

After debugging for some time I discovering in the UI what the actual values were. The "trigger builds after pushing code" section was enabled, but no sub-options, like "build pull requests" were enabled.

So it appears that the buildkite_pipeline resource is actually setting these options to false as the default.

To Reproduce
Steps to reproduce the behavior:

  1. Create a buildkite_pipeline with provider_settings.trigger_mode = "code", omitting other options
  2. Apply... (I did go through several iterations of apply resources while learning about the available settings)
  3. View terraform state for the created pipeline (i.e. terraform state show buildkite_pipeline.example)
   provider_settings                        = {
        build_branches                                = false
        build_pull_request_forks                      = false
        build_pull_request_labels_changed             = false
        build_pull_request_ready_for_review           = false
        build_pull_requests                           = false
        build_tags                                    = false
        cancel_deleted_branch_builds                  = true
        filter_condition                              = ""
        filter_enabled                                = false
        prefix_pull_request_fork_branch_names         = false
        publish_blocked_as_pending                    = false
        publish_commit_status                         = false
        publish_commit_status_per_step                = false
        pull_request_branch_filter_configuration      = ""
        pull_request_branch_filter_enabled            = false
        separate_pull_request_statuses                = false
        skip_builds_for_existing_commits              = false
        skip_pull_request_builds_for_existing_commits = false
        trigger_mode                                  = "code"
    }

Expected behavior
Either the TF provider settings docs should be updated to reflect the actual defaults (false), or the resource should be updated to set build_branches, build_pull_requests, publish_commit_status and skip_pull_request_builds_for_existing_commits as true by default when trigger_mode is "code", as suggested by the current docs.

Additional context
Terraform and provider versions used:

❯ terraform version
Terraform v1.10.3
on darwin_arm64
+ provider registry.terraform.io/buildkite/buildkite v1.15.1
@erikkrieg erikkrieg added the bug Something isn't working label Dec 23, 2024
@erikkrieg erikkrieg changed the title In accuracies in Buildkite Terraform provider docs. Inaccuracies in Buildkite Terraform provider docs. Dec 23, 2024
@erikkrieg erikkrieg changed the title Inaccuracies in Buildkite Terraform provider docs. buildkite_pipeline provider settings docs appear to be incorrect concerning some default values Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant