-
Notifications
You must be signed in to change notification settings - Fork 280
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
azuredevops_pipeline_authorization
- Allow pipeline authorization across projects
#973
azuredevops_pipeline_authorization
- Allow pipeline authorization across projects
#973
Conversation
@josh-barker In most case the |
Hi @xuzhang3, I think it would be better as a consumer of the provider to add the additional optional property so I don't need to craft that string. I could add another example to the documentation so people can understand the use case for that property, and expand on the description if you think that would help? |
@josh-barker I didn't consider cross-projects when I added this resource, the Potential config: resource "azuredevops_pipeline_authorization" "test" {
project_id = azuredevops_project.test.id
resource_id = "${azuredevops_project.remote_repo.id}.${data.azuredevops_git_repository.remote_repo.id}"
type = "repository"
pipeline_id = azuredevops_build_definition.test.id
} |
@@josh-barker what I thinking is remove the hardcoded resource ID generated in the code and let the customer manage it themselves. This should cover your requirement. |
Hey @xuzhang3 As you said before, the majority of situations authorize a pipeline to a resource that belongs in the same AZDO project. As a user of the provider, I'd find it annoying to have to update all the pipeline authorizations in that format, where I could easily make a mistake - project id, missing full stop, etc. If you're still not keen on the idea of an optional property, how about a specialised resource for cross pipeline/repo access? I think the repository is the only resource that can be given cross project access. Thanks! |
@josh-barker We just need to remove this Repo resource ID code snippet to support cross project authorization. The repository ID composed in format |
Any ETA on this? |
This this merge be planned into a new major version or similar? |
We plan to merge #989 instead of this PR |
Hi @xuzhang3 , It would be good to get other people's feedback about the proposed change in #989 Personally, I feel strongly that the provider should handle the construction the payloads for the APIs and simplifies the usage for us. I also prefer to minimise breaking changes so that upgrades are simple. So I would expect that I only need to specify the project ID once when the repo and pipeline exist in the same project. resource "azuredevops_pipeline_authorization" "same_project" {
project_id = azuredevops_project.test.id
pipeline_id = azuredevops_build_definition.test.id
type = "repository"
resource_id = data.azuredevops_git_repository.local_repo.id
} However, when there is a cross project repo authorization, I'd expect I need to pass in the other project id.
I'd be totally happy to rename For example:
Hope that makes sense and thanks for listening to my ideas |
What about adding a block instead of an extra argument. resource "azuredevops_pipeline_authorization" "example" {
project_id = azuredevops_project.project1.id
# resource_id = data.azuredevops_git_repository.project2_repo.id
# type = "repository"
pipeline_id = azuredevops_build_definition.project1_pipeline.id
target_resource {
project_id = data.azuredevops_project.project2.id
resource_id = data.azuredevops_git_repository.project2_repo.id
type = "repository"
}
} |
@josh-barker @plejon thanks for your suggestions. @josh-barker your implementation is the better choice. Not bring the breaking change. We can keep |
azuredevops_pipeline_authorization
- Allow pipeline authorization across projects
All Submissions:
What about the current behavior has changed?
Currently, we cannot authorize pipelines cross project repository.
This PR adds a new optional property to specify the pipeline's project id.
Issue Number:
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information