|
| 1 | +## Status checks inheritance across scopes |
| 2 | + |
| 3 | +### Rulesets |
| 4 | + |
| 5 | +The status checks between organisation and repository rulesets are independent of each together. |
| 6 | + |
| 7 | +In the following examples, a common ruleset name is used at all levels. Repo1 and Repo2 are managed at the Sub-org level. |
| 8 | + |
| 9 | +#### No custom checks |
| 10 | +``` |
| 11 | +Org checks: |
| 12 | + Org Check |
| 13 | +Sub-org checks: |
| 14 | + Sub-org Check |
| 15 | +Repo checks for Repo2: |
| 16 | + Repo Check |
| 17 | +``` |
| 18 | + |
| 19 | +Status checks: |
| 20 | + - Newly deployed rules: |
| 21 | + - Org: Org Check |
| 22 | + - Repo1: Sub-org Check |
| 23 | + - Repo2: _Failed to deploy as required_status_checks can't be defined twice in both sub-org and repo level_ |
| 24 | + - Updating status checks via GitHub UI: |
| 25 | + - Org: Status checks reverted back to safe settings |
| 26 | + - Repo1: Status checks reverted back to safe settings |
| 27 | + - Repo2: NA |
| 28 | + |
| 29 | +#### No custom checks 2 |
| 30 | +``` |
| 31 | +Org checks: |
| 32 | + Org Check |
| 33 | +Sub-org checks: |
| 34 | + Sub-org Check |
| 35 | +Repo checks for Repo2: |
| 36 | + _NONE_ |
| 37 | +``` |
| 38 | + |
| 39 | +Status checks: |
| 40 | + - Newly deployed rules: |
| 41 | + - Org: Org Check |
| 42 | + - Repo1: Sub-org Check |
| 43 | + - Repo2: _NONE_ |
| 44 | + - Updating status checks via GitHub UI: |
| 45 | + - Org: Status checks reverted back to safe settings |
| 46 | + - Repo1: Status checks reverted back to safe settings |
| 47 | + - Repo2: Custom status checks are retained |
| 48 | + |
| 49 | +**The remaining tests will leave Repo2 out of the Sub-org.** |
| 50 | + |
| 51 | +#### Custom checks enabled at the Org and Sub-org level |
| 52 | +``` |
| 53 | +Org: |
| 54 | + Org Check |
| 55 | + {{EXTERNALLY_DEFINED}} |
| 56 | +Sub-org checks: |
| 57 | + Sub-org Check |
| 58 | + {{EXTERNALLY_DEFINED}} |
| 59 | +Repo checks for Repo2: |
| 60 | + Repo Check |
| 61 | +``` |
| 62 | + |
| 63 | +Status checks: |
| 64 | + - Newly deployed rules: |
| 65 | + - Org: [] |
| 66 | + - Repo1: [] |
| 67 | + - Repo2: Repo Check |
| 68 | + - Updating status checks via GitHub UI: |
| 69 | + - Org: Custom status checks are retained |
| 70 | + - Repo1: Custom status checks are retained |
| 71 | + - Repo2: Status checks reverted back to safe settings |
| 72 | + |
| 73 | +#### Custom checks enabled at the Repo level |
| 74 | +``` |
| 75 | +Org: |
| 76 | + Org Check |
| 77 | +Sub-org checks: |
| 78 | + Sub-org Check |
| 79 | +Repo checks for Repo2: |
| 80 | + Repo Check |
| 81 | + {{EXTERNALLY_DEFINED}} |
| 82 | +``` |
| 83 | + |
| 84 | +Status checks: |
| 85 | + - Newly deployed rules: |
| 86 | + - Org: Org Check |
| 87 | + - Repo1: Sub-org Check |
| 88 | + - Repo2: [] |
| 89 | + - Updating status checks via GitHub UI: |
| 90 | + - Org: Status checks reverted back to safe settings |
| 91 | + - Repo1: Status checks reverted back to safe settings |
| 92 | + - Repo2: Custom status checks are retained |
| 93 | + |
| 94 | + |
| 95 | +### Branch protection rules |
| 96 | + |
| 97 | +In the following examples the `main` branch is protected at all levels. Repo1 and Repo2 are managed at the Sub-org level. |
| 98 | + |
| 99 | +#### No custom checks |
| 100 | +``` |
| 101 | +Org checks: |
| 102 | + Org Check |
| 103 | +Sub-org checks: |
| 104 | + Sub-org Check |
| 105 | +Repo checks for Repo2: |
| 106 | + Repo Check |
| 107 | +``` |
| 108 | + |
| 109 | +Status checks: |
| 110 | + - Newly deployed rules: |
| 111 | + - Repo1: Org Check, Sub-org Check |
| 112 | + - Repo2: Org Check, Sub-org Check, Repo Check |
| 113 | + - Updating status checks via GitHub UI: |
| 114 | + - Repo1: Status checks reverted back to safe settings |
| 115 | + - Repo2: Status checks reverted back to safe settings |
| 116 | + |
| 117 | +#### Custom checks enabled at the Org level |
| 118 | +``` |
| 119 | +Org: |
| 120 | + Org Check |
| 121 | + {{EXTERNALLY_DEFINED}} |
| 122 | +Sub-org checks: |
| 123 | + Sub-org Check |
| 124 | +Repo checks for Repo2: |
| 125 | + Repo Check |
| 126 | +``` |
| 127 | + |
| 128 | +Status checks: |
| 129 | + - Newly deployed rules: |
| 130 | + - Repo1: [] |
| 131 | + - Repo2: [] |
| 132 | + - Updating status checks via GitHub UI: |
| 133 | + - Repo1: Custom status checks are retained |
| 134 | + - Repo2: Custom status checks are retained |
| 135 | + |
| 136 | +#### Custom checks enabled at the Sub-org level |
| 137 | +``` |
| 138 | +Org: |
| 139 | + Org Check |
| 140 | +Sub-org checks: |
| 141 | + Sub-org Check |
| 142 | + {{EXTERNALLY_DEFINED}} |
| 143 | +Repo checks for Repo2: |
| 144 | + Repo Check |
| 145 | +``` |
| 146 | + |
| 147 | +Status checks: |
| 148 | + - Newly deployed rules: |
| 149 | + - Repo1: [] |
| 150 | + - Repo2: [] |
| 151 | + - Updating status checks via GitHub UI: |
| 152 | + - Repo1: Custom status checks are retained |
| 153 | + - Repo2: Custom status checks are retained |
| 154 | + |
| 155 | +#### Custom checks enabled at the Repo level |
| 156 | +``` |
| 157 | +Org: |
| 158 | + Org Check |
| 159 | +Sub-org checks: |
| 160 | + Sub-org Check |
| 161 | +Repo checks for Repo2: |
| 162 | + Repo Check |
| 163 | + {{EXTERNALLY_DEFINED}} |
| 164 | +``` |
| 165 | + |
| 166 | +Status checks: |
| 167 | + - Newly deployed rules: |
| 168 | + - Repo1: Org Check, Sub-org Check |
| 169 | + - Repo2: [] |
| 170 | + - Updating status checks via GitHub UI: |
| 171 | + - Repo1: Status checks reverted back to safe settings |
| 172 | + - Repo2: Custom status checks are retained |
0 commit comments