Skip to content
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

Impossible to create new repositories with teams in version > 2.1.X #547

Open
svg153 opened this issue Nov 1, 2023 · 5 comments
Open

Impossible to create new repositories with teams in version > 2.1.X #547

svg153 opened this issue Nov 1, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@svg153
Copy link
Contributor

svg153 commented Nov 1, 2023

I'm preparing a demo for next Tuesday, and I would like to use the latest version 2.1.X since it includes improvements in the status report and the dry-run.

But...

Problem Description

I basic organization (for my demo: https://github.com/svg153-org/admin/) with only one team, when you try to create a new repository creating a PR, the validator fails, stating that it cannot verify the team that already exists on GitHub for that repository because it doesn't exist.

NOTE: i configured restrictedRepos, take into account for the validatior reports

restrictedRepos:
  exclude: ['^admin$', '^repo1$', '^repo2$', '^repo3$']

Fails with > 2.1.0, see below.
Works with 2.0.25, see this -> https://github.com/svg153-org/admin/pull/5/checks

But even if you ignore it, it still doesn't create it.

What is actually happening

DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/new-repo - 404
. . . 
DEBUG (event): Finding teams for svg153-org/new-repo
    id: "6b6eb1f0-78e3-11ee-9e76-1201a17f9b93"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/new-repo/teams - 404
ERROR (event): Error HttpError: Not Found in Teams for repo: {"repo":"new-repo","owner":"svg153-org"} entries [{"name":"all","permission":"pull"}]

What is the expected behavior

The validator doesn't fail in the pull request when you create a new repository. After merging into the main branch, you can create the repository.

Error output, if available

The first part is when creating the repository, which fails.
The second part is when, in the same pull request, you remove the "teams" block from the settings.yml.

Go to the public pull request linked: svg153-org/admin#4

  • Tested locally with tag 2.1.1-rc.1.

image

safe-settings on  HEAD (8ec4892) [!] via  v16.19.0 
➜  npm run dev 

> [email protected] dev
> nodemon --inspect

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): .env *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `npm start --inspect`

> [email protected] start
> probot run ./index.js

"repository_ruleset" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)
INFO (server): Running Probot v12.3.1 (Node.js: v16.19.0)
INFO (server): Listening on http://localhost:3000
DEBUG (probot): Not working on the default branch, returning...
INFO (http): POST / 200 - 24ms
DEBUG (probot): Is Admin repo event true
DEBUG (Safe-setting validator): GitHub request: POST https://api.github.com/repos/svg153-org/admin/check-runs - 201
    head_sha: "fc06ff40a8a3807b95902d5a45d0bff16a3c8503"
DEBUG (probot): {"status":201,"url":"https://api.github.com/repos/svg153-org/admin/check-runs","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"private, max-age=60, s-maxage=60","connection":"close","content-length":"2744","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Wed, 01 Nov 2023 18:52:43 GMT","etag":"\"77863d03a2f7735ea1570bbf397934d18daaee43d49a73abf75bc5010767c22e\"","location":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795075","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"checks=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"D680:A8C3:103ED2F4:1064E3E8:65429E7A","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4885","x-ratelimit-reset":"1698866313","x-ratelimit-resource":"core","x-ratelimit-used":"115","x-xss-protection":"0"},"data":{"id":18274795075,"name":"Safe-setting validator","node_id":"CR_kwDOKn-6Sc8AAAAEQUM-Qw","head_sha":"fc06ff40a8a3807b95902d5a45d0bff16a3c8503","external_id":"","url":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795075","html_url":"https://github.com/svg153-org/admin/runs/18274795075","details_url":"https://github.com/organizations/svg153-org","status":"queued","conclusion":null,"started_at":"2023-11-01T18:52:43Z","completed_at":null,"output":{"title":null,"summary":null,"text":null,"annotations_count":0,"annotations_url":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795075/annotations"},"check_suite":{"id":17827654690},"app":{"id":415644,"slug":"safe-settings-svg153-org","node_id":"A_kwHOCOdWdc4ABlec","owner":{"login":"svg153-org","id":149378677,"node_id":"O_kgDOCOdWdQ","avatar_url":"https://avatars.githubusercontent.com/u/149378677?v=4","gravatar_id":"","url":"https://api.github.com/users/svg153-org","html_url":"https://github.com/svg153-org","followers_url":"https://api.github.com/users/svg153-org/followers","following_url":"https://api.github.com/users/svg153-org/following{/other_user}","gists_url":"https://api.github.com/users/svg153-org/gists{/gist_id}","starred_url":"https://api.github.com/users/svg153-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svg153-org/subscriptions","organizations_url":"https://api.github.com/users/svg153-org/orgs","repos_url":"https://api.github.com/users/svg153-org/repos","events_url":"https://api.github.com/users/svg153-org/events{/privacy}","received_events_url":"https://api.github.com/users/svg153-org/received_events","type":"Organization","site_admin":false},"name":"safe-settings svg153-org","description":"","external_url":"https://github.com/organizations/svg153-org","html_url":"https://github.com/apps/safe-settings-svg153-org","created_at":"2023-10-30T10:54:07Z","updated_at":"2023-11-01T16:09:58Z","permissions":{"administration":"write","checks":"write","contents":"write","issues":"write","members":"write","metadata":"read","organization_administration":"write","pull_requests":"write","statuses":"write","workflows":"write"},"events":["branch_protection_rule","check_run","check_suite","member","pull_request","push","repository","team"]},"pull_requests":[{"url":"https://api.github.com/repos/svg153-org/admin/pulls/4","id":1583150715,"number":4,"head":{"ref":"test-repo-creation-with-2.1.1-rc1","sha":"fc06ff40a8a3807b95902d5a45d0bff16a3c8503","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}},"base":{"ref":"main","sha":"d19d988744f12e57b21e870724521324acdfe989","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}}}]}}
INFO (http): POST / 200 - 1200ms
DEBUG (probot): Pull_request opened !
DEBUG (probot): Is Admin repo event true
DEBUG (Safe-setting validator): GitHub request: POST https://api.github.com/repos/svg153-org/admin/check-runs - 201
    head_sha: "fc06ff40a8a3807b95902d5a45d0bff16a3c8503"
DEBUG (probot): {"status":201,"url":"https://api.github.com/repos/svg153-org/admin/check-runs","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"private, max-age=60, s-maxage=60","connection":"close","content-length":"2744","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Wed, 01 Nov 2023 18:52:43 GMT","etag":"\"7f3ba60fdff0031b6bb9be1317bdb8dc9c61eb0e53f433d28b650a621a6757cb\"","location":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795324","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"checks=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"D684:A8C3:103ED539:1064E641:65429E7B","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4884","x-ratelimit-reset":"1698866313","x-ratelimit-resource":"core","x-ratelimit-used":"116","x-xss-protection":"0"},"data":{"id":18274795324,"name":"Safe-setting validator","node_id":"CR_kwDOKn-6Sc8AAAAEQUM_PA","head_sha":"fc06ff40a8a3807b95902d5a45d0bff16a3c8503","external_id":"","url":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795324","html_url":"https://github.com/svg153-org/admin/runs/18274795324","details_url":"https://github.com/organizations/svg153-org","status":"queued","conclusion":null,"started_at":"2023-11-01T18:52:43Z","completed_at":null,"output":{"title":null,"summary":null,"text":null,"annotations_count":0,"annotations_url":"https://api.github.com/repos/svg153-org/admin/check-runs/18274795324/annotations"},"check_suite":{"id":17827654690},"app":{"id":415644,"slug":"safe-settings-svg153-org","node_id":"A_kwHOCOdWdc4ABlec","owner":{"login":"svg153-org","id":149378677,"node_id":"O_kgDOCOdWdQ","avatar_url":"https://avatars.githubusercontent.com/u/149378677?v=4","gravatar_id":"","url":"https://api.github.com/users/svg153-org","html_url":"https://github.com/svg153-org","followers_url":"https://api.github.com/users/svg153-org/followers","following_url":"https://api.github.com/users/svg153-org/following{/other_user}","gists_url":"https://api.github.com/users/svg153-org/gists{/gist_id}","starred_url":"https://api.github.com/users/svg153-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svg153-org/subscriptions","organizations_url":"https://api.github.com/users/svg153-org/orgs","repos_url":"https://api.github.com/users/svg153-org/repos","events_url":"https://api.github.com/users/svg153-org/events{/privacy}","received_events_url":"https://api.github.com/users/svg153-org/received_events","type":"Organization","site_admin":false},"name":"safe-settings svg153-org","description":"","external_url":"https://github.com/organizations/svg153-org","html_url":"https://github.com/apps/safe-settings-svg153-org","created_at":"2023-10-30T10:54:07Z","updated_at":"2023-11-01T16:09:58Z","permissions":{"administration":"write","checks":"write","contents":"write","issues":"write","members":"write","metadata":"read","organization_administration":"write","pull_requests":"write","statuses":"write","workflows":"write"},"events":["branch_protection_rule","check_run","check_suite","member","pull_request","push","repository","team"]},"pull_requests":[{"url":"https://api.github.com/repos/svg153-org/admin/pulls/4","id":1583150715,"number":4,"head":{"ref":"test-repo-creation-with-2.1.1-rc1","sha":"fc06ff40a8a3807b95902d5a45d0bff16a3c8503","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}},"base":{"ref":"main","sha":"d19d988744f12e57b21e870724521324acdfe989","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}}}]}}
INFO (http): POST / 200 - 654ms
DEBUG (probot): Check run was created!
DEBUG (probot): Is Admin repo event true
DEBUG (probot): Updating check run {"owner":"svg153-org","repo":"admin","check_run_id":18274795075,"status":"in_progress","started_at":"2023-11-01T18:52:45.369Z","output":{"title":"Starting NOP","summary":"initiating..."}}
DEBUG (probot): Check run was created!
DEBUG (probot): Is Admin repo event true
DEBUG (probot): Updating check run {"owner":"svg153-org","repo":"admin","check_run_id":18274795324,"status":"in_progress","started_at":"2023-11-01T18:52:45.914Z","output":{"title":"Starting NOP","summary":"initiating..."}}
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18274795075 - 200
    status: "in_progress"
    started_at: "2023-11-01T18:52:45.369Z"
    output: {
      "title": "Starting NOP",
      "summary": "initiating..."
    }
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/compare/d19d988744f12e57b21e870724521324acdfe989...fc06ff40a8a3807b95902d5a45d0bff16a3c8503 - 200
DEBUG (probot): ".github/repos/repo-failed.yml"
DEBUG (probot): deploymentConfig is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]}}
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsettings.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (probot): config for ref test-repo-creation-with-2.1.1-rc1 is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true}},"teams":[{"name":"all","permission":"pull"}]}
DEBUG (event):  In getSubOrgConfigMap {"repo":"repo-failed","owner":"svg153-org"}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event):  In loadConfigMap {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18274795324 - 200
    status: "in_progress"
    started_at: "2023-11-01T18:52:45.914Z"
    output: {
      "title": "Starting NOP",
      "summary": "initiating..."
    }
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsuborgs?ref=test-repo-creation-with-2.1.1-rc1 - 404
DEBUG (event): Error getting settings {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"} HttpError: Not Found
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event):  In getRepoConfigMap {"repo":"repo-failed","owner":"svg153-org"}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/compare/d19d988744f12e57b21e870724521324acdfe989...fc06ff40a8a3807b95902d5a45d0bff16a3c8503 - 200
DEBUG (probot): ".github/repos/repo-failed.yml"
DEBUG (probot): deploymentConfig is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]}}
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): repos directory info {"name":"repos","path":".github/repos","sha":"837dee9c8b0b4806de10c0885f5080135825c807","size":0,"url":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","html_url":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos","git_url":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","download_url":null,"type":"dir","_links":{"self":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","git":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","html":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos"}}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807?path=.github&ref=test-repo-creation-with-2.1.1-rc1&recursive=0 - 200
DEBUG (event): Total overrides found in getRepoConfigMap are 2
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsettings.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (probot): config for ref test-repo-creation-with-2.1.1-rc1 is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true}},"teams":[{"name":"all","permission":"pull"}]}
DEBUG (event):  In getSubOrgConfigMap {"repo":"repo-failed","owner":"svg153-org"}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event):  In loadConfigMap {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Frepos%2Frepo-failed.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): data = {"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): repo configs = {"repo-failed.yml":{"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}}}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Allowing repo-failed not in restrictedRepos.exclude [^admin$,^repo1$,^repo2$,^repo3$]
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Process normally... Not a SubOrg config change or SubOrg config was changed and this repo is part of it. {"repo":"repo-failed","owner":"svg153-org"} suborg config undefined
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): found a matching repoconfig for this repo {"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","org":"svg153-org","description":"repo-failed","force_create":true}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): suborg config for repo-failed  is undefined
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): consolidated config is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","org":"svg153-org","description":"repo-failed","force_create":true},"teams":[{"name":"all","permission":"pull"}]}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Found section teams in the config. Creating plugin...
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Syncing Repo repo-failed
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsuborgs?ref=test-repo-creation-with-2.1.1-rc1 - 404
DEBUG (event): Error getting settings {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"} HttpError: Not Found
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event):  In getRepoConfigMap {"repo":"repo-failed","owner":"svg153-org"}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/repo-failed - 404
INFO (event): Creating repo with settings 
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Creating Repo {"method":"POST","url":"https://api.github.com/orgs/svg153-org/repos","headers":{"accept":"application/vnd.github.nebula-preview+json","user-agent":"probot/12.3.1 octokit-core.js/3.5.1 Node.js/16.19.0 (linux; x64)","content-type":"application/json; charset=utf-8"},"body":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","description":"repo-failed","force_create":true,"repo":"repo-failed","owner":"svg153-org"},"request":{"retryCount":1}}  
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Finding teams for svg153-org/repo-failed
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): repos directory info {"name":"repos","path":".github/repos","sha":"837dee9c8b0b4806de10c0885f5080135825c807","size":0,"url":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","html_url":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos","git_url":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","download_url":null,"type":"dir","_links":{"self":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","git":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","html":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos"}}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/repo-failed/teams - 404
ERROR (event): Error HttpError: Not Found in Teams for repo: {"repo":"repo-failed","owner":"svg153-org"} entries [{"name":"all","permission":"pull"}]
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (event): Stats [
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "repo-failed",
    "endpoint": "https://api.github.com/orgs/svg153-org/repos",
    "body": {
      "auto_init": true,
      "private": true,
      "visibility": "private",
      "default_branch": "main",
      "has_issues": false,
      "has_projects": false,
      "has_discussions": false,
      "has_wiki": false,
      "allow_squash_merge": true,
      "allow_merge_commit": false,
      "allow_rebase_merge": false,
      "allow_auto_merge": true,
      "allow_update_branch": false,
      "delete_branch_on_merge": true,
      "security": {
        "enableVulnerabilityAlerts": true
      },
      "name": "repo-failed",
      "description": "repo-failed",
      "force_create": true,
      "repo": "repo-failed",
      "owner": "svg153-org"
    },
    "action": {
      "msg": "Create Repo",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  },
  {
    "type": "ERROR",
    "plugin": "Teams",
    "repo": "repo-failed",
    "endpoint": "",
    "body": "",
    "action": {
      "msg": "error HttpError: Not Found in Teams for repo: {\"repo\":\"repo-failed\",\"owner\":\"svg153-org\"} entries [{\"name\":\"all\",\"permission\":\"pull\"}]",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  }
]
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807?path=.github&ref=test-repo-creation-with-2.1.1-rc1&recursive=0 - 200
DEBUG (event): Total overrides found in getRepoConfigMap are 2
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Frepos%2Frepo-failed.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): data = {"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): repo configs = {"repo-failed.yml":{"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}}}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Allowing repo-failed not in restrictedRepos.exclude [^admin$,^repo1$,^repo2$,^repo3$]
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Process normally... Not a SubOrg config change or SubOrg config was changed and this repo is part of it. {"repo":"repo-failed","owner":"svg153-org"} suborg config undefined
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): found a matching repoconfig for this repo {"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","org":"svg153-org","description":"repo-failed","force_create":true}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): suborg config for repo-failed  is undefined
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): consolidated config is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","org":"svg153-org","description":"repo-failed","force_create":true},"teams":[{"name":"all","permission":"pull"}]}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Found section teams in the config. Creating plugin...
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Syncing Repo repo-failed
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/repo-failed - 404
INFO (event): Creating repo with settings 
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Creating Repo {"method":"POST","url":"https://api.github.com/orgs/svg153-org/repos","headers":{"accept":"application/vnd.github.nebula-preview+json","user-agent":"probot/12.3.1 octokit-core.js/3.5.1 Node.js/16.19.0 (linux; x64)","content-type":"application/json; charset=utf-8"},"body":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"repo-failed","description":"repo-failed","force_create":true,"repo":"repo-failed","owner":"svg153-org"},"request":{"retryCount":1}}  
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Finding teams for svg153-org/repo-failed
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/repo-failed/teams - 404
ERROR (event): Error HttpError: Not Found in Teams for repo: {"repo":"repo-failed","owner":"svg153-org"} entries [{"name":"all","permission":"pull"}]
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (event): Stats [
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "repo-failed",
    "endpoint": "https://api.github.com/orgs/svg153-org/repos",
    "body": {
      "auto_init": true,
      "private": true,
      "visibility": "private",
      "default_branch": "main",
      "has_issues": false,
      "has_projects": false,
      "has_discussions": false,
      "has_wiki": false,
      "allow_squash_merge": true,
      "allow_merge_commit": false,
      "allow_rebase_merge": false,
      "allow_auto_merge": true,
      "allow_update_branch": false,
      "delete_branch_on_merge": true,
      "security": {
        "enableVulnerabilityAlerts": true
      },
      "name": "repo-failed",
      "description": "repo-failed",
      "force_create": true,
      "repo": "repo-failed",
      "owner": "svg153-org"
    },
    "action": {
      "msg": "Create Repo",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  },
  {
    "type": "ERROR",
    "plugin": "Teams",
    "repo": "repo-failed",
    "endpoint": "",
    "body": "",
    "action": {
      "msg": "error HttpError: Not Found in Teams for repo: {\"repo\":\"repo-failed\",\"owner\":\"svg153-org\"} entries [{\"name\":\"all\",\"permission\":\"pull\"}]",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  }
]
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: POST https://api.github.com/repos/svg153-org/admin/issues/4/comments - 201
    body: "\n#### :robot: Safe-Settings config changes detected:\n\n<table>\n    <thead>\n    <tr>\n    <th>Msg</th>\n    <th>Plugin</th>\n    <th>Repo</th>\n    <th>Additions</th>\n    <th>Deletions</th>\n    <th>Modifications </th>\n    </tr>\n    </thead>\n    <tbody>\n    \n<tr><td> ❗ error HttpError: Not Found in Teams for repo: {\"repo\":\"repo-failed\",\"owner\":\"svg153-org\"} entries [{\"name\":\"all\",\"permission\":\"pull\"}] </td><td> Teams </td><td> \"repo-failed\" </td><td>  </td><td>  </td><td>  </td><tr>\n"
DEBUG (event): Completing check run {"owner":"svg153-org","repo":"admin","check_run_id":18274795075,"status":"completed","conclusion":"failure","completed_at":"2023-11-01T18:52:50.157Z","output":{"title":"Safe-Settings Dry-Run Finished with Error","summary":"* Run on: `Wed Nov 01 2023 19:52:48 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  |\n| -- | \n| repo-failed   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n  repo-failed: \n          * error HttpError: Not Found in Teams for repo: {&quot;repo&quot;:&quot;repo-failed&quot;,&quot;owner&quot;:&quot;svg153-org&quot;} entries [{&quot;name&quot;:&quot;all&quot;,&quot;permission&quot;:&quot;pull&quot;}]    \n  \n\n"}}
    id: "d6cbe810-78e7-11ee-93fb-16daefd3b279"
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18274795075 - 200
    status: "completed"
    conclusion: "failure"
    completed_at: "2023-11-01T18:52:50.157Z"
    output: {
      "title": "Safe-Settings Dry-Run Finished with Error",
      "summary": "* Run on: `Wed Nov 01 2023 19:52:48 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  |\n| -- | \n| repo-failed   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n  repo-failed: \n          * error HttpError: Not Found in Teams for repo: {&quot;repo&quot;:&quot;repo-failed&quot;,&quot;owner&quot;:&quot;svg153-org&quot;} entries [{&quot;name&quot;:&quot;all&quot;,&quot;permission&quot;:&quot;pull&quot;}]    \n  \n\n"
    }
INFO (http): POST / 200 - 6342ms
INFO (http): POST / 200 - 98ms
DEBUG (octokit): GitHub request: POST https://api.github.com/repos/svg153-org/admin/issues/4/comments - 201
    body: "\n#### :robot: Safe-Settings config changes detected:\n\n<table>\n    <thead>\n    <tr>\n    <th>Msg</th>\n    <th>Plugin</th>\n    <th>Repo</th>\n    <th>Additions</th>\n    <th>Deletions</th>\n    <th>Modifications </th>\n    </tr>\n    </thead>\n    <tbody>\n    \n<tr><td> ❗ error HttpError: Not Found in Teams for repo: {\"repo\":\"repo-failed\",\"owner\":\"svg153-org\"} entries [{\"name\":\"all\",\"permission\":\"pull\"}] </td><td> Teams </td><td> \"repo-failed\" </td><td>  </td><td>  </td><td>  </td><tr>\n"
DEBUG (event): Completing check run {"owner":"svg153-org","repo":"admin","check_run_id":18274795324,"status":"completed","conclusion":"failure","completed_at":"2023-11-01T18:52:52.953Z","output":{"title":"Safe-Settings Dry-Run Finished with Error","summary":"* Run on: `Wed Nov 01 2023 19:52:50 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  |\n| -- | \n| repo-failed   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n  repo-failed: \n          * error HttpError: Not Found in Teams for repo: {&quot;repo&quot;:&quot;repo-failed&quot;,&quot;owner&quot;:&quot;svg153-org&quot;} entries [{&quot;name&quot;:&quot;all&quot;,&quot;permission&quot;:&quot;pull&quot;}]    \n  \n\n"}}
    id: "d7213400-78e7-11ee-8b9b-8801cd80d4e0"
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18274795324 - 200
    status: "completed"
    conclusion: "failure"
    completed_at: "2023-11-01T18:52:52.953Z"
    output: {
      "title": "Safe-Settings Dry-Run Finished with Error",
      "summary": "* Run on: `Wed Nov 01 2023 19:52:50 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  |\n| -- | \n| repo-failed   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n  repo-failed: \n          * error HttpError: Not Found in Teams for repo: {&quot;repo&quot;:&quot;repo-failed&quot;,&quot;owner&quot;:&quot;svg153-org&quot;} entries [{&quot;name&quot;:&quot;all&quot;,&quot;permission&quot;:&quot;pull&quot;}]    \n  \n\n"
    }
INFO (http): POST / 200 - 8712ms
INFO (http): POST / 200 - 60ms
INFO (http): POST / 200 - 98ms

When I removed the team block from the safe-settings file

safe-settings on  HEAD (8ec4892) [!] via  v16.19.0 took 2s 
❯ npm run dev

> [email protected] dev
> nodemon --inspect

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): .env *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `npm start --inspect`

> [email protected] start
> probot run ./index.js

"repository_ruleset" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)
INFO (server): Running Probot v12.3.1 (Node.js: v16.19.0)
INFO (server): Listening on http://localhost:3000
DEBUG (probot): Not working on the default branch, returning...
INFO (http): POST / 200 - 21ms
DEBUG (probot): Is Admin repo event true
INFO (http): POST / 200 - 98ms
DEBUG (Safe-setting validator): GitHub request: POST https://api.github.com/repos/svg153-org/admin/check-runs - 201
    head_sha: "2950af3ed9ea67a391a3bdbcf9f586f66f3f5a47"
DEBUG (probot): {"status":201,"url":"https://api.github.com/repos/svg153-org/admin/check-runs","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"private, max-age=60, s-maxage=60","connection":"close","content-length":"2744","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Wed, 01 Nov 2023 19:08:47 GMT","etag":"\"7d9966051c354981f2540695ebca0c4e37587c48e5a615d397641f7d14f4340d\"","location":"https://api.github.com/repos/svg153-org/admin/check-runs/18275315939","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"checks=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"D663:398D:556C74:567C31:6542A23F","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4839","x-ratelimit-reset":"1698866313","x-ratelimit-resource":"core","x-ratelimit-used":"161","x-xss-protection":"0"},"data":{"id":18275315939,"name":"Safe-setting validator","node_id":"CR_kwDOKn-6Sc8AAAAEQUsw4w","head_sha":"2950af3ed9ea67a391a3bdbcf9f586f66f3f5a47","external_id":"","url":"https://api.github.com/repos/svg153-org/admin/check-runs/18275315939","html_url":"https://github.com/svg153-org/admin/runs/18275315939","details_url":"https://github.com/organizations/svg153-org","status":"queued","conclusion":null,"started_at":"2023-11-01T19:08:47Z","completed_at":null,"output":{"title":null,"summary":null,"text":null,"annotations_count":0,"annotations_url":"https://api.github.com/repos/svg153-org/admin/check-runs/18275315939/annotations"},"check_suite":{"id":17828114605},"app":{"id":415644,"slug":"safe-settings-svg153-org","node_id":"A_kwHOCOdWdc4ABlec","owner":{"login":"svg153-org","id":149378677,"node_id":"O_kgDOCOdWdQ","avatar_url":"https://avatars.githubusercontent.com/u/149378677?v=4","gravatar_id":"","url":"https://api.github.com/users/svg153-org","html_url":"https://github.com/svg153-org","followers_url":"https://api.github.com/users/svg153-org/followers","following_url":"https://api.github.com/users/svg153-org/following{/other_user}","gists_url":"https://api.github.com/users/svg153-org/gists{/gist_id}","starred_url":"https://api.github.com/users/svg153-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svg153-org/subscriptions","organizations_url":"https://api.github.com/users/svg153-org/orgs","repos_url":"https://api.github.com/users/svg153-org/repos","events_url":"https://api.github.com/users/svg153-org/events{/privacy}","received_events_url":"https://api.github.com/users/svg153-org/received_events","type":"Organization","site_admin":false},"name":"safe-settings svg153-org","description":"","external_url":"https://github.com/organizations/svg153-org","html_url":"https://github.com/apps/safe-settings-svg153-org","created_at":"2023-10-30T10:54:07Z","updated_at":"2023-11-01T16:09:58Z","permissions":{"administration":"write","checks":"write","contents":"write","issues":"write","members":"write","metadata":"read","organization_administration":"write","pull_requests":"write","statuses":"write","workflows":"write"},"events":["branch_protection_rule","check_run","check_suite","member","pull_request","push","repository","team"]},"pull_requests":[{"url":"https://api.github.com/repos/svg153-org/admin/pulls/4","id":1583150715,"number":4,"head":{"ref":"test-repo-creation-with-2.1.1-rc1","sha":"2950af3ed9ea67a391a3bdbcf9f586f66f3f5a47","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}},"base":{"ref":"main","sha":"d19d988744f12e57b21e870724521324acdfe989","repo":{"id":713013833,"url":"https://api.github.com/repos/svg153-org/admin","name":"admin"}}}]}}
INFO (http): POST / 200 - 1252ms
DEBUG (probot): Check run was created!
DEBUG (probot): Is Admin repo event true
DEBUG (probot): Updating check run {"owner":"svg153-org","repo":"admin","check_run_id":18275315939,"status":"in_progress","started_at":"2023-11-01T19:08:49.434Z","output":{"title":"Starting NOP","summary":"initiating..."}}
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18275315939 - 200
    status: "in_progress"
    started_at: "2023-11-01T19:08:49.434Z"
    output: {
      "title": "Starting NOP",
      "summary": "initiating..."
    }
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/compare/fc06ff40a8a3807b95902d5a45d0bff16a3c8503...2950af3ed9ea67a391a3bdbcf9f586f66f3f5a47 - 200
DEBUG (probot): Changes in '.github/settings.yml' detected, doing a full synch...
DEBUG (probot): deploymentConfig is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]}}
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsettings.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (probot): config for ref test-repo-creation-with-2.1.1-rc1 is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true}}}
DEBUG (event):  In getSubOrgConfigMap {"owner":"svg153-org","repo":"admin"}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event):  In loadConfigMap {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Fsuborgs?ref=test-repo-creation-with-2.1.1-rc1 - 404
DEBUG (event): Error getting settings {"owner":"svg153-org","repo":"admin","path":".github/suborgs","ref":"test-repo-creation-with-2.1.1-rc1"} HttpError: Not Found
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event):  In getRepoConfigMap {"owner":"svg153-org","repo":"admin"}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): repos directory info {"name":"repos","path":".github/repos","sha":"837dee9c8b0b4806de10c0885f5080135825c807","size":0,"url":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","html_url":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos","git_url":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","download_url":null,"type":"dir","_links":{"self":"https://api.github.com/repos/svg153-org/admin/contents/.github/repos?ref=test-repo-creation-with-2.1.1-rc1","git":"https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807","html":"https://github.com/svg153-org/admin/tree/test-repo-creation-with-2.1.1-rc1/.github/repos"}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/git/trees/837dee9c8b0b4806de10c0885f5080135825c807?path=.github&ref=test-repo-creation-with-2.1.1-rc1&recursive=0 - 200
DEBUG (event): Total overrides found in getRepoConfigMap are 2
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Frepos%2Frepo-failed.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): data = {"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/admin/contents/.github%2Frepos%2Ftest-repo.yml?ref=test-repo-creation-with-2.1.1-rc1 - 200
DEBUG (event): data = {"repository":{"name":"test-repo","description":"Example of a test repository manage by safe-settings","force_create":true,"topics":["safe-settings"]}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): repo configs = {"repo-failed.yml":{"repository":{"name":"repo-failed","description":"repo-failed","force_create":true}},"test-repo.yml":{"repository":{"name":"test-repo","description":"Example of a test repository manage by safe-settings","force_create":true,"topics":["safe-settings"]}}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Fetching repositories
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/installation/repositories - 200
DEBUG (event): Skipping excluded repo repo1 in restrictedRepos.exclude
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Skipping excluded repo repo2 in restrictedRepos.exclude
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Skipping excluded repo repo3 in restrictedRepos.exclude
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Skipping excluded repo admin in restrictedRepos.exclude
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Allowing test-repo not in restrictedRepos.exclude [^admin$,^repo1$,^repo2$,^repo3$]
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Process normally... Not a SubOrg config change or SubOrg config was changed and this repo is part of it. {"owner":"svg153-org","repo":"test-repo"} suborg config undefined
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): found a matching repoconfig for this repo {"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"test-repo","org":"svg153-org","description":"Example of a test repository manage by safe-settings","force_create":true,"topics":["safe-settings"]}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): suborg config for test-repo  is undefined
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): consolidated config is {"restrictedRepos":{"exclude":["^admin$","^repo1$","^repo2$","^repo3$"]},"repository":{"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"test-repo","org":"svg153-org","description":"Example of a test repository manage by safe-settings","force_create":true,"topics":["safe-settings"]}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Syncing Repo test-repo
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/svg153-org/test-repo - 200
DEBUG (event): Adding name for allow_auto_merge true
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Result of comparing repo for changes = [object Object]
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Result of comparing topics for changes source ["safe-settings"] target ["safe-settings"] = [object Object]
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): There are repo changes
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): There are no changes for repo {"owner":"svg153-org","repo":"test-repo"}.
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Updating repo with settings ["safe-settings"] {"mediaType":{"previews":["nebula-preview"]},"auto_init":true,"private":true,"visibility":"private","default_branch":"main","has_issues":false,"has_projects":false,"has_discussions":false,"has_wiki":false,"allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"allow_update_branch":false,"delete_branch_on_merge":true,"security":{"enableVulnerabilityAlerts":true},"name":"test-repo","org":"svg153-org","description":"Example of a test repository manage by safe-settings","force_create":true,"owner":"svg153-org","repo":"test-repo"}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
INFO (event): Found repo with security settings {"enableVulnerabilityAlerts":true}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
INFO (event): Enabling Dependabot alerts for owner: svg153-org and repo test-repo
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (event): Stats [
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "test-repo",
    "endpoint": "",
    "body": "",
    "action": {
      "msg": "Repository settings changes",
      "additions": {},
      "modifications": {
        "allow_auto_merge": true,
        "name": "test-repo"
      },
      "deletions": {}
    }
  },
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "test-repo",
    "endpoint": "",
    "body": "",
    "action": {
      "msg": "There are no changes for repo {\"owner\":\"svg153-org\",\"repo\":\"test-repo\"}.",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  },
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "test-repo",
    "endpoint": "https://api.github.com/repos/svg153-org/test-repo",
    "body": {
      "auto_init": true,
      "private": true,
      "visibility": "private",
      "default_branch": "main",
      "has_issues": false,
      "has_projects": false,
      "has_discussions": false,
      "has_wiki": false,
      "allow_squash_merge": true,
      "allow_merge_commit": false,
      "allow_rebase_merge": false,
      "allow_auto_merge": true,
      "allow_update_branch": false,
      "delete_branch_on_merge": true,
      "security": {
        "enableVulnerabilityAlerts": true
      },
      "name": "test-repo",
      "org": "svg153-org",
      "description": "Example of a test repository manage by safe-settings",
      "force_create": true
    },
    "action": {
      "msg": "Update Repo",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  },
  {
    "type": "INFO",
    "plugin": "Repository",
    "repo": "test-repo",
    "endpoint": "https://api.github.com/repos/svg153-org/test-repo/vulnerability-alerts",
    "body": "",
    "action": {
      "msg": "Enabling Dependabot alerts",
      "additions": null,
      "modifications": null,
      "deletions": null
    }
  },
  null,
  null,
  null,
  null,
  null
]
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: POST https://api.github.com/repos/svg153-org/admin/issues/4/comments - 201
    body: "\n#### :robot: Safe-Settings config changes detected:\n\n<table>\n    <thead>\n    <tr>\n    <th>Msg</th>\n    <th>Plugin</th>\n    <th>Repo</th>\n    <th>Additions</th>\n    <th>Deletions</th>\n    <th>Modifications </th>\n    </tr>\n    </thead>\n    <tbody>\n    \n<tr><td> ✋ </td><td> Repository </td><td> \"test-repo\" </td><td> {} </td><td> {} </td><td> {<br>&nbsp;&nbsp;\"allow_auto_merge\":&nbsp;true,<br>&nbsp;&nbsp;\"name\":&nbsp;\"test-repo\"<br>} </td><tr>\n"
DEBUG (event): Completing check run {"owner":"svg153-org","repo":"admin","check_run_id":18275315939,"status":"completed","conclusion":"success","completed_at":"2023-11-01T19:08:54.323Z","output":{"title":"Safe-Settings Dry-Run Finished with success","summary":"* Run on: `Wed Nov 01 2023 20:08:53 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  | Repository settings   |\n| --   | --  | \n| test-repo   |  :hand:   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n`None`\n\n\n"}}
    id: "15808a50-78ea-11ee-91b1-c1add0d5348f"
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/svg153-org/admin/check-runs/18275315939 - 200
    status: "completed"
    conclusion: "success"
    completed_at: "2023-11-01T19:08:54.323Z"
    output: {
      "title": "Safe-Settings Dry-Run Finished with success",
      "summary": "* Run on: `Wed Nov 01 2023 20:08:53 GMT+0100 (Central European Standard Time)`\n\n* Number of repos that were considered: `1`\n\n### Breakdown of changes\n| Repo  | Repository settings   |\n| --   | --  | \n| test-repo   |  :hand:   |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n`None`\n\n\n"
    }
INFO (http): POST / 200 - 5515ms
INFO (http): POST / 200 - 98ms
INFO (http): POST / 200 - 91ms

Context

Are you using the hosted instance of probot/settings or running your own?

Own

If running your own instance, are you using it with github.com or GitHub Enterprise?

github.com

Version of safe-settings

Failed con >2.1.1, But not with 2.0.25

Version of GitHub Enterprise

  • N/A
@svg153 svg153 added the bug Something isn't working label Nov 1, 2023
@decyjphr
Copy link
Collaborator

decyjphr commented Nov 1, 2023

@svg153 You are running this in dry-run , correct? So no repo is created and the teams plugin is throwing an error because it is getting a 404. Is my understanding correct? It might be that in the previous version this error was ignored and here it is not. Could be something in the diffable.js.

@decyjphr
Copy link
Collaborator

decyjphr commented Nov 1, 2023

Possibly because I added this code for error handling and it is incorrectly reporting 404. Probably, better to ignore the 404 since the repo itself doesn't exist at this point.

@decyjphr
Copy link
Collaborator

decyjphr commented Nov 1, 2023

@svg153 I tested the 2.1.1-rc.2 (which has a fix to ignore 404 in dry-run) and it seems to work. I was able to test a config for a new repo with teams. However, I have to test it further. Let me know if that works as expected.

@svg153
Copy link
Contributor Author

svg153 commented Nov 1, 2023

TL;DR

Tested with safe-setting running with npm run dev in git tag 2.1.1-rc2. Results in this PR svg153-org/admin#6

Correct, the validator no longer fails and leaves a message in the PR and in the check.

For me, this issue is closed. But I leave it to your choice.

Improvements

Although the message displayed is not very explicit. I think we could continue with the improvements to the reports that were included in 2.1.0 (great job). But it is true that the tool has improved a lot (since the first time I used the tool almost two years ago) Thanks.

Description

In this case, I would like to see everything that is going to be added. Because right now in that PR, you only see a PR comment from safe-setting with a table in with only the header, there are no rows. And in the check I only know that there is "Breakdown of changes" with a table with the name of the repo. I think this can cause a bit of confusion as you don't clearly see what you are going to do. It seems that the report has been left halfway, giving the feeling that something has been broken.

image

image

Expected

To give a specific example of this demo organization, I would expect a summary of the final consolidated configuration (like one of the debug message in the run), between general (setting.yml), suborg and specific to the repo (repo.yml)

Thanks

I really appreciate the work you are doing on this tool. I hope that GitHub will, at some point, give the true support that this tool deserves. Thank you very much for responding so soon. All the best.
PS: As soon as I have the link to the YouTube live on Tuesday, I'll make a PR to put it in the README. Although it will be in Spanish…

@svg153
Copy link
Contributor Author

svg153 commented Nov 21, 2023

Fixed #546 in commit 4998f97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants