integrations / integrations/terraform-provider-github

[BUG]: No warning/error on conflicting resource properties for `github_repository`

Open
#2,264 6 comments 3 reactions 1 assignee Claimed by @deiga View on GitHub
r/repository Type: Bug
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

### Expected Behavior

The Terraform provider currently exhibits a problematic behavior where it silently ignores certain configuration settings when conflicting configurations are present.

Specifically, if a user defines `squash_merge_commit_message` or `squash_merge_commit_title` while disabling squash merges through `allow_squash_merge = false`, these settings are rendered meaningless. Similarly, specifying `merge_commit_message` or `merge_commit_title` without enabling `allow_merge_commit` has no effect.

Although this behavior is documented, relying solely on documentation is insufficient. Users may easily overlook these details, leading to unexpected outcomes and configuration confusion.

To enhance user experience and prevent silent misconfigurations, the provider should implement stronger validation mechanisms. Instead of silently ignoring conflicting settings, it should either:

* **Issue a warning** during plan or apply stages, explicitly informing users about the conflict and the settings being ignored.
* **Throw an error**, preventing the deployment of a configuration containing these contradictions, ensuring users address the issue before proceeding.

This proactive approach would provide clearer feedback, reduce user frustration, and promote a more robust and reliable configuration process.

### Actual Behavior

see above

### Terraform Version

v1.8.3

### Affected Resource(s)

- `github_repository`

### Terraform Configuration Files

_No response_

### Steps to Reproduce

_No response_

### Debug Output

_No response_

### Panic Output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.