-
Notifications
You must be signed in to change notification settings - Fork 0
fix: §15 改拉 ruleset detail + OK 门控(P3-1,ADR-0046) #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Cloudbird-Software/.github
Length of output: 11690
🏁 Script executed:
Repository: Cloudbird-Software/.github
Length of output: 26679
🌐 Web query:
GitHub REST API organization rulesets list rulesets response errors get ruleset rules array💡 Result:
The GitHub REST API provides endpoints to interact with organization and repository rulesets. Below is a summary of the response structure and relevant error details for the requested operations. Organization Rulesets Response Structure The endpoint to get all organization repository rulesets (GET /orgs/{org}/rulesets) returns an array of repository ruleset objects [1][2]. Each object includes: - id: Integer identifier for the ruleset [1][2]. - name: String name of the ruleset [1][2]. - target: String (enum: branch, tag, push, repository) indicating the rule target [1][2]. - source_type: String (enum: Repository, Organization, Enterprise) [1][2][3]. - enforcement: String (enum: disabled, active, evaluate) [1][2][3]. - bypass_actors: An array of objects defining bypass permissions (e.g., actor_id, actor_type, bypass_mode) [1][2][4]. - conditions: Objects defining the scope, such as ref_name (include/exclude arrays) [1][2][3]. - rules: An array of rule objects [5][6][3]. Each rule object must include a type (e.g., creation, update, deletion, required_linear_history, merge_queue) and, where applicable, a parameters object defining specific configurations [5][6]. Error Responses When interacting with these endpoints, the GitHub REST API typically returns the following standard HTTP status codes: - 200 OK: Request succeeded [7]. - 404 Resource not found: Returned if the specified organization or ruleset does not exist [7]. - 500 Internal Error: Returned when an unexpected server-side error occurs [7]. The rules array structure within a ruleset requires specific schema compliance based on the rule type, often necessitating a type property and a corresponding parameters object (e.g., for commit patterns, merge queue configurations, or required deployment branches) [5][6][3]. For further details on specific rule parameters, refer to the official GitHub REST API documentation for the version you are targeting [4][6].
Citations:
区分 API 失败与实际规则集漂移。
api()未返回 HTTP 状态码。列表响应不是数组时,脚本会将ORW_ID置为空并错误报告规则集不存在。详情响应不是对象或缺少rules数组时,脚本会将字段校验结果置为空并错误报告钉点漂移。在规则集存在性和字段比较前,校验响应类型。API 失败时进入 fail-closed 失败路径,不要报告为实际漂移。复用
governance/apply.sh第 48-50 行的列表响应校验模式。🤖 Prompt for AI Agents