Skip to content

Add support for EnterpriseOwner - #3211

Open
jackmtpt wants to merge 8 commits into
integrations:mainfrom
jackmtpt:jackmtpt-patch-1
Open

jackmtpt wants to merge 8 commits into
integrations:mainfrom
jackmtpt:jackmtpt-patch-1

Conversation

@jackmtpt

Copy link
Copy Markdown

Resolves #3210


Before the change?

  • Adds support for setting EnterpriseOwner in rulesets

After the change?

  • The EnterpriseOwner value can be set as a bypass_actor

Pull request checklist

  • Schema migrations have been created if needed (example)
  • 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

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@jackmtpt

Copy link
Copy Markdown
Author

I don't have a local golang dev environment so I'll have to wait for the CI build before I can test this locally.

@deiga deiga left a comment

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.

Thanks for the contribution! I left a few comments

@deiga

deiga commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the changes! Have you been able to run the tests locally?

@jackmtpt

jackmtpt commented Mar 2, 2026

Copy link
Copy Markdown
Author

Thanks for the changes! Have you been able to run the tests locally?

Sadly not; setting up a golang dev environment in my company has proven to be a giant pain...

@deiga

deiga commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

Ran tests locally and they pass on Enterprise. But I think you need to split the tests with EnterpriseOwner into separate tests with skipUnlessEnterprise

@jackmtpt

jackmtpt commented Mar 5, 2026

Copy link
Copy Markdown
Author

That should be done now. There was an existing test create_branch_ruleset_with_enterprise_features that I've changed to be gated behind the enterprise setting and put the EnterpriseOwner stuff in that. I've then copied that test to the org rulesets file as well.

I'm still pretty new to golang but I have managed to get the tests passing locally.

@deiga deiga left a comment

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.

LGTM!

@deiga
deiga requested a review from stevehipwell March 5, 2026 22:42
@deiga deiga added this to the v6.12.0 Release milestone Mar 5, 2026

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.

Could you create a new test for this, instead of changing this existing test and where it can run?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

my understanding of the existing create_branch_ruleset_with_enterprise_features test was that it should have been using skipUnlessEnterprise(t) already, no? if it's testing enterprise features then shouldn't it only run in enterprise mode?

happy to split out the specific EnterpriseOwner test if you want, i just thought it'd be simpler to have one test that does all the enterprise-y stuff together

@deiga
deiga removed the request for review from stevehipwell May 17, 2026 13:24
@deiga deiga removed this from the v6.13.0 milestone Jun 3, 2026
@deiga deiga added the Type: Feature New feature or request label Jun 3, 2026
@deiga

deiga commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

@jackmtpt if you're available for rebasing this and refactoring to use the new docs system, then it's possible we can get this into v6.13.0

@jackmtpt

Copy link
Copy Markdown
Author

@deiga I am leaving my company in a week so I won't be able to work on this anymore. If someone else wants to take it over feel free.

@nitinjain999

Copy link
Copy Markdown
Contributor

Thanks @jackmtpt for the work on this — happy to take it over from here.

I'll pick up the remaining items: rebase onto main, migrate the docs to the new docs/ system, refactor the repository ruleset test to use a separate create_branch_ruleset_with_enterprise_features test with skipUnlessEnterprise, and address the remaining open comments from @deiga.

@nitinjain999

Copy link
Copy Markdown
Contributor

Opened #3487 to carry this forward — rebased on main, migrated docs to the new docs/ system, split out the enterprise tests, and verified against a live enterprise org.

@mymasse

mymasse commented Jun 11, 2026

Copy link
Copy Markdown

There is a PR for adding RepositoryMigration actor type #3337 and it's also missing User actor type support also (#3423) is possible to combine and add the missing in this PR so we get all 3 missing types

nitinjain999 added a commit to nitinjain999/terraform-provider-github that referenced this pull request Jun 25, 2026
…ust ignore

Previous wording said the API 'will ignore' the value, which implied
setting it was harmless. Per the GitHub API (confirmed by maintainer
@deiga in integrations#3211), OrganizationAdmin and EnterpriseOwner return no
actor_id on read — setting any value causes config/state drift.
Updated to 'Must be omitted' to make the contract unambiguous.
stevehipwell pushed a commit that referenced this pull request Jun 29, 2026
* feat: add EnterpriseOwner as bypass actor type for rulesets

- Add EnterpriseOwner to the ValidateDiagFunc allowlist for actor_type
  in both organization and repository ruleset resources
- Update actor_id descriptions to clarify it should be omitted for
  OrganizationAdmin, EnterpriseOwner, and DeployKey (API ignores it)
- Remove actor_id=1 from OrganizationAdmin bypass_actors in tests since
  the GitHub API ignores the value for that actor type
- Add separate enterprise-gated acceptance tests for EnterpriseOwner
  bypass actor using ConfigStateChecks (skipUnlessEnterprise)
- Update docs/resources/ (new docs system) for both resources

Closes #3210

* docs: update bypass_actors templates to add EnterpriseOwner and fix actor_id description

- Add EnterpriseOwner to actor_type allowed values in both ruleset templates
- Clarify that actor_id is ignored by the GitHub API for OrganizationAdmin, EnterpriseOwner, and DeployKey
- Remove stale OrganizationAdmin -> 1 mapping note

Fixes docs CI failure caused by editing auto-generated docs/ files directly
instead of the source templates/resources/*.md.tmpl files.

* fix(docs): add DeployKey to org ruleset actor_type list in template and docs

DeployKey was already in the schema validation but missing from the
docs actor_type description. Regenerated docs from template.

* docs: strengthen actor_id description for ID-less types to omit not just ignore

Previous wording said the API 'will ignore' the value, which implied
setting it was harmless. Per the GitHub API (confirmed by maintainer
@deiga in #3211), OrganizationAdmin and EnterpriseOwner return no
actor_id on read — setting any value causes config/state drift.
Updated to 'Must be omitted' to make the contract unambiguous.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Support EnterpriseOwner actor_type

5 participants