-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can't set AllowMergeCommit to false on imported repo #297
Comments
I was able to work around this issue with the following rough steps:
|
It sounds to me that the real issue is this part:
At first glance it sounds to me that this is an order-of-operations behavior from the GitHub API, but it is odd that removing those fields would make them be replaced with something else. I wonder if this is at least somewhat related to integrations/terraform-provider-github#1510? |
I tested this and could reproduce it. It does look like it's trying to set the message and title fields to a default after having already set In the meantime, here is a better workaround that doesn't require stack surgery:
|
I'm not completely sure, but I think I tried that too. IIRC, it did not consider setting to default (by deleting those fields) as enough to remove them from the stack state, so when I flipped AllowMergeCommit back to false, it was still trying to ensure that MergeCommitMessage and MergeCommitTitle were set to the default values. |
Just tried it out. |
I filed integrations/terraform-provider-github#1541 upstream and am marking this as blocked. Please use the workaround for now if you can. |
What happened?
I imported a repository with
pulumi import
and tried to set its AllowMergeCommit option to false. It failed with the following error:Important part:
Expected Behavior
It should set AllowMergeCommit to false.
Steps to reproduce
Create a GitHub public or private repository called "test-repo".
Go to Repository settings. Under Pull Requests > Allow merge commits, change Default Message to Default to pull request title and description.
In a new github-go project, import this repository.
Copy the generated code into main.go and run
pulumi up
to make sure everything is in order.It should report no changes.
Add
AllowMergeCommit: pulumi.Bool(false),
to the RepositoryArgs, and deleteMergeCommitMessage
,MergeCommitTitle
since they're no longer relevant.Run
pulumi up
.If you run the update, it will fail with the error:
Full program:
Note that this only fails if the repository has already been imported with non-default merge settings first.
Output of
pulumi about
Additional context
Details in
pulumi up
included:Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: