Skip to content
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

Added the resource for git branch lock azuredevops_git_repository_branch_lock #1289

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blueelvis
Copy link

@blueelvis blueelvis commented Jan 29, 2025

All Submissions:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran lint checks locally prior to submission.
  • Have you checked to ensure there aren't other open PRs for the same update/change?

What about the current behavior has changed?

  1. Issue Number: Add support for branch locking (azuredevops_git_repository_branch_lock) #1034
  2. Minor fixes to the build Powershell script.
  3. Added a Powershell script to scaffold website documentation so that it can be used on Windows as well.

Does this introduce a change to go.mod, go.sum or vendor/?

  • Yes
  • No

Does this introduce a breaking change?

  • Yes
  • No

@blueelvis
Copy link
Author

@microsoft-github-policy-service agree

@blueelvis blueelvis changed the title Added the resource for git branch lock Added the resource for git branch lock azuredevops_git_repository_branch_lock Jan 29, 2025
Type: schema.TypeBool,
Required: true,
ForceNew: true,
Default: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. Required property cannot have default values
  2. is_locked should be updateable


## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
The `timeouts` block allows you to specify [timeouts](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) for certain actions:

* `read` - (Defaults to 5 minutes) Used when retrieving the Git Repository Branch Lock.
* `delete` - (Defaults to 5 minutes) Used when deleting the Git Repository Branch Lock.

## Import
Copy link
Collaborator

Choose a reason for hiding this comment

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

This resource does not support import

Filter: converter.String(strings.TrimPrefix(branchRef, "refs/")),
})
if err != nil {
return diag.FromErr(fmt.Errorf("Error updating branch lock: %v", err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return diag.FromErr(fmt.Errorf("Error updating branch lock: %v", err))
return diag.FromErr(fmt.Errorf(" Updating branch lock: %v", err))

d.SetId("")
return nil
}
return diag.FromErr(fmt.Errorf("Error reading branch ref: %v", err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return diag.FromErr(fmt.Errorf("Error reading branch ref: %v", err))
return diag.FromErr(fmt.Errorf(" Reading branch ref: %v", err))

Filter: converter.String(strings.TrimPrefix(branchRef, "refs/")),
})
if err != nil {
return diag.FromErr(fmt.Errorf("Error getting branch ref: %v", err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return diag.FromErr(fmt.Errorf("Error getting branch ref: %v", err))
return diag.FromErr(fmt.Errorf(" Getting branch ref: %v", err))

Filter: converter.String(strings.TrimPrefix(branchRef, "refs/")),
})
if err != nil {
return diag.FromErr(fmt.Errorf("Error unlocking branch: %v", err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return diag.FromErr(fmt.Errorf("Error unlocking branch: %v", err))
return diag.FromErr(fmt.Errorf(" Unlocking branch: %+v", err))

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

Successfully merging this pull request may close these issues.

2 participants