GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(ci): owner-gate platform hard-block + admission gate by Episkey-G · Pull Request #7 · Episkey-G/ucloud-cli

Conversation

@Episkey-G

@Episkey-G Episkey-G commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Lands the admission-gate work onto master.

owner-gate hard-block

  • 平台 PR(平台文件/跨产品/非owner/onboarding/offboarding)默认 fail-closed 红,除非 cleared:作者是 admin,或有 admin(≠作者)在当前 head commit 上的 Approve。
  • 产品 owner 改自己产品保持绿 + 自动合(不变)。
  • 修既有 bug:跨产品 rename 误路由、rename-away product.yaml 绕过下线。
  • owner-gate(Go)永远 exit 0,admission step 把 blocking 变红。

workflow

  • 加 pull_request_review 触发 + concurrency;clearance step(admin 自提/admin 批准绑 commit_id)+ admission step;verdict 评论 always() 容错;安全/CI job 在 review 事件真实重跑。

本 PR 本身即一次实测:作者为 admin、触及平台文件 → 预期 owner-gate 绿(admin cleared)。

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Episkey-G @claude
feat(owner-gate): hard-block platform PRs, clear via admin review
47e6854
Platform PRs (platform files / cross-product / non-owner / onboarding /
offboarding) now fail-closed RED unless cleared: the PR author is an admin,
or an admin (not the author) approved on the current head commit. Product
owner autonomy is unchanged (green + auto-merge).

- main.go: Decision.Blocking; decide() takes platformCleared; empty diff is
  noop; baseOwnersFunc reports parseErr (corrupt manifest gets its own
  reason); parseNameStatus records BOTH ends of a rename (fixes cross-product
  rename misroute + rename-away offboarding bypass); owner-gate always exits 0
  (exit 2 only on internal error) and the admission step turns Blocking red.
- pr-gate.yml: pull_request_review trigger + concurrency; clearance step
  (admin author OR admin approval bound to head commit_id) + admission step;
  always() tolerant verdict comment; security/CI jobs run on review events too
  so a skipped required check can't count as success and mask a real failure.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

✅ 平台 PR 已放行(管理员自提或已获管理员批准),CI 通过后可合。判定:改动触及平台/受保护路径(.github/workflows/pr-gate.yml, hack/owner-gate/main.go, hack/owner-gate/main_test.go)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Episkey-G
Episkey-G merged commit b6e71b8 into master Jun 29, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Jun 29, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47e6854df9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/pr-gate.yml
- name: Admission (hard-block un-cleared platform PR)
# The actual red: owner-gate (Go) always exits 0 and writes blocking;
# this step is what fails the required check when blocking is true.
if: steps.gate.outputs.blocking == 'true'

@chatgpt-codex-connector chatgpt-codex-connector Bot Jun 29, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Run the hard-block from trusted code

For any platform PR that also changes hack/owner-gate, the checkout step has no ref override, so GitHub checks out the PR merge branch by default for pull_request/pull_request_review workflows, and the gate step runs PR-supplied code (go run ./hack/owner-gate). This new admission check then trusts that program's blocking output, so the same unapproved platform PR can emit blocking=false and skip the red check while repo approvals are documented as 0; the hard-block needs to execute the base-revision gate or otherwise avoid trusting PR-controlled outputs. Reference: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#how-the-merge-branch-affects-your-workflow

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/pr-gate.yml
Comment on lines +106 to +107
perm=$(gh api "repos/$GITHUB_REPOSITORY/collaborators/$1/permission" --jq '.permission' 2>/dev/null || echo none)
case "$perm" in admin|maintain) return 0 ;; *) return 1 ;; esac

@chatgpt-codex-connector chatgpt-codex-connector Bot Jun 29, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Read role_name when accepting maintainers

In repositories where platform clearance is meant to accept GitHub's Maintain role, this API result will not match the maintain case: GitHub's collaborators permission endpoint maps maintain into the legacy .permission value write and exposes the actual role in .role_name. As written, maintainer authors/reviewers are treated as non-admin and their platform PRs remain blocked after the expected approval; query role_name or adjust the accepted values. Reference: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Episkey-G
Episkey-G deleted the ci/release-include-refactor branch June 29, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Episkey-G
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.