[BUG] fix rulesets update_allows_fetch_and_merge validation - #3547
[BUG] fix rulesets update_allows_fetch_and_merge validation#3547deiga wants to merge 10 commits into
update_allows_fetch_and_merge validation#3547Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
e68c40e to
ce2ffca
Compare
2c4dedb to
5bdcf8c
Compare
5bdcf8c to
2a5953e
Compare
…t validation The validation added in 6.11.0 walks the keys of the rules block and rejects any name absent from the allow-list of rule types. update_allows_fetch_and_merge is a parameter of the update rule rather than a rule of its own, so it is rejected before the expansion that folds it into UpdateRuleParameters ever runs. Any ruleset setting it therefore fails to plan, on both branch and tag targets. The provider contradicts itself within one version, since util_rules.go sends the value as a parameter and never as a rule. Cherry-picked from integrations#3547, which fixes this upstream but is still awaiting review. Only the two lines that matter are taken; the rest of that pull request is regenerated documentation and rewritten tests. A later sync of this fork absorbs the change and this patch disappears with it.
…t validation (#19) The validation added in 6.11.0 walks the keys of the rules block and rejects any name absent from the allow-list of rule types. update_allows_fetch_and_merge is a parameter of the update rule rather than a rule of its own, so it is rejected before the expansion that folds it into UpdateRuleParameters ever runs. Any ruleset setting it therefore fails to plan, on both branch and tag targets. The provider contradicts itself within one version, since util_rules.go sends the value as a parameter and never as a rule. Cherry-picked from integrations#3547, which fixes this upstream but is still awaiting review. Only the two lines that matter are taken; the rest of that pull request is regenerated documentation and rewritten tests. A later sync of this fork absorbs the change and this patch disappears with it.
stevehipwell
left a comment
There was a problem hiding this comment.
Please add a import-by-string-id.tf file to the examples.
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…n non-forked repos Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
e5bf717 to
afef5c0
Compare
rilical
left a comment
There was a problem hiding this comment.
The validation fix itself looks focused, but the surrounding cleanup dropped two useful pieces. create_branch_ruleset used to verify the resulting bypass actors and nested rules; it now only checks that Terraform plans a Create. The generated docs also lost the note explaining which rules apply to branch and tag targets versus push targets when the custom template was removed. Could we restore the state assertions alongside the new plan check and move that guidance into a schema description or small template section so it survives regeneration?
Resolves #3543
Before the change?
rules.0.update_allows_fetch_and_mergeis being marked as invalid config for repository rulesetAfter the change?
rules.0.update_allows_fetch_and_mergewill be allowed as config for repository rulesetsrules.0.update_allows_fetch_and_mergegithub_repository_rulesettests to follow modern practicesPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!