Skip to content

fix: Add missed parameter to the github_organization_ruleset - #2545

Merged
nickfloyd merged 4 commits into
integrations:mainfrom
yurii-kysil:do_not_enforce_on_create
Oct 21, 2025
Merged

nickfloyd merged 4 commits into
integrations:mainfrom
yurii-kysil:do_not_enforce_on_create

Conversation

@yurii-kysil

Copy link
Copy Markdown
Contributor

Resolves #2542


Before the change?

  • No parameter in github_organization_ruleset that cause an error, as it's required in respository_rules_utils.expandRules

After the change?

  • The parameter is added to the github_organization_ruleset with the default value

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@psalaberria002

Copy link
Copy Markdown

It would be nice to have this merged. Can someone review it?

@nickfloyd nickfloyd moved this from 🆕 Triage to 👀 In review in 🧰 Octokit Active Feb 27, 2025
@awendt

awendt commented Mar 17, 2025

Copy link
Copy Markdown

@kfcampbell Can we please get this fix merged and released?

@adan-babbel

Copy link
Copy Markdown

Hi @kfcampbell can you please review and merge this?

@grimm26

grimm26 commented Apr 3, 2025

Copy link
Copy Markdown

@yurii-kysel Should probably also update https://github.com/integrations/terraform-provider-github/blob/main/website/docs/r/organization_ruleset.html.markdown in this PR, too

@CpuID

CpuID commented Apr 28, 2025

Copy link
Copy Markdown

fairly sure this PR fixes #2597 - would be great to have it approved/merged :)

@CpuID

CpuID commented Apr 28, 2025

Copy link
Copy Markdown

oh and #2542 would get closed out too (already linked)

Optional: true,
Description: "Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. Defaults to `false`.",
},
"do_not_enforce_on_create": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We actually also need it on the required_workflows struct too

@anGie44 anGie44 Jun 30, 2025 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

based on the error you could prevent future panics in

doNotEnforceOnCreate := requiredStatusMap["do_not_enforce_on_create"].(bool)
params := &github.RequiredStatusChecksRuleParameters{
RequiredStatusChecks: requiredStatusChecks,
StrictRequiredStatusChecksPolicy: requiredStatusMap["strict_required_status_checks_policy"].(bool),
DoNotEnforceOnCreate: &doNotEnforceOnCreate,
}
as well by doing something like

		params := &github.RequiredStatusChecksRuleParameters{
			RequiredStatusChecks:             requiredStatusChecks,
		}

		if v, ok := requiredStatusMap["do_not_enforce_on_create"].(bool); ok {
			params.DoNotEnforceOnCreate =  &v
                }

                if v, ok := requiredStatusMap["strict_required_status_checks_policy"].(bool); ok {
                       params.StrictRequiredStatusChecksPolicy = v
                }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(but the Default: false should prevent that from happening 😅 )

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the status on this?

@grimm26

grimm26 commented Jul 1, 2025

Copy link
Copy Markdown

None of that matters unless M$ Github actually allocates time for their people to merge PRs. Plenty of us are actual paying GHE customers and are being ignored.

@nickfloyd nickfloyd added the Type: Bug Something isn't working as documented label Oct 21, 2025
@nickfloyd nickfloyd changed the title Add missed parameter to the github_organization_ruleset fix: Add missed parameter to the github_organization_ruleset Oct 21, 2025
@nickfloyd nickfloyd moved this from In Progress to In Review in Terraform Provider Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

Development

Successfully merging this pull request may close these issues.

[BUG]: github provider 6.5.0 is failing on updating github_organization_ruleset

10 participants