Repository navigation
azuredevops_git_repository - Support author for the initial commit of Clean initialization - #1634
Open
Niclas Grande (ngrande) wants to merge 1 commit into
Conversation
… Clean initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Description
With
init_type = "Clean", the provider creates the initial commit through the Push API without an author or committer. Azure DevOps then uses the identity that creates the repository. For a service principal (a typical pipeline identity), that commit has an empty author email.If the project has a commit author email policy (
azuredevops_repository_policy_author_email_pattern), the push is rejected:The repository is created but stays tainted in the state. The next plan replaces it, and the replacement fails the same way. Today the only ways out are to weaken the policy or to create repositories by hand.
This PR adds two optional arguments to the
initializationblock:author_nameauthor_emailIf either is set, they are used as author and committer of the initial commit. If neither is set, the behaviour is unchanged (no author sent).
Does this introduce a breaking change?
Both arguments are optional; without them the request is identical to today's.
Test Result
Unit tests (
go test -tags all ./azuredevops/internal/service/git/):go build ./...,go vetandgofmtare clean.golangci-lintv2.12 on the package reports only the six findings that already exist onmain.Acceptance tests not run: I have no Azure DevOps organization set up for them.
Related Issue(s)
None found for this case.
🤖 Generated with Claude Code