Closed carlosjourdan closed 2 months ago
@carlosjourdan this is a tech debt that the initialization of the repo is hard coded in azuredevops_git_repository
. This constraint is used to prevent the default branch from being set when the repo is not initialized. Can you initialize the repository with a different initial type?
No. This repo is in a production environment where all the access is done through terraform, we have no access as project owners. If I try to change the initialization type through the code, terraform plan says that the resource needs to be replaced, which is unacceptable because it would delete the entire git history.
On Wed, Apr 3, 2024, 05:46 xuzhang3 @.***> wrote:
@carlosjourdan https://github.com/carlosjourdan this is a tech debt that the initialization of the repo is hard coded in azuredevops_git_repository. This constraint is used to prevent the default branch from being set when the repo is not initialized. Can you initialize the repository with a different initial type?
— Reply to this email directly, view it on GitHub https://github.com/microsoft/terraform-provider-azuredevops/issues/1016#issuecomment-2033940257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEF5Z5EGJTRGJCDIDH52QLLY3O6UVAVCNFSM6AAAAABFUFXTF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTHE2DAMRVG4 . You are receiving this because you were mentioned.Message ID: @.*** com>
@carlosjourdan I see, the second apply should not block update, this is different from the create.
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v1.7.5 on windows_amd64 + provider registry.terraform.io/microsoft/azuredevops v1.0.1
Affected Resource(s)
azuredevops_git_repository
Terraform Configuration Files
Expected Behavior
The repository should have set the "default_branch" property to "ref/heads/default" after the second apply
Actual Behavior
Error: Error converting terraform data model to AzDO project reference: Repository 'initialization.init_type = Uninitialized', there will be no branches, 'default_branch' cannt not be set.
Steps to Reproduce
terraform apply
without the default_branch property, with init_type = "Uninitialized"terraform apply
after adding the default_branch property