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

Feature Request: Pushes to this branch are nor permitted. #136

Open
sumanbikram opened this issue Aug 22, 2024 · 5 comments
Open

Feature Request: Pushes to this branch are nor permitted. #136

sumanbikram opened this issue Aug 22, 2024 · 5 comments
Assignees
Labels
Area: Bootstrap Modules 👢 Issues / PR's related to the Accelerator bootstrap modules IaC: Bicep Infrastructure as Code - Bicep IaC: Terraform Infrastructure as Code - Terraform Module: Bootstrap Type: Bug 🪲 Something isn't working

Comments

@sumanbikram
Copy link

Im using AZL with terraform. while using command Deploy-Accelerator -inputs "c:\accelerator\config\inputs.yaml" -output "c:\accelerator\output" deployments stops saying Pushes to this branch are nor permitted..
I already checked the branch policies and repo policies and so far so good.
Any suggestion?

RepoError
@sumanbikram sumanbikram added the bug Something isn't working label Aug 22, 2024
@oZakari
Copy link
Contributor

oZakari commented Aug 26, 2024

Hi @sumanbikram, when you look at the branch policies, do they currently exist? To clarify, the branch policies are all in-place correct?

Does you Azure DevOps organization have policies or scripts that would add the branch policies automatically to new repositories by chance? It sounds like the branch policies are getting applied prior to the PowerShell module applying them which would block the module from being able to push the files into your repository.

@oZakari oZakari added Needs: Author Feedback 👂 Needs the author to provide feedback Area: Terraform Accelerator 👽 Issues / PR's related to Terraform Accelerator labels Aug 26, 2024
@sumanbikram
Copy link
Author

sumanbikram commented Aug 27, 2024

Thanks for your valuable reply. I already checked the repository security policies, branch policies and push policies and looks like they are ok on a DevOps project level. Also, tried to disable branch policy in yaml but no luck. Yes this deployment has a YAML which creates Azure resources, DevOps repository, CICD pipeline and puts Branching policy.

@oZakari
Copy link
Contributor

oZakari commented Aug 27, 2024

With the Accelerator, they would be enabled at the branch level within the specific repository itself. If you follow these steps, to get to the location of the settings and then make sure everything is disabled/off in terms of the branch policies, build validation, status checks, and automatically included reviewers as have any of these will require a pull request for the branch. It should looks similar to the screenshot below when you're finished:

image

@jaredfholgate
Copy link
Member

This is a known issue when updating repository files with the Accelerator. There are two workarounds available for this:

  1. Turn off branch protection as mentioned by Zach. It will be re-enabled during the update. See the note here: https://github.com/Azure/ALZ-PowerShell-Module/wiki/Frequently-Asked-Questions#questions-about-changing-variables
  2. Do not deploy branch protection in the first place, by setting the create_branch_polices input file variable to false

We could look to improve this workflow in the future, but is a limitation of using Terraform for pushing file changes at the moment. Closing for now as there are multiple workarounds.

@jaredfholgate jaredfholgate added Status: Wont Fix 👎 This will not be worked on Type: Bug 🪲 Something isn't working and removed bug Something isn't working labels Sep 3, 2024
@jaredfholgate
Copy link
Member

Re-opening this as we may be able to remove the enforce_admins or make it optional to make this work.

@jaredfholgate jaredfholgate reopened this Sep 3, 2024
@jaredfholgate jaredfholgate removed the Status: Wont Fix 👎 This will not be worked on label Sep 3, 2024
@jaredfholgate jaredfholgate self-assigned this Sep 3, 2024
@jaredfholgate jaredfholgate changed the title Pushes to this branch are nor permitted. Feature Request: Pushes to this branch are nor permitted. Sep 3, 2024
@jaredfholgate jaredfholgate added Area: Bootstrap Modules 👢 Issues / PR's related to the Accelerator bootstrap modules IaC: Terraform Infrastructure as Code - Terraform IaC: Bicep Infrastructure as Code - Bicep Module: Bootstrap and removed Needs: Author Feedback 👂 Needs the author to provide feedback Area: Terraform Accelerator 👽 Issues / PR's related to Terraform Accelerator labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Bootstrap Modules 👢 Issues / PR's related to the Accelerator bootstrap modules IaC: Bicep Infrastructure as Code - Bicep IaC: Terraform Infrastructure as Code - Terraform Module: Bootstrap Type: Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants