🎙️ task - feat: support github rulesets at org and repo level
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- github, typescript
调研方向
先阅读 DeclaredGithubBranchProtection 和 DeclaredGithubEnvironment,然后阅读它们的 DAO 以及现有的 DAO 测试,以了解文件布局、cast 逻辑、context/auth 结构以及 get/set 模式。实现前检查 .agent/ 和 briefs/。当仓库级和组织级的 ruleset 对象及 DAO 已注册并导出、有单元测试和集成测试覆盖,并且通过 typecheck、build、lint 和 format 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
🦫🎙️ dispatch to foreman
💧 task enqueued
├─ priority = ?
├─ yieldage = ?
└─ leverage = ?
title
feat: support github rulesets at org and repo level
description
.what
add support for github rulesets at both repo level and org level, so consumers can declare tag-protection (and branch) rulesets as code via the declastruct get/set pattern.
.why
use case from ahbode/infrastructure: enforce that only a specific github app (release-please) can create tags that match v*. this is the out-of-band half of an aws oidc "prod apply only from a version tag cut from main" guarantee:
- aws sts conditions on
ref_type == tag+ref LIKE refs/tags/v* - a github tag ruleset must restrict
v*creation to the release app only (bypass actor) - release-please runs only on main
today declastruct-github has no ruleset/tag-protection resource (it models DeclaredGithubBranchProtection + DeclaredGithubEnvironment but not rulesets), so this cannot be declared as code.
.deliverables
DeclaredGithubRepoRulesetdomain object (repo-scoped)DeclaredGithubOrgRulesetdomain object (org-scoped; adds repository-scope conditions)- supporter value objects if the repo favors that granularity (rule, bypass actor, conditions) — mirror how
DeclaredGithubBranchProtectionhandles nested shapes DeclaredGithubRepoRulesetDao+DeclaredGithubOrgRulesetDao— get (by primary id, by unique name, by ref) + set (findsert + upsert), to mirror extant DAO idempotency- register/export alongside extant objects + DAOs (no barrel-export forwarders)
- tests to mirror extant DAO tests (unit for cast logic; integration per the repo's test-fns + credentials pattern)
.api reference
- repo rulesets:
GET/POST/PUT/DELETE /repos/{owner}/{repo}/rulesets(+/rulesets/{id}) - org rulesets:
GET/POST/PUT/DELETE /orgs/{org}/rulesets(+/rulesets/{id}) - ruleset fields:
name(natural unique key per scope),target('branch'|'tag'|'push'),enforcement('active'|'evaluate'|'disabled'),bypass_actors[](actor_id,actor_type['Integration'|'Team'|'OrganizationAdmin'|'RepositoryRole'|'DeployKey'],bypass_mode['always'|'pull_request']),conditions(ref_name.include[]/exclude[], e.g.refs/tags/v*, meta~ALL/~DEFAULT_BRANCH),rules[]({ type, parameters? }; types:creation,update,deletion,required_signatures,required_linear_history,non_fast_forward, ...) - org rulesets also support
conditions.repository_name(include/exclude/protected) orrepository_id id= server-assigned primary key;name= natural unique key (per repo, or per org)
.key choices to verify
- repo ruleset:
primary = ['id'],unique = ['name'] - org ruleset: confirm name uniqueness is per-org; key accordingly
- mirror exactly:
DeclaredGithubBranchProtection,DeclaredGithubEnvironment, and their DAOs (names, file layout, cast functions, context/auth shape, get/set verbs, inline io types, one-export-per-file, fail-fast)
.note
- honor the repo's house rules under
.agent/andbriefs/ - get typecheck/build + lint/format green
- write integration tests per the repo's pattern even if creds are unavailable locally; never add failhide/skip stubs
.source
requested from ahbode/infrastructure work on github-environments-vs-aws-oidc (vlad).
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ehmpathy/declastruct-github 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 5/5 一周以上 新手友好度 38/100
-
难度 2/5 1-3 小时 新手友好度 45/100
查看 ehmpathy/declastruct-github 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
homarr-labs/homarr#7191 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
AvaProtocol/ava-sdk-js#276 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
apollographql/apollo-client#13493 ·
维护者通常 1 天内回复