Skip to content

fix: modify pr branch overrides to use set#61

Open
quixoticmonk wants to merge 6 commits into
CircleCI-Public:mainfrom
quixoticmonk:fix/project_branchoverrides
Open

fix: modify pr branch overrides to use set#61
quixoticmonk wants to merge 6 commits into
CircleCI-Public:mainfrom
quixoticmonk:fix/project_branchoverrides

Conversation

@quixoticmonk

@quixoticmonk quixoticmonk commented Feb 27, 2026

Copy link
Copy Markdown

Description

  • Modified the pr override branch list to use Set.
  • Unable to run the acceptance test locally as it is hardcoded to an existing org id and project id for validation.

If it is ok to move the checks on organization_slug and organization_id to another test; we can update the test to be focused on a user provided org.

Resolves #59

Sample run :

 Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI
│ configuration:
│  - circleci-public/circleci in /Users/manuchn/.local/bin
│
│ The behavior may therefore not match any released version of the provider
│ and applying changes may cause the state to become incompatible with
│ published releases.
╵

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:                + create

Terraform will perform the following actions:

  # circleci_project.test will be created
  + resource "circleci_project" "test" {
      + auto_cancel_builds            = true
      + build_fork_prs                = false
      + disable_ssh                   = false
      + forks_receive_secret_env_vars = false
      + id                            = (known after apply)
      + name                          = "test-pr-overrides-fix"
      + organization_id               = var.org_id
      + organization_name             = (known after apply)
      + organization_slug             = (known after apply)
      + pr_only_branch_overrides      = [
          + "develop",                                                                  + "main",
        ]
      + set_github_status             = true
      + setup_workflows               = true
      + slug                          = (known after apply)
      + vcs_info_default_branch       = (known after apply)
      + vcs_info_provider             = (known after apply)
      + vcs_info_url                  = (known after apply)
      + write_settings_requires_admin = (known after apply)
    }                                                                         Plan: 1 to add, 0 to change, 0 to destroy.

Changes to Outputs:                                                             + project_id = (known after apply)
circleci_project.test: Creating...
circleci_project.test: Creation complete after 0s [id=f97ee4d1-2e0c-4b3a-8878-a88307afe6fc]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

project_id = "f97ee4d1-2e0c-4b3a-8878-a88307afe6fc"

@david-montano-circleci david-montano-circleci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @quixoticmonk . Try to rebase against main. I recently updated the tests to run sequentially to prevent concurrency issues in our testing CircleCI Org.
Also, take a look at the linter issues.

@david-montano-circleci

Copy link
Copy Markdown
Contributor

There is still some errors while identifying the type as String for branch and elem here:

task: [ci:lint] mkdir -p "test-reports"
task: [lint] go tool golangci-lint run ./... \
--output.junit-xml.path "test-reports/lint.xml" --output.junit-xml.extended \
--output.text.path=stdout --output.text.colors=true

internal/provider/project_resource.go:233:4: right hand must be only type assertion (forcetypeassert)
                        branches[index] = branch.(types.String).ValueString()
                        ^
internal/provider/project_resource.go:390:3: right hand must be only type assertion (forcetypeassert)
                prOnlybranchOverrides[index] = elem.(types.String).ValueString()
                ^
2 issues:
* forcetypeassert: 2
task: Failed to run task "ci:lint": task: Failed to run task "lint": exit status 1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

circleci_project with pr_only_branch_overrides input fails to provision

2 participants