Would the project accept contributions to manage enterprise-level settings?

未关闭
#1,067 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
github, javascript

调研方向

先从讨论 #335 和现有的 org → suborg → repo 层级开始,然后审查提议的 .github/settings.yml 或 CONFIG_PATH Enterprise 条目以及 plugin 生命周期。第一个里程碑是维护者就范围、身份验证、preview gating 和实施顺序达成一致;一个范围有限的 Enterprise custom-properties 切片可以在更广泛的实现之前定义什么算作 done。

由索引模型根据 Issue 内容生成。

描述

Would the project accept contributions to manage enterprise-level settings?

Prerequisites

Is the functionality available in the GitHub UI?

Yes. Enterprise accounts expose a policy surface that safe-settings cannot currently reach: enterprise rulesets, enterprise custom properties, enterprise Actions policies, and enterprise code security configurations, all under Enterprise settings → Policies / Rulesets / Custom properties / Code security.

Is the functionality available through the GitHub API?

Yes, and this is the part that changed since the topic was last discussed. All of the following are documented REST endpoints today:

Surface Endpoints Status
Enterprise rulesets GET/POST /enterprises/{enterprise}/rulesets, GET/PUT/DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} GA (Mar 2025)
Enterprise custom properties GET/PATCH /enterprises/{enterprise}/properties/schema, GET/PUT/DELETE /enterprises/{enterprise}/properties/schema/{name} GA (Mar 2025)
Enterprise Actions policies GET/PUT /enterprises/{enterprise}/actions/permissions (+ /organizations, /selected-actions, /workflow, /self-hosted-runners, /fork-pr-*, /artifact-and-log-retention) GA
Enterprise code security configurations GET/POST /enterprises/{enterprise}/code-security/configurations, PATCH/DELETE .../{configuration_id}, .../defaults, .../attach GA

Is it reachable by a GitHub App? This is the historical blocker, and it has been lifted:

  • Enterprise-level access for GitHub Apps and installation automation APIs (Jul 2025, public preview) — Apps can be installed on an enterprise account and were given enterprise permissions, including Enterprise organization installations ("view, create, edit, and remove installations in each organization"), custom properties, SSO & SCIM, people management, and organization creation. Each enterprise installation gets its own rate-limit budget (15,000 req/hr).
  • Enterprises can now install third-party GitHub Apps (Aug 2026) — public Apps created outside the enterprise can now be installed on an enterprise account.

The ask

In discussion #335 the stated limitation was:

The permissions available to a GitHub app allow it to only manage settings for repositories and its resources. […] it doesn't manage settings for Enterprise or org.

That constraint was accurate when it was written, but it is no longer true for the enterprise level. So the question is one of project direction rather than feasibility:

Is the project open to contributions that add an enterprise layer to the settings hierarchy — and if so, what shape would you want it to take?

We would rather ask before writing code than show up with a large PR that cuts against the direction you have in mind.

How this differs from existing issues

This request is different in kind: not "manage more orgs", but manage resources that are owned by the enterprise account itself and have no org-level equivalent — an enterprise ruleset applies across every org in the enterprise and cannot be expressed as N org rulesets, and enterprise custom properties are precisely the mechanism that removes the need to sync property schemas org by org.

The overlap with #827 is real but narrow, and it is mostly about auth plumbing. Happy to fold this into #827 if you would rather track it there.

Sketch of a possible shape

Deliberately vague on internals, because the design should follow your preferences:

  1. A new top level in the hierarchy. Today precedence runs org → suborg → repo. This would add enterprise above org, configured in the admin repo (e.g. .github/settings.yml gaining an enterprise: block, or a dedicated enterprise/ path under CONFIG_PATH), applying only to genuinely enterprise-scoped resources.
  2. New plugins, same contract. enterprise_rulesets, enterprise_custom_properties, enterprise_actions_policies, enterprise_code_security — each following the existing plugin lifecycle so that dry-run/nop diffs, PR check comments, and the error reporting path keep working unchanged.
  3. Strictly opt-in. Absent enterprise config and absent an enterprise installation, behavior is byte-for-byte what it is today. No existing deployment changes.
  4. Two auth contexts, made explicit. An enterprise installation grants access to the enterprise account only — it explicitly does not act as an installation inside each org or repo. So enterprise plugins would authenticate with the enterprise installation token while org/suborg/repo plugins keep using org installation tokens. This is the main design question we would want your read on.
Open questions for maintainers
  1. Appetite. Is an enterprise layer in scope for safe-settings at all, or do you consider enterprise governance out of the project's intended boundary?
  2. Auth model. Would you prefer the enterprise installation token approach above, an enterprise-owned App as you suggested in #827, or a separate deployment mode driven by env vars?
  3. Preview surface. Some enterprise App permissions are still public preview. Is depending on a preview permission acceptable, or would you want this gated behind an env flag until GA?
  4. Sequencing. If there is appetite, would you want one narrow vertical slice first (enterprise custom properties alone, as the smallest useful unit) to settle the auth and hierarchy questions before adding the rest?
  5. Process. Given the move to github-community-projects and the trusted-contributor model mentioned in #812, should a change of this size start as a discussion, an RFC-style issue, or a draft PR?

Willingness to do the work

We run a self-hosted safe-settings across two orgs in one enterprise and are already contributing upstream fixes we needed along the way — #1044, #1052, #1053, #1065. We are willing to implement and maintain this, in whatever sequence and shape you prefer. A "not in scope" answer is also useful — it tells us to solve the enterprise layer outside safe-settings rather than wait.

主要语言
JavaScript
星标
942
派生
238
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github-community-projects/safe-settings 的其他 Issue

查看 github-community-projects/safe-settings 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。