From 7c4a4674c28fadbfea73b9427c32b0d221cdd507 Mon Sep 17 00:00:00 2001 From: docs-bot <77750099+docs-bot@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:50:17 -0700 Subject: [PATCH 1/2] Update OpenAPI Description (#43517) Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com> --- content/rest/orgs/index.md | 1 + content/rest/orgs/rule-suites.md | 14 + content/rest/orgs/rules.md | 2 +- content/rest/repos/index.md | 1 + content/rest/repos/rule-suites.md | 14 + .../fine-grained-pat-permissions.json | 36 + .../data/fpt-2022-11-28/fine-grained-pat.json | 24 + .../server-to-server-permissions.json | 44 + .../fpt-2022-11-28/server-to-server-rest.json | 24 + .../fpt-2022-11-28/user-to-server-rest.json | 24 + .../fine-grained-pat-permissions.json | 36 + .../ghec-2022-11-28/fine-grained-pat.json | 24 + .../server-to-server-permissions.json | 44 + .../server-to-server-rest.json | 24 + .../ghec-2022-11-28/user-to-server-rest.json | 24 + src/github-apps/lib/config.json | 2 +- src/rest/data/fpt-2022-11-28/schema.json | 905 ++++++++++++++++++ src/rest/data/ghec-2022-11-28/schema.json | 905 ++++++++++++++++++ src/rest/lib/config.json | 2 +- src/webhooks/lib/config.json | 2 +- 20 files changed, 2148 insertions(+), 4 deletions(-) create mode 100644 content/rest/orgs/rule-suites.md create mode 100644 content/rest/repos/rule-suites.md diff --git a/content/rest/orgs/index.md b/content/rest/orgs/index.md index 2d7e2e1b806d..a9eb11561aff 100644 --- a/content/rest/orgs/index.md +++ b/content/rest/orgs/index.md @@ -22,6 +22,7 @@ children: - /outside-collaborators - /personal-access-tokens - /rules + - /rule-suites - /security-managers - /webhooks autogenerated: rest diff --git a/content/rest/orgs/rule-suites.md b/content/rest/orgs/rule-suites.md new file mode 100644 index 000000000000..ada54ecc0299 --- /dev/null +++ b/content/rest/orgs/rule-suites.md @@ -0,0 +1,14 @@ +--- +title: Rule Suites +shortTitle: Rule Suites +intro: 'Use the REST API to manage rule suites for organizations.' +versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 + fpt: '*' + ghec: '*' +topics: + - API +autogenerated: rest +allowTitleToDifferFromFilename: true +--- + + diff --git a/content/rest/orgs/rules.md b/content/rest/orgs/rules.md index 1cf916535cfe..169160c7fa1a 100644 --- a/content/rest/orgs/rules.md +++ b/content/rest/orgs/rules.md @@ -2,7 +2,7 @@ title: Rules shortTitle: Rules intro: >- - Use the rulesets API to manage rulesets for repositories. Organization + Use the REST API to manage rulesets for organizations. Organization rulesets control how people can interact with selected branches and tags in repositories in an organization. versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 diff --git a/content/rest/repos/index.md b/content/rest/repos/index.md index 6520b6461f25..720d75997eeb 100644 --- a/content/rest/repos/index.md +++ b/content/rest/repos/index.md @@ -21,6 +21,7 @@ children: - /lfs - /repos - /rules + - /rule-suites - /tags autogenerated: rest --- diff --git a/content/rest/repos/rule-suites.md b/content/rest/repos/rule-suites.md new file mode 100644 index 000000000000..2d5585486609 --- /dev/null +++ b/content/rest/repos/rule-suites.md @@ -0,0 +1,14 @@ +--- +title: Rule Suites +shortTitle: Rule Suites +intro: 'Use the REST API to manage rule suites for repositories.' +versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 + fpt: '*' + ghec: '*' +topics: + - API +autogenerated: rest +allowTitleToDifferFromFilename: true +--- + + diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json index 73f5dce2eb5c..604dbb0f31d6 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json @@ -205,6 +205,24 @@ "additional-permissions": [], "access": "write" }, + { + "category": "orgs", + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "additional-permissions": [], + "access": "write" + }, + { + "category": "orgs", + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "additional-permissions": [], + "access": "write" + }, { "category": "orgs", "slug": "get-an-organization-repository-ruleset", @@ -2799,6 +2817,24 @@ "additional-permissions": [], "access": "write" }, + { + "category": "repos", + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "additional-permissions": [], + "access": "write" + }, + { + "category": "repos", + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "additional-permissions": [], + "access": "write" + }, { "category": "repos", "slug": "update-a-repository-ruleset", diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json index 99528a7b8b42..6244bce0b3eb 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json @@ -3002,6 +3002,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -3892,6 +3904,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json index ded4429fa05d..0a6952f9b5e8 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json @@ -249,6 +249,28 @@ "server-to-server": true, "additional-permissions": [] }, + { + "category": "orgs", + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, + { + "category": "orgs", + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, { "category": "orgs", "slug": "get-an-organization-repository-ruleset", @@ -3481,6 +3503,28 @@ "server-to-server": true, "additional-permissions": [] }, + { + "category": "repos", + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, + { + "category": "repos", + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, { "category": "repos", "slug": "update-a-repository-ruleset", diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json index 9226f1bcdb19..ac96e05f74fb 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json @@ -2606,6 +2606,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -3520,6 +3532,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json index 871cdc5f2a2e..4d8f2444f2f0 100644 --- a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json @@ -3068,6 +3068,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -3958,6 +3970,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json index 2e890042f88f..c58782579e81 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json @@ -477,6 +477,24 @@ "additional-permissions": [], "access": "write" }, + { + "category": "orgs", + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "additional-permissions": [], + "access": "write" + }, + { + "category": "orgs", + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "additional-permissions": [], + "access": "write" + }, { "category": "orgs", "slug": "get-an-organization-repository-ruleset", @@ -3457,6 +3475,24 @@ "additional-permissions": [], "access": "write" }, + { + "category": "repos", + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "additional-permissions": [], + "access": "write" + }, + { + "category": "repos", + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "additional-permissions": [], + "access": "write" + }, { "category": "repos", "slug": "update-a-repository-ruleset", diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json index e0b6a7e5f125..80bae6424d60 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json @@ -3324,6 +3324,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -4214,6 +4226,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json index 6600488afb43..d9f030fde27c 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json @@ -577,6 +577,28 @@ "server-to-server": true, "additional-permissions": [] }, + { + "category": "orgs", + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, + { + "category": "orgs", + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, { "category": "orgs", "slug": "get-an-organization-repository-ruleset", @@ -4275,6 +4297,28 @@ "server-to-server": true, "additional-permissions": [] }, + { + "category": "repos", + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, + { + "category": "repos", + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": [] + }, { "category": "repos", "slug": "update-a-repository-ruleset", diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json index 567e0f4b6953..56136b775148 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json @@ -2928,6 +2928,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -3842,6 +3854,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json index 6380f82a7430..1a890a547b49 100644 --- a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json @@ -3390,6 +3390,18 @@ "verb": "post", "requestPath": "/orgs/{org}/rulesets" }, + { + "slug": "list-organization-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites" + }, + { + "slug": "get-an-organization-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-an-organization-repository-ruleset", "subcategory": "rules", @@ -4280,6 +4292,18 @@ "verb": "post", "requestPath": "/repos/{owner}/{repo}/rulesets" }, + { + "slug": "list-repository-rule-suites", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites" + }, + { + "slug": "get-a-repository-rule-suite", + "subcategory": "rule-suites", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + }, { "slug": "get-a-repository-ruleset", "subcategory": "rules", diff --git a/src/github-apps/lib/config.json b/src/github-apps/lib/config.json index fc164d5d114b..6a4cb5e0456c 100644 --- a/src/github-apps/lib/config.json +++ b/src/github-apps/lib/config.json @@ -60,5 +60,5 @@ "2022-11-28" ] }, - "sha": "588349f3b71883016d36d3185aee4697ef812f41" + "sha": "ffaf232180dbaff57ce08fa5490df44bbc606501" } \ No newline at end of file diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json index c22f3e12a660..ac7ef8e0c4ea 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -361836,6 +361836,448 @@ ] } ], + "rule-suites": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "title": "List organization rule suites", + "category": "orgs", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repository_name", + "description": "

The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned.

", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "time_period", + "description": "

The time period to filter by.

\n

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for insights that occurred in the past 7 days (168 hours).

", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month" + ], + "default": "day" + } + }, + { + "name": "actor_name", + "description": "

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_result", + "description": "

The rule results to filter on. When specified, only suites with this result will be returned.

", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass", + "all" + ], + "default": "all" + } + }, + { + "name": "per_page", + "description": "

The number of results per page (max 100).

", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + } + }, + { + "name": "page", + "description": "

Page number of the results to fetch.

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass" + }, + { + "id": 25, + "actor_id": 11, + "username": "not-octocat", + "before_sha": "48994e4e01ccc943624c6231f172702b82b233cc", + "after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1", + "ref": "refs/heads/i-am-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-07T08:43:03Z", + "result": "pass", + "evaluation_result": "fail" + } + ], + "schema": { + "title": "Rule Suites", + "description": "Response", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Lists suites of rule evaluations at the organization level.\nFor more information, see \"Managing rulesets for repositories in your organization.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "title": "Get an organization rule suite", + "category": "orgs", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_id", + "description": "

The unique identifier of the rule suite result.\nTo get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites\nfor repositories and GET /orgs/{org}/rulesets/rule-suites\nfor organizations.

", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "rule_suite_id": "RULE_SUITE_ID" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass", + "evaluation_result": "fail", + "rule_evaluations": [ + { + "rule_source": { + "type": "ruleset", + "id": 2, + "name": "Author email must be a GitHub email address" + }, + "enforcement": "active", + "result": "pass", + "rule_type": "commit_author_email_pattern" + }, + { + "rule_source": { + "type": "protected_branch" + }, + "enforcement": "active", + "result": "fail", + "rule_type": "pull_request", + "details": "Changes must be made through a pull request." + }, + { + "rule_source": { + "type": "ruleset", + "id": 3, + "name": "Evaluate commit message pattern" + }, + "enforcement": "evaluate", + "result": "fail", + "rule_type": "commit_message_pattern" + } + ] + }, + "schema": { + "title": "Rule Suite", + "description": "Response", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + }, + "rule_evaluations": { + "type": "array", + "description": "Details on the evaluated rules.", + "items": { + "type": "object", + "properties": { + "rule_source": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of rule source." + }, + "id": { + "type": [ + "integer", + "null" + ], + "description": "The ID of the rule source." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "The name of the rule source." + } + } + }, + "enforcement": { + "type": "string", + "enum": [ + "active", + "evaluate", + "deleted ruleset" + ], + "description": "The enforcement level of this rule source." + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the evaluation of the individual rule." + }, + "rule_type": { + "type": "string", + "description": "The type of rule." + }, + "details": { + "type": "string", + "description": "Any associated details with the rule evaluation." + } + } + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Gets information about a suite of rule evaluations from within an organization.\nFor more information, see \"Managing rulesets for repositories in your organization.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "rules": [ { "serverUrl": "https://api.github.com", @@ -482573,6 +483015,469 @@ ] } ], + "rule-suites": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "title": "List repository rule suites", + "category": "repos", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "owner", + "description": "

The account owner of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "

The name of the repository without the .git extension. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ref", + "description": "

The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned.

", + "in": "query", + "schema": { + "type": "string" + }, + "x-multi-segment": true + }, + { + "name": "time_period", + "description": "

The time period to filter by.

\n

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for insights that occurred in the past 7 days (168 hours).

", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month" + ], + "default": "day" + } + }, + { + "name": "actor_name", + "description": "

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_result", + "description": "

The rule results to filter on. When specified, only suites with this result will be returned.

", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass", + "all" + ], + "default": "all" + } + }, + { + "name": "per_page", + "description": "

The number of results per page (max 100).

", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + } + }, + { + "name": "page", + "description": "

Page number of the results to fetch.

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "owner": "OWNER", + "repo": "REPO" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass" + }, + { + "id": 25, + "actor_id": 11, + "username": "not-octocat", + "before_sha": "48994e4e01ccc943624c6231f172702b82b233cc", + "after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1", + "ref": "refs/heads/i-am-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-07T08:43:03Z", + "result": "pass", + "evaluation_result": "fail" + } + ], + "schema": { + "title": "Rule Suites", + "description": "Response", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Lists suites of rule evaluations at the repository level.\nFor more information, see \"Managing rulesets for a repository.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "title": "Get a repository rule suite", + "category": "repos", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "owner", + "description": "

The account owner of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "

The name of the repository without the .git extension. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_id", + "description": "

The unique identifier of the rule suite result.\nTo get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites\nfor repositories and GET /orgs/{org}/rulesets/rule-suites\nfor organizations.

", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "owner": "OWNER", + "repo": "REPO", + "rule_suite_id": "RULE_SUITE_ID" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass", + "evaluation_result": "fail", + "rule_evaluations": [ + { + "rule_source": { + "type": "ruleset", + "id": 2, + "name": "Author email must be a GitHub email address" + }, + "enforcement": "active", + "result": "pass", + "rule_type": "commit_author_email_pattern" + }, + { + "rule_source": { + "type": "protected_branch" + }, + "enforcement": "active", + "result": "fail", + "rule_type": "pull_request", + "details": "Changes must be made through a pull request." + }, + { + "rule_source": { + "type": "ruleset", + "id": 3, + "name": "Evaluate commit message pattern" + }, + "enforcement": "evaluate", + "result": "fail", + "rule_type": "commit_message_pattern" + } + ] + }, + "schema": { + "title": "Rule Suite", + "description": "Response", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + }, + "rule_evaluations": { + "type": "array", + "description": "Details on the evaluated rules.", + "items": { + "type": "object", + "properties": { + "rule_source": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of rule source." + }, + "id": { + "type": [ + "integer", + "null" + ], + "description": "The ID of the rule source." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "The name of the rule source." + } + } + }, + "enforcement": { + "type": "string", + "enum": [ + "active", + "evaluate", + "deleted ruleset" + ], + "description": "The enforcement level of this rule source." + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the evaluation of the individual rule." + }, + "rule_type": { + "type": "string", + "description": "The type of rule." + }, + "details": { + "type": "string", + "description": "Any associated details with the rule evaluation." + } + } + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Gets information about a suite of rule evaluations from within a repository.\nFor more information, see \"Managing rulesets for a repository.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "rules": [ { "serverUrl": "https://api.github.com", diff --git a/src/rest/data/ghec-2022-11-28/schema.json b/src/rest/data/ghec-2022-11-28/schema.json index d3020b80f2a1..71ac43102465 100644 --- a/src/rest/data/ghec-2022-11-28/schema.json +++ b/src/rest/data/ghec-2022-11-28/schema.json @@ -384132,6 +384132,448 @@ ] } ], + "rule-suites": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites", + "title": "List organization rule suites", + "category": "orgs", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repository_name", + "description": "

The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned.

", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "time_period", + "description": "

The time period to filter by.

\n

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for insights that occurred in the past 7 days (168 hours).

", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month" + ], + "default": "day" + } + }, + { + "name": "actor_name", + "description": "

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_result", + "description": "

The rule results to filter on. When specified, only suites with this result will be returned.

", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass", + "all" + ], + "default": "all" + } + }, + { + "name": "per_page", + "description": "

The number of results per page (max 100).

", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + } + }, + { + "name": "page", + "description": "

Page number of the results to fetch.

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass" + }, + { + "id": 25, + "actor_id": 11, + "username": "not-octocat", + "before_sha": "48994e4e01ccc943624c6231f172702b82b233cc", + "after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1", + "ref": "refs/heads/i-am-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-07T08:43:03Z", + "result": "pass", + "evaluation_result": "fail" + } + ], + "schema": { + "title": "Rule Suites", + "description": "Response", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Lists suites of rule evaluations at the organization level.\nFor more information, see \"Managing rulesets for repositories in your organization.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", + "title": "Get an organization rule suite", + "category": "orgs", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_id", + "description": "

The unique identifier of the rule suite result.\nTo get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites\nfor repositories and GET /orgs/{org}/rulesets/rule-suites\nfor organizations.

", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "rule_suite_id": "RULE_SUITE_ID" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass", + "evaluation_result": "fail", + "rule_evaluations": [ + { + "rule_source": { + "type": "ruleset", + "id": 2, + "name": "Author email must be a GitHub email address" + }, + "enforcement": "active", + "result": "pass", + "rule_type": "commit_author_email_pattern" + }, + { + "rule_source": { + "type": "protected_branch" + }, + "enforcement": "active", + "result": "fail", + "rule_type": "pull_request", + "details": "Changes must be made through a pull request." + }, + { + "rule_source": { + "type": "ruleset", + "id": 3, + "name": "Evaluate commit message pattern" + }, + "enforcement": "evaluate", + "result": "fail", + "rule_type": "commit_message_pattern" + } + ] + }, + "schema": { + "title": "Rule Suite", + "description": "Response", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + }, + "rule_evaluations": { + "type": "array", + "description": "Details on the evaluated rules.", + "items": { + "type": "object", + "properties": { + "rule_source": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of rule source." + }, + "id": { + "type": [ + "integer", + "null" + ], + "description": "The ID of the rule source." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "The name of the rule source." + } + } + }, + "enforcement": { + "type": "string", + "enum": [ + "active", + "evaluate", + "deleted ruleset" + ], + "description": "The enforcement level of this rule source." + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the evaluation of the individual rule." + }, + "rule_type": { + "type": "string", + "description": "The type of rule." + }, + "details": { + "type": "string", + "description": "Any associated details with the rule evaluation." + } + } + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Gets information about a suite of rule evaluations from within an organization.\nFor more information, see \"Managing rulesets for repositories in your organization.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "rules": [ { "serverUrl": "https://api.github.com", @@ -504997,6 +505439,469 @@ ] } ], + "rule-suites": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites", + "title": "List repository rule suites", + "category": "repos", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "owner", + "description": "

The account owner of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "

The name of the repository without the .git extension. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ref", + "description": "

The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned.

", + "in": "query", + "schema": { + "type": "string" + }, + "x-multi-segment": true + }, + { + "name": "time_period", + "description": "

The time period to filter by.

\n

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for insights that occurred in the past 7 days (168 hours).

", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month" + ], + "default": "day" + } + }, + { + "name": "actor_name", + "description": "

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_result", + "description": "

The rule results to filter on. When specified, only suites with this result will be returned.

", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass", + "all" + ], + "default": "all" + } + }, + { + "name": "per_page", + "description": "

The number of results per page (max 100).

", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + } + }, + { + "name": "page", + "description": "

Page number of the results to fetch.

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "owner": "OWNER", + "repo": "REPO" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass" + }, + { + "id": 25, + "actor_id": 11, + "username": "not-octocat", + "before_sha": "48994e4e01ccc943624c6231f172702b82b233cc", + "after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1", + "ref": "refs/heads/i-am-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-07T08:43:03Z", + "result": "pass", + "evaluation_result": "fail" + } + ], + "schema": { + "title": "Rule Suites", + "description": "Response", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Lists suites of rule evaluations at the repository level.\nFor more information, see \"Managing rulesets for a repository.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}", + "title": "Get a repository rule suite", + "category": "repos", + "subcategory": "rule-suites", + "parameters": [ + { + "name": "owner", + "description": "

The account owner of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "

The name of the repository without the .git extension. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rule_suite_id", + "description": "

The unique identifier of the rule suite result.\nTo get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites\nfor repositories and GET /orgs/{org}/rulesets/rule-suites\nfor organizations.

", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "owner": "OWNER", + "repo": "REPO", + "rule_suite_id": "RULE_SUITE_ID" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": { + "id": 21, + "actor_id": 12, + "username": "octocat", + "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", + "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", + "ref": "refs/heads/i-see-everything", + "repository_id": 404, + "repository_name": "octo-repo", + "pushed_at": "2023-07-06T08:43:03Z", + "result": "bypass", + "evaluation_result": "fail", + "rule_evaluations": [ + { + "rule_source": { + "type": "ruleset", + "id": 2, + "name": "Author email must be a GitHub email address" + }, + "enforcement": "active", + "result": "pass", + "rule_type": "commit_author_email_pattern" + }, + { + "rule_source": { + "type": "protected_branch" + }, + "enforcement": "active", + "result": "fail", + "rule_type": "pull_request", + "details": "Changes must be made through a pull request." + }, + { + "rule_source": { + "type": "ruleset", + "id": 3, + "name": "Evaluate commit message pattern" + }, + "enforcement": "evaluate", + "result": "fail", + "rule_type": "commit_message_pattern" + } + ] + }, + "schema": { + "title": "Rule Suite", + "description": "Response", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the rule insight." + }, + "actor_id": { + "type": "integer", + "description": "The number that identifies the user." + }, + "actor_name": { + "type": "string", + "description": "The handle for the GitHub user account." + }, + "before_sha": { + "type": "string", + "description": "The first commit sha before the push evaluation." + }, + "after_sha": { + "type": "string", + "description": "The last commit sha in the push evaluation." + }, + "ref": { + "type": "string", + "description": "The ref name that the evaluation ran on." + }, + "repository_id": { + "type": "integer", + "description": "The ID of the repository associated with the rule evaluation." + }, + "repository_name": { + "type": "string", + "description": "The name of the repository without the `.git` extension." + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "examples": [ + "2011-01-26T19:06:43Z" + ] + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail", + "bypass" + ], + "description": "The result of the rule evaluations for rules with the `active` enforcement status." + }, + "evaluation_result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`." + }, + "rule_evaluations": { + "type": "array", + "description": "Details on the evaluated rules.", + "items": { + "type": "object", + "properties": { + "rule_source": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of rule source." + }, + "id": { + "type": [ + "integer", + "null" + ], + "description": "The ID of the rule source." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "The name of the rule source." + } + } + }, + "enforcement": { + "type": "string", + "enum": [ + "active", + "evaluate", + "deleted ruleset" + ], + "description": "The enforcement level of this rule source." + }, + "result": { + "type": "string", + "enum": [ + "pass", + "fail" + ], + "description": "The result of the evaluation of the individual rule." + }, + "rule_type": { + "type": "string", + "description": "The type of rule." + }, + "details": { + "type": "string", + "description": "Any associated details with the rule evaluation." + } + } + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Gets information about a suite of rule evaluations from within a repository.\nFor more information, see \"Managing rulesets for a repository.\"

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "rules": [ { "serverUrl": "https://api.github.com", diff --git a/src/rest/lib/config.json b/src/rest/lib/config.json index cc24f35a9ea0..21731946b53f 100644 --- a/src/rest/lib/config.json +++ b/src/rest/lib/config.json @@ -36,5 +36,5 @@ ] } }, - "sha": "588349f3b71883016d36d3185aee4697ef812f41" + "sha": "ffaf232180dbaff57ce08fa5490df44bbc606501" } \ No newline at end of file diff --git a/src/webhooks/lib/config.json b/src/webhooks/lib/config.json index e2cb614872dd..0a079841d6ed 100644 --- a/src/webhooks/lib/config.json +++ b/src/webhooks/lib/config.json @@ -1,3 +1,3 @@ { - "sha": "588349f3b71883016d36d3185aee4697ef812f41" + "sha": "ffaf232180dbaff57ce08fa5490df44bbc606501" } \ No newline at end of file From 6c1ec8068ffddf4aaa996c1516d6566d9aa07ada Mon Sep 17 00:00:00 2001 From: Rachael Sewell Date: Fri, 29 Sep 2023 11:20:14 -0700 Subject: [PATCH 2/2] Remove duplicate content linter tests (#43282) --- src/content-linter/tests/lint-files.js | 112 +------------------------ 1 file changed, 1 insertion(+), 111 deletions(-) diff --git a/src/content-linter/tests/lint-files.js b/src/content-linter/tests/lint-files.js index 1c70ab30c9f2..f2f7c177134c 100755 --- a/src/content-linter/tests/lint-files.js +++ b/src/content-linter/tests/lint-files.js @@ -153,7 +153,6 @@ const oldVariableRegex = /{{\s*?site\.data\..*?}}/g // - {{ octicon-plus An example label }} // const oldOcticonRegex = /{{\s*?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s*?}}/g - const relativeArticleLinkErrorText = 'Found unexpected relative article links:' const languageLinkErrorText = 'Found article links with hard-coded language codes:' const versionLinkErrorText = 'Found article links with hard-coded version numbers:' @@ -328,15 +327,13 @@ describe('lint markdown content', () => { isTranscript, isTranscriptLanding, hasExperimentalAlternative, - frontmatterData, - rawContent + frontmatterData beforeAll(async () => { const fileContents = await fs.readFile(markdownAbsPath, 'utf8') const { data, content: bodyContent } = frontmatter(fileContents) content = bodyContent - rawContent = fileContents frontmatterData = data ast = fromMarkdown(content) isHidden = data.hidden === true @@ -354,25 +351,6 @@ describe('lint markdown content', () => { }) }) - test('placeholder string is not present in any markdown files', async () => { - // this article explains how to use todocs placeholder text so shouldn't fail this test - if ( - markdownRelPath === - 'content/contributing/collaborating-on-github-docs/using-the-todocs-placeholder-to-leave-notes.md' || - markdownRelPath === 'content/contributing/collaborating-on-github-docs/index.md' - ) { - return - } - const matches = rawContent.match(placeholderRegex) || [] - const placeholderStr = matches.length === 1 ? 'placeholder' : 'placeholders' - const errorMessage = ` - Found ${matches.length} ${placeholderStr} '${matches.join( - ', ', - )}' in this file! Please update all placeholders. - ` - expect(matches.length, errorMessage).toBe(0) - }) - test('hidden docs must be Early Access, Site Policy, Search, Experimental, or Transcript', async () => { // We need to support some non-Early Access hidden docs in Site Policy if (isHidden) { @@ -403,94 +381,6 @@ describe('lint markdown content', () => { } }) - test('relative URLs must start with "/"', async () => { - const matches = links.filter((link) => { - if ( - link.startsWith('http://') || - link.startsWith('https://') || - link.startsWith('tel:') || - link.startsWith('mailto:') || - link.startsWith('#') || - link.startsWith('/') - ) - return false - - return true - }) - - const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - }) - - test('must not leak Early Access doc URLs', async () => { - // Only execute for docs that are NOT Early Access - if (!isEarlyAccess) { - const matches = content.match(earlyAccessLinkRegex) || [] - const errorMessage = formatLinkError(earlyAccessLinkErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - } - }) - - test('must not leak Early Access image URLs', async () => { - // Only execute for docs that are NOT Early Access - if (!isEarlyAccess) { - const matches = content.match(earlyAccessImageRegex) || [] - const errorMessage = formatLinkError(earlyAccessImageErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - } - }) - - test('must have correctly formatted Early Access image URLs', async () => { - // Execute for ALL docs (not just Early Access) to ensure non-EA docs - // are not leaking incorrectly formatted EA image URLs - const matches = content.match(badEarlyAccessImageRegex) || [] - const errorMessage = formatLinkError(badEarlyAccessImageErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - }) - - test('does not use old site.data variable syntax', async () => { - const matches = content.match(oldVariableRegex) || [] - const matchesWithExample = matches.map((match) => { - const example = match.replace( - /{{\s*?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*?}}/g, - '{% data $1 %}', - ) - return `${match} => ${example}` - }) - const errorMessage = formatLinkError(oldVariableErrorText, matchesWithExample) - expect(matches.length, errorMessage).toBe(0) - }) - - test('does not use old octicon variable syntax', async () => { - const matches = content.match(oldOcticonRegex) || [] - const errorMessage = formatLinkError(oldOcticonErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - }) - - test('URLs must not contain a hard-coded language code', async () => { - const matches = links.filter((link) => { - return /\/(?:${languageCodes.join('|')})\//.test(link) - }) - - const errorMessage = formatLinkError(languageLinkErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - }) - - test('URLs must not contain a hard-coded domain name', async () => { - const initialMatches = content.match(domainLinkRegex) || [] - - // Filter out some very specific false positive matches - const matches = initialMatches.filter(() => { - if (markdownRelPath === 'content/admin/all-releases.md') { - return false - } - return true - }) - - const errorMessage = formatLinkError(domainLinkErrorText, matches) - expect(matches.length, errorMessage).toBe(0) - }) - test('contains no deprecated frontmatter properties', async () => { if (!isEarlyAccess) { const usedDeprecateProps = deprecatedProperties.filter((prop) => {