Repository navigation
Commit 2de4743
## Summary
All four open issues in this repo were small, well-localized correctness
bugs, each fixed with a unit test:
- **#323** `format_fix_pr` unconditionally appended ` — {url}`, so an
empty `FixPr.url` rendered `#42 (merged) — `. Now branches on
`url.is_empty()`, matching `format_linked_issue`/`Bug::to_card`.
- **#326** `parse_jj_remote_list` returned everything after `origin `,
including jj's ` (push: <url>)` annotation, which flowed through as a
garbage repo id (`owner/repo.git (push: https:`) that passed validation.
Now splits on `" (push:"` and keeps the fetch URL.
- **#328** The client-side-filtered `bugs list` / `scans list` paths
paginated with the raw requested page, producing `Page: 5 of 1`. New
`output::clamp_page(page, total, limit) -> page.clamp(1,
total_pages(total, limit))` is applied before
`paginate_items`/`output_list` on both filtered paths, so the page
number and the items shown stay consistent.
- **#329** `strip_http_credentials` used `split_once('@')`; the
credentials/host separator is the *last* `@`, so
`https://user:p@ss@github.com/owner/repo.git` yielded host
`ss@github.com` and inference returned `None`. Switched to
`rsplit_once('@')`, matching `strip_ssh_port` in the same file.
Note: the local toolchain had to be updated to current stable (`chacha20
0.10.1` requires edition 2024) to build; `cargo fmt --check`, `cargo
clippy -- -D warnings`, `cargo test`, and `cargo xtask check` all pass.
`cargo clippy --all-targets` on current stable flags two preexisting
lints untouched by this PR (`src/commands/completions.rs:59` redundant
closure, trailing commas in `tests/integration.rs`); CI only runs `cargo
clippy` without `--all-targets`, so they don't gate this PR.
Closes #323, closes #326, closes #328, closes #329.
Link to Devin session:
https://app.devin.ai/sessions/fb903d8badf449c69bcb0e3b20a52a30
Requested by: @sachiniyer
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/usedetail/cli/pull/330"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open in Devin Review">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes four CLI correctness bugs in PR formatting, remote URL parsing,
pagination, and HTTPS credential handling to improve output accuracy and
repo inference. Adds unit tests for each fix.
- **Bug Fixes**
- Omit the em dash and URL when `FixPr.url` is empty in `format_fix_pr`
(#323).
- Strip jj’s `(push: <url>)` annotation in `parse_jj_remote_list` to
keep the fetch URL (#326).
- Clamp page numbers after client-side filtering in `bugs list` and
`scans list` to keep pages and items consistent (#328).
- Split HTTPS credentials on the last `@` so passwords with `@` parse
correctly (#329).
<sup>Written for commit 936f2b0.
Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/usedetail/cli/pull/330?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Sachin Iyer <siyer@detail.dev>
1 parent cc6e84c commit 2de4743
5 files changed
Lines changed: 93 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
502 | 508 | | |
503 | 509 | | |
504 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
505 | 522 | | |
506 | 523 | | |
507 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
578 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
197 | 205 | | |
198 | 206 | | |
199 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
200 | 230 | | |
201 | 231 | | |
202 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
97 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
| |||
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
208 | 228 | | |
209 | 229 | | |
210 | 230 | | |
| |||
330 | 350 | | |
331 | 351 | | |
332 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
333 | 362 | | |
334 | 363 | | |
335 | 364 | | |
| |||
0 commit comments