utopia-ia/elffuss-braid public
Changesets · Branches · Tags · Compare
| Changeset | 4da9bb424185c437d5bb8ed065e9a2b4366c933106d6677cff11828586174e89 |
|---|---|
| Author | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-22 18:18 +02:00 |
| Committer | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-22 18:18 +02:00 |
| Parents | adef7e4baed3 |
3 files changed
modified crates/cli/src/hub/verify.rs +6 −3
| @@ -138,9 +138,12 @@ | ||
| 138 | 138 | pub(crate) const RESET_HELP: &str = |
| 139 | 139 | "Its admins only. With --green REV, move green to that changeset of the |
| 140 | 140 | default branch, backward too: it must be on the first-parent chain of the |
| 141 | -branch's head. Without --green, dismiss the fails there are now: they no | |
| 142 | -longer count, and only a new one turns the branch red again. Either way | |
| 143 | -red is cleared, and the log records who did it. REV is a changeset's id | |
| 141 | +branch's head. The verdicts given before the reset on the changesets above | |
| 142 | +it are forgotten, so the reset holds: green moves on, and red comes back, | |
| 143 | +only on verdicts given after it. Without --green, dismiss the fails there | |
| 144 | +are now: they no longer count, and only a new one turns the branch red | |
| 145 | +again. Either way red is cleared, and the log records who did it. A reset | |
| 146 | +needs the policy on. REV is a changeset's id | |
| 144 | 147 | or, in a repository that holds it, any revision braid resolves there. |
| 145 | 148 | |
| 146 | 149 | The reset goes with an Idempotency-Key, and once more with the same key |
modified crates/hubproto/src/verify.rs +3 −1
| @@ -495,7 +495,9 @@ | ||
| 495 | 495 | #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] |
| 496 | 496 | #[serde(default)] |
| 497 | 497 | pub struct VerifyReset { |
| 498 | - /// Where green goes, on the head's first-parent chain, backward too; | |
| 498 | + /// Where green goes, on the head's first-parent chain, backward too: | |
| 499 | + /// the verdicts given before the reset on the changesets above it are | |
| 500 | + /// forgotten, so that only new ones move green or bring red back. | |
| 499 | 501 | /// `None` dismisses the fails there are now instead. |
| 500 | 502 | #[serde(with = "hex::opt_id")] |
| 501 | 503 | pub green: Option<ObjectId>, |
modified docs/hub.md +32 −15
| @@ -700,7 +700,10 @@ | ||
| 700 | 700 | |
| 701 | 701 | A landing on the default branch of a repository whose verification is |
| 702 | 702 | on (section 25), a change request's landing included, also carries |
| 703 | - `verify`: how the branch stands once the landing is done. | |
| 703 | + `verify`: how the branch stands once the landing is done, from the | |
| 704 | + hub's last decision, which the landing does not wait for: `green` turns | |
| 705 | + to `pending` when the landing put changesets above green, and a red | |
| 706 | + branch stays red. | |
| 704 | 707 | |
| 705 | 708 | ```json |
| 706 | 709 | "verify": {"state": "red", "green": "<id>|null", "red": "<id>|null", |
| @@ -2894,13 +2897,18 @@ | ||
| 2894 | 2897 | the logins whose verdicts count, 1 to 10, kept lowercase. |
| 2895 | 2898 | |
| 2896 | 2899 | A field the hub does not know, a `mode` other than `off` and `report`, a |
| 2897 | -`green_from` that is empty or names a source the policy has no block for, | |
| 2898 | -a suite or reporters outside those bounds, and `report` missing with mode | |
| 2899 | -`report` are 400 `invalid`, with a detail that says which: nothing is | |
| 2900 | -dropped without a word. A change counts toward the account's limits as an | |
| 2901 | -edit (section 12), and the log records it with the admin's login. Turning | |
| 2902 | -the policy `off` deletes both refs and forgets how the branch stood; | |
| 2903 | -turning it on again starts from `unknown`. | |
| 2900 | +`green_from` that names a source the policy has no block for, a suite or | |
| 2901 | +reporters outside those bounds, and, with mode `report`, a `green_from` | |
| 2902 | +that is empty or `report` missing are 400 `invalid`, with a detail that | |
| 2903 | +says which: nothing is dropped without a word. With mode `off`, an empty | |
| 2904 | +`green_from` is accepted, as the hub gives it. A change counts toward the | |
| 2905 | +account's limits as an edit (section 12), and the log records it with the | |
| 2906 | +admin's login. Turning the policy `off` deletes both refs and forgets how | |
| 2907 | +the branch stood; turning it on again starts from `unknown`. A change of | |
| 2908 | +the suite or of the reporters clears red, as a reset does (the log records | |
| 2909 | +a `reset` whose `other` is `policy`), since the verdicts that set it no | |
| 2910 | +longer count; the branch turns red again only on verdicts under the new | |
| 2911 | +policy, and no `verify_fixed` notice goes out. | |
| 2904 | 2912 | |
| 2905 | 2913 | **Reporting.** `POST /v1/r/{owner}/{name}/verify/report` takes |
| 2906 | 2914 | `Idempotency-Key` (section 1) and a body of at most 4 KiB: |
| @@ -2945,7 +2953,9 @@ | ||
| 2945 | 2953 | |
| 2946 | 2954 | **How the hub decides.** After each verdict, reset and change of policy, |
| 2947 | 2955 | and whenever the branch moves, the hub looks at the changesets above green |
| 2948 | -along the head's first-parent chain: | |
| 2956 | +along the head's first-parent chain. With no green yet, it looks at the | |
| 2957 | +newest 10,000 changesets of the branch: a fail older than those is never | |
| 2958 | +seen, and `no_green` and the naming of a culprit work within them. | |
| 2949 | 2959 | |
| 2950 | 2960 | - A changeset's verdict is what its reporters said of the policy's suite: |
| 2951 | 2961 | a fail with no pass is a fail; a pass with no fail is a pass; reporters |
| @@ -3029,7 +3039,8 @@ | ||
| 3029 | 3039 | `null` for the hub, and for callers who are not the repository's admins. |
| 3030 | 3040 | |
| 3031 | 3041 | **Resets.** `POST /v1/r/{owner}/{name}/verify/reset` (`admin`, takes |
| 3032 | -`Idempotency-Key`): | |
| 3042 | +`Idempotency-Key`, a body of at most 4 KiB; 400 `invalid` while the | |
| 3043 | +policy is `off`, since there is nothing to reset): | |
| 3033 | 3044 | |
| 3034 | 3045 | ```json |
| 3035 | 3046 | {"green": "<id> | null", |
| @@ -3037,16 +3048,22 @@ | ||
| 3037 | 3048 | ``` |
| 3038 | 3049 | |
| 3039 | 3050 | With `green`, green moves to that changeset, backward too; it must be on |
| 3040 | -the first-parent chain of the head (400 `invalid` otherwise). Without it, | |
| 3041 | -the fails there are now are dismissed: they no longer count, and only a | |
| 3042 | -new one turns the branch red again. Either way red is cleared, and the log | |
| 3043 | -records a `reset` with the admin's login. With `expect`, the hub resets | |
| 3051 | +the first-parent chain of the head (400 `invalid` otherwise). The verdicts | |
| 3052 | +given before the reset on the changesets above it are forgotten, so that | |
| 3053 | +the reset holds: green moves on, and red comes back, only on verdicts | |
| 3054 | +given after it. Without `green`, the fails there are now are dismissed: | |
| 3055 | +they no longer count, and only a new one turns the branch red again. | |
| 3056 | +Either way red is cleared, and the log records a `reset` with the admin's | |
| 3057 | +login. With `expect`, the hub resets | |
| 3044 | 3058 | only while green and red are what it says, `null` for a ref that does not |
| 3045 | 3059 | exist (409 `moved` otherwise). It answers the status. |
| 3046 | 3060 | |
| 3047 | 3061 | **Notices.** `verify_red`, `verify_fixed` and `verify_stuck` tell the |
| 3048 | 3062 | repository's admins, and for a red branch with a culprit the account that |
| 3049 | -landed it, in their inbox (section 21). | |
| 3063 | +landed it, in their inbox (section 21). A repository sends at most one | |
| 3064 | +every 10 minutes: a change within them is told once they are over, as the | |
| 3065 | +branch then stands. When the hub names a culprit, or another one, while | |
| 3066 | +the branch stays red, `verify_red` tells the account that landed it. | |
| 3050 | 3067 | |
| 3051 | 3068 | **From CI.** A CI job reports with a token made for that alone, on the |
| 3052 | 3069 | tokens page (section 14): `read` and `verify:<branch glob>` on the |