forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits
| 1 | //! Live pull requests. The pull list (`/{o}/{r}/pulls`) follows [`Topic::PullList`]; a pull page |
| 2 | //! and its tabs (conversation, commits, files) follow [`Topic::Pull`]. The pages render `data-live` |
| 3 | //! with the URL of their stream, and a `changed` event re-renders them in place (see `nav.js`). |
| 4 | //! |
| 5 | //! Every write reaches a topic through one of these paths: |
| 6 | //! - A POST under `/{o}/{r}/pulls/...` (comment, review, label, merge, draft, branch, ...): the |
| 7 | //! [`PullWriteLayer`] bumps after the handler ran, so no route calls a bump itself. |
| 8 | //! - A commit status (CI or the status API): [`crate::live::bump_head`], from `automerge::on_status`. |
| 9 | //! - A push, a mergeability refresh or an auto-merge: [`crate::live::bump_repo_pulls`], from the |
| 10 | //! call site. |
| 11 | //! |
| 12 | //! The bump helpers in [`crate::live`] are the one place each topic is bumped from. A new write |
| 13 | //! path calls one of them; it does not bump a topic directly. |
| 14 | //! |
| 15 | //! What a stream compares is a fingerprint of what the page shows ([`pull_fingerprint`], |
| 16 | //! [`list_fingerprint`]). A bump that changes none of it sends nothing, so over-bumping is cheap. |
| 17 | |
| 18 | use PullRequest; |
| 19 | use ReactionTarget; |
| 20 | use Store; |
| 21 | use Result; |
| 22 | use ; |
| 23 | use Response; |
| 24 | use ; |
| 25 | |
| 26 | use crate; |
| 27 | use crateparse_number; |
| 28 | use crateload_repo; |
| 29 | use crateAppState; |
| 30 | |
| 31 | path_param!; |
| 32 | path_param!; |
| 33 | path_param!; |
| 34 | |
| 35 | // Fingerprints. Each reads what the page shows; any change to it changes the string. |
| 36 | |
| 37 | /// What one pull request page shows, as one string. `viewer` is the reader: a pending review is |
| 38 | /// the viewer's own and shows only to them. |
| 39 | pub async |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | /// What the pull request list shows: the fingerprint of every pull of the repo, in number order. |
| 124 | pub async |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | /// The fingerprint of one pull request by number. `gone` once it no longer exists. |
| 140 | async |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | // Streams |
| 153 | |
| 154 | /// The stream URL of one pull request, for its page and its edit history. |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | /// The pull list's change stream. Auth is the repo read check of the list page. |
| 160 | |
| 161 | async |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | /// One pull request's change stream. Auth is the page's: the repo read check, then the pull. |
| 178 | |
| 179 | async |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 |