[BUG]: changing branch name with protection rules set fails
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- go, terraform
- Lĩnh vực
- devops, infrastructure
Hướng nghiên cứu
Bắt đầu với các triển khai tài nguyên github_branch và github_branch_protection, đồng thời tái hiện cấu hình Terraform được cung cấp trong khi theo dõi ID toàn cục của quy tắc bảo vệ sau khi đổi tên branch. Hoàn thành khi việc đổi tên một branch được bảo vệ được áp dụng thành công mà không gặp lỗi global-ID và cơ chế bảo vệ hiện có vẫn chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behavior
on changing branch name that has protection rules set by terraform, its expected for the apply to work normally
Actual Behavior
branch name changes, however, protection rule modification fail with error : Could not resolve to a node with the global id of xxxxxxx
Terraform Version
Terraform v1.15.7
on linux_amd64
- provider registry.terraform.io/hashicorp/github v6.13.0
GitHub Installation Type
- GitHub.com (Free, Pro, or Team)
- GitHub Enterprise Server (on-premises)
- GitHub Enterprise Cloud with Personal Accounts (github.com)
- GitHub Enterprise Cloud with Managed Users/EMU (github.com)
- GitHub Enterprise Cloud with Data Residency (*.ghe.com)
- I don't know
Affected Resource(s)
- github_branch_protection
- github_branch
Terraform Configuration Files
resource "github_repository" "terraform_lab" {
name = "tf-lab-practice"
description = "Can I change this?"
visibility = "public"
auto_init = true
allow_merge_commit = true
allow_squash_merge = true
topics = ["terraform", "iac"]
}
resource "github_branch" "terraform_lab" {
repository = github_repository.terraform_lab.name
branch = "master3"
}
resource "github_branch" "terraform_lab_dev" {
repository = github_repository.terraform_lab.name
branch = "dev3"
}
resource "github_branch_default" "terraform_lab" {
repository = github_repository.terraform_lab.name
branch = github_branch.terraform_lab.branch
}
resource "github_branch_protection" "terraform_lab" {
repository_id = github_repository.terraform_lab.name
pattern = github_branch_default.terraform_lab.branch
enforce_admins = true
allows_deletions = true
required_pull_request_reviews {
require_code_owner_reviews = true
dismiss_stale_reviews = true
restrict_dismissals = true
required_approving_review_count = 1
}
}
resource "github_branch_protection" "terraform_lab_dev" {
repository_id = github_repository.terraform_lab.name
pattern = github_branch.terraform_lab_dev.branch
enforce_admins = true
allows_deletions = true
required_pull_request_reviews {
require_code_owner_reviews = true
dismiss_stale_reviews = true
restrict_dismissals = true
required_approving_review_count = 1
}
}
output "repo_data" {
value = github_repository.terraform_lab
}
output "default_branch_data" {
value = github_branch_default.terraform_lab
}
terraform {
required_version = ">= 1.12.2" # Replace with your installed version
required_providers {
github = {
source = "hashicorp/github"
version = "~> 6.13"
}
}
}
provider "github" {}
Steps to Reproduce
export GITHUB_TOKEN
terraform apply #the code provided
#change any branch name
terraform apply
Debug Output
github_branch.terraform_lab_dev: Modifying... [id=tf-lab-practice:dev2]
github_branch_protection.terraform_lab: Modifying... [id=BPR_kwDOTcwWwc4Ey13a]
github_branch.terraform_lab_dev: Modifications complete after 4s [id=tf-lab-practice:dev3]
github_branch_protection.terraform_lab_dev: Modifying... [id=BPR_kwDOTcwWwc4Ey13b]
github_branch_protection.terraform_lab: Modifications complete after 8s [id=BPR_kwDOTcwWwc4Ey13a]
╷
│ Error: Could not resolve to a node with the global id of 'BPR_kwDOTcwWwc4Ey13b'.
│
│ with github_branch_protection.terraform_lab_dev,
│ on main.tf line 44, in resource "github_branch_protection" "terraform_lab_dev":
│ 44: resource "github_branch_protection" "terraform_lab_dev" {
│
╵
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Go
- Star
- 1.2k
- Fork
- 1.1k
- Merge trung bình
- 9 giờ 41 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của integrations/terraform-provider-github
-
[DOCS]: enforce_admins description understates what it covers and omits push restrictionsCó thể đã có người làm @dav-tb đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
integrations/terraform-provider-github#3707 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[FEAT]: Add ruleset bypass actor type `OrganizationRole`Có thể đã có người làm @marcencov đã nhận 15 ngày trước. Đang mởStatus: Triage Type: Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
integrations/terraform-provider-github#3674 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug Upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
integrations/terraform-provider-github#3660 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github_organization_custom_properties Read doesn't handle 404, breaking recovery after deletionCó thể đã có người làm @mkushakov đã nhận 245 ngày trước. Đang mởr/organization_custom_properties Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
integrations/terraform-provider-github#3641 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: Triage Type: Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
integrations/terraform-provider-github#3613 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của integrations/terraform-provider-github
Issue tương tự
-
automation doc-healer documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
tsukumogami/tsuku#2804 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptCó thể đã có người làm @Shayan12456 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ollama/ollama#19415 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
raised-by:verifier
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
medici-finance/assay#5039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned upCó thể đã có người làm @barbierajput378-pixel đã nhận hôm nay. Đang mởkind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Project-HAMi/HAMi#3343 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày