Terraform-provider-azuredevops: Can not create fork repository

Created on 3 Jul 2020  路  3Comments  路  Source: microsoft/terraform-provider-azuredevops

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

Terraform v0.12.28
provider.azuredevops 0.0.1

Affected Resource(s)

  • azuredevops_git_repository

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

data "azuredevops_project" "test" {
  project_name = "Test Project"
}

resource "azuredevops_git_repository" "repo" {
  project_id = data.azuredevops_project.test.id
  name       = "test-repo"
  initialization {
    init_type = "Clean"
  }
}

resource "azuredevops_git_repository" "fork-repo" {
  project_id = data.azuredevops_project.test.id
  name       = "fork-test-repo"
  parent_id  = azuredevops_git_repository.repo.id
}

Debug Output

https://gist.github.com/patr00n/f2f7e1057d90d70b411c02148d12ef03

Panic Output

Expected Behavior

New repo was created

Actual Behavior

Error

Steps to Reproduce

  1. terraform plan

Important Factoids

References

documentation question

Most helpful comment

All 3 comments

Hi @patr00n Thanks for your feed back. You can change you config like this :

provider "azuredevops" {
  version = ">= 0.0.1"
}

data "azuredevops_project" "test" {
  project_name = "Test Project"
}

resource "azuredevops_git_repository" "repo" {
  project_id = data.azuredevops_project.test.id
  name       = "test-repo"
  initialization {
    init_type = "Clean"
  }
}

resource "azuredevops_git_repository" "fork-repo" {
  project_id = data.azuredevops_project.test.id
  name       = "fork-test-repo"
  parent_repository_id  = azuredevops_git_repository.repo.id
  initialization {
    init_type = "Clean"
  }
}

parent_id is not a valid configure in azuredevops_git_repository.
Attention
You need specify the initialization configuration in azuredevops_git_repository, otherwise Terraform may crash. This is a know issue in azuredevops, we will fix this soon.

Thanks for your quick reply!
It works with parent_repository_id. But documentation says parent_id. It would be nice to fix.

Was this page helpful?
0 / 5 - 0 ratings