Repository navigation
feat(fetcher): add gitlab_* forge family + extend github_* shape coverage - #243
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThis PR introduces a shared ChangesForge-based rendering and GitHub migration
GitLab integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #243 +/- ##
==========================================
- Coverage 95.42% 95.17% -0.26%
==========================================
Files 211 222 +11
Lines 56895 58605 +1710
==========================================
+ Hits 54293 55777 +1484
- Misses 2602 2828 +226
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fetcher/forge_items.rs`:
- Around line 99-108: The render_markdown function interpolates user-controlled
ForgeRow fields (label and title) directly into a MarkdownTextBlock which can
break formatting or inject links (e.g., titles like "fix ](oops)" or markup like
"*_wip_*"); fix this by escaping markdown metacharacters before formatting:
add/implement a small helper (e.g., escape_markdown) that escapes characters
such as [, ], (, ), `, *, _, ~, and backslash, call it on r.label and r.title
inside render_markdown before building the formatted string, and continue to
return Body::MarkdownTextBlock(MarkdownTextBlockData { value }) with the escaped
values.
In `@src/fetcher/github/action_status.rs`:
- Line 16: The no-runs branch currently always returns Body::Badge despite
advertising Shape::Entries in SHAPES; update the fetch/compute logic in
action_status.rs to branch on ctx.shape (the request shape) and return
Body::Entries when ctx.shape == Shape::Entries (leave Badge/Text for their
shapes), ensuring both the early no-runs branch and the later runs-handling
branch (the other branch around lines referenced 87-107) honor ctx.shape so
shape consistency is preserved; reference SHAPES, ctx.shape, and the functions
compute/fetch (where the Body::Badge is returned) when making the change.
In `@src/fetcher/github/items.rs`:
- Around line 57-63: The function render_items currently bypasses the forge
dispatcher by calling forge_items::render_forge_rows(&rows, shape), which causes
Shape::Badge and Shape::ImageLinkedList to fall back incorrectly; replace that
direct call with the forge dispatch helper (e.g.,
forge_items::dispatch_render_rows(&rows, shape) or the actual dispatcher
function used elsewhere) so shapes are handled by the dedicated renderer and
avatars/badges resolve correctly; alternatively, if you prefer to restrict
capability, change render_items’ signature to accept only the sync-only shape
type (e.g., SyncShape) and update callers accordingly so unsupported async
shapes cannot be passed.
In `@src/fetcher/gitlab/my_mrs.rs`:
- Around line 52-54: Change the safety classification from Safe to Network in
the safety() implementation because the outbound host is configurable via the
host option on the struct; update the fn safety(&self) -> Safety in the impl for
MyMrs (or the type that defines the host field/option) to return Safety::Network
instead of Safety::Safe so the network gating applies to this config-controlled
destination.
In `@src/fetcher/gitlab/pipeline_status.rs`:
- Around line 103-105: The branch value is interpolated into the query without
encoding (opts.branch → branch → path.push_str), which can break the URL if it
contains reserved characters; percent-encode the branch before appending it to
path (e.g., compute an encoded_branch from opts.branch using a URL
percent-encoding helper such as url::form_urlencoded or percent_encoding) and
then call path.push_str(&format!("&ref={}", encoded_branch)) instead of using
the raw branch.
- Around line 62-64: The safety classification in the pipeline_status fetcher is
wrong: update the safety() method in pipeline_status.rs to return
Safety::Network instead of Safety::Safe because the host is configurable; modify
the safety(&self) -> Safety implementation to return Safety::Network (refer to
the Safety enum and the safety() function in this module) so the fetcher is
correctly marked as network-bound.
- Around line 108-113: The early-return for the “no runs” case currently always
builds Body::Badge (the block using pipelines.into_iter().next() and returning
payload(Body::Badge(...))); change it to branch on ctx.shape and return the
corresponding shape (e.g., Body::Text or Body::Entries) when there are no
pipelines instead of always Body::Badge so consumers retain the requested shape;
update the fetch/compute branch to check ctx.shape and construct the appropriate
empty/no-runs payload for Body::Text, Body::Entries, or Body::Badge and ensure
shapes() declares the supported shapes.
In `@src/fetcher/gitlab/repo_issues.rs`:
- Around line 61-63: The safety classification in the fetcher is incorrect:
update the safety() method on the struct (the function safety) to return
Safety::Network instead of Safety::Safe because the fetcher uses a
user-configurable host; change the return value in the safety() method from
Safety::Safe to Safety::Network so the host-configurable traffic is treated as
network-trust-gated.
In `@src/fetcher/gitlab/repo_mrs.rs`:
- Around line 62-64: The safety() method currently returns Safety::Safe but this
fetcher permits host overrides so it should be classified as network-accessing;
update the safety() implementation in the repo_mrs::safety (the safety method on
this fetcher struct) to return Safety::Network instead of Safety::Safe so the
Safety enum reflects config-driven network destinations.
In `@src/fetcher/gitlab/repo_stars.rs`:
- Around line 62-64: The safety() method currently returns Safety::Safe but this
fetcher allows a configurable host, so update the safety classification to
Safety::Network: locate the safety(&self) -> Safety implementation (which
currently returns Safety::Safe) and change it to return Safety::Network to
reflect that traffic destination can be controlled via configuration; keep the
rest of the implementation unchanged.
In `@src/fetcher/gitlab/review_requests.rs`:
- Around line 54-56: The safety classification in the fetcher method safety() is
incorrect: change the returned value from Safety::Safe to Safety::Network
because the request target (host) is derived from options (see host resolution
in the same module) and is config-controlled; update the safety() implementation
in the ReviewRequests fetcher (the safety() method) to return Safety::Network
and ensure any necessary imports or enum paths remain valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f1725519-3fc3-43a9-b9b9-ffaffd6c2544
📒 Files selected for processing (20)
src/fetcher/forge_items.rssrc/fetcher/github/action_status.rssrc/fetcher/github/assigned_issues.rssrc/fetcher/github/items.rssrc/fetcher/github/my_prs.rssrc/fetcher/github/repo_issues.rssrc/fetcher/github/repo_prs.rssrc/fetcher/github/repo_stars.rssrc/fetcher/github/review_requests.rssrc/fetcher/gitlab/client.rssrc/fetcher/gitlab/common.rssrc/fetcher/gitlab/items.rssrc/fetcher/gitlab/mod.rssrc/fetcher/gitlab/my_mrs.rssrc/fetcher/gitlab/pipeline_status.rssrc/fetcher/gitlab/repo_issues.rssrc/fetcher/gitlab/repo_mrs.rssrc/fetcher/gitlab/repo_stars.rssrc/fetcher/gitlab/review_requests.rssrc/fetcher/mod.rs
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
Use Safety::Network for a config-controlled host.
host is option-driven (Line 92), so outbound traffic destination is user-configurable and should be network-gated.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn safety(&self) -> Safety { | |
| Safety::Safe | |
| } | |
| fn safety(&self) -> Safety { | |
| Safety::Network | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/my_mrs.rs` around lines 52 - 54, Change the safety
classification from Safe to Network in the safety() implementation because the
outbound host is configurable via the host option on the struct; update the fn
safety(&self) -> Safety in the impl for MyMrs (or the type that defines the host
field/option) to return Safety::Network instead of Safety::Safe so the network
gating applies to this config-controlled destination.
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
This fetcher should be classified as Safety::Network.
Line 63 sets Safety::Safe, but host is configurable, so destination control is external.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines, "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn safety(&self) -> Safety { | |
| Safety::Safe | |
| } | |
| fn safety(&self) -> Safety { | |
| Safety::Network | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/pipeline_status.rs` around lines 62 - 64, The safety
classification in the pipeline_status fetcher is wrong: update the safety()
method in pipeline_status.rs to return Safety::Network instead of Safety::Safe
because the host is configurable; modify the safety(&self) -> Safety
implementation to return Safety::Network (refer to the Safety enum and the
safety() function in this module) so the fetcher is correctly marked as
network-bound.
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
Use Safety::Network for a host-configurable fetcher.
Line 62 marks this as Safety::Safe, but host is user-configurable, so traffic destination is externally controlled and should be trust-gated as network.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines, "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn safety(&self) -> Safety { | |
| Safety::Safe | |
| } | |
| fn safety(&self) -> Safety { | |
| Safety::Network | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/repo_issues.rs` around lines 61 - 63, The safety
classification in the fetcher is incorrect: update the safety() method on the
struct (the function safety) to return Safety::Network instead of Safety::Safe
because the fetcher uses a user-configurable host; change the return value in
the safety() method from Safety::Safe to Safety::Network so the
host-configurable traffic is treated as network-trust-gated.
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
safety() should be Network, not Safe.
Line 63 currently returns Safety::Safe, but this fetcher allows host override, so network destination is config-driven.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines, "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn safety(&self) -> Safety { | |
| Safety::Safe | |
| } | |
| fn safety(&self) -> Safety { | |
| Safety::Network | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/repo_mrs.rs` around lines 62 - 64, The safety() method
currently returns Safety::Safe but this fetcher permits host overrides so it
should be classified as network-accessing; update the safety() implementation in
the repo_mrs::safety (the safety method on this fetcher struct) to return
Safety::Network instead of Safety::Safe so the Safety enum reflects
config-driven network destinations.
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
Reclassify this fetcher as Safety::Network.
Line 63 returns Safety::Safe, but host can be configured, so the target endpoint is not fixed.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines, "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn safety(&self) -> Safety { | |
| Safety::Safe | |
| } | |
| fn safety(&self) -> Safety { | |
| Safety::Network | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/repo_stars.rs` around lines 62 - 64, The safety() method
currently returns Safety::Safe but this fetcher allows a configurable host, so
update the safety classification to Safety::Network: locate the safety(&self) ->
Safety implementation (which currently returns Safety::Safe) and change it to
return Safety::Network to reflect that traffic destination can be controlled via
configuration; keep the rest of the implementation unchanged.
| fn safety(&self) -> Safety { | ||
| Safety::Safe | ||
| } |
There was a problem hiding this comment.
Classify this fetcher as Safety::Network.
host is resolved from options (Line 93), so the traffic target is config-controlled and should not be marked Safe.
Suggested fix
fn safety(&self) -> Safety {
- Safety::Safe
+ Safety::Network
}As per coding guidelines "Safety classification (Safe vs. Network): Safe if URL/query is hardcoded in struct; Network if config can control where traffic goes".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/fetcher/gitlab/review_requests.rs` around lines 54 - 56, The safety
classification in the fetcher method safety() is incorrect: change the returned
value from Safety::Safe to Safety::Network because the request target (host) is
derived from options (see host resolution in the same module) and is
config-controlled; update the safety() implementation in the ReviewRequests
fetcher (the safety() method) to return Safety::Network and ensure any necessary
imports or enum paths remain valid.
Re: Safety classification on the six
|
Shared `ForgeRow` row struct and shape-driven dispatcher used by the github and gitlab forge families. Renders any of the eight list-shaped variants (Text / TextBlock / MarkdownTextBlock / LinkedTextBlock / ImageLinkedList / Entries / Bars / Timeline) plus a `render_count_badge` count-pill helper. Async `dispatch_rows_async` resolves `ImageLinkedList` thumbnails through the shared thumbnails cache; sync `dispatch_sample` skips that step for docs / catalog previews. No consumer in this commit; the github / gitlab families wire into it in follow-up commits. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sets up the shared substrate the six gitlab_* fetchers will plug into:
- `client.rs`: singleton `reqwest::Client`, `GITLAB_TOKEN` via `PRIVATE-TOKEN`
header, per-host cached `resolve_authenticated_username`, `rest_get` against
`https://{host}/api/v4{path}`. Mirrors `github/client.rs` shape; the GitLab
differences (PAT header, per-host username cache) are documented inline.
- `common.rs`: option parsing, RFC3339 timestamp, sha256 cache key, hostname
allowlist `validate_host`, `ProjectPath` with subgroup support
(`group/sub/proj`, requires >=2 segments), `resolve_project` from option or
git remote, `project_from_url` for the four common remote URL shapes.
- `items.rs`: GitLab MR / Issue DTOs (`GitlabIssueLike`, `GitlabReferences`,
`GitlabAuthor`) and `to_forge_row` / `sample_rows` adapters into the shared
forge_items pipeline.
- `mod.rs`: empty `fetchers()` vec; populated by per-fetcher follow-up
commits.
Registered in `fetcher::Registry::with_builtins` so the `for f in
gitlab::fetchers()` loop is in place before the first fetcher lands.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Open merge requests authored by the authenticated GitLab user across every
project. Uses `/api/v4/merge_requests?scope=created_by_me&state=opened`.
9 shapes via the shared forge_items dispatcher: LinkedTextBlock (default) /
TextBlock / MarkdownTextBlock / ImageLinkedList / Entries / Text / Bars /
Badge ("N open MRs") / Timeline. `host` option (default `gitlab.com`)
covers self-hosted instances; `limit` clamps 1..=30 (default 10).
Mirrors `github_my_prs`; differences are GitLab-specific (`reviewer_username`
filter, `references.full` slug, MR `!42` instead of PR `#42`).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Open MRs where the authenticated GitLab user is a reviewer. GitLab's MR search has no `@me` shortcut for the reviewer field, so the fetcher resolves the username via `/api/v4/user` (cached per host through `resolve_authenticated_username`) and then queries `/api/v4/merge_requests?reviewer_username=<me>&state=opened`. Same 9-shape coverage and `host` / `limit` option pair as `gitlab_my_mrs`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Open MRs against one specific GitLab project. Project resolves from the `project` option or (fallback) the git remote of cwd, gated on the configured `host` so a polyrepo cwd's GitHub remote doesn't get misrouted. Same 9-shape coverage as the user-scope siblings. Cache key mixes host + project path so two projects don't collide. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Open issues against one specific GitLab project. Same option set as `gitlab_repo_mrs` (host / project / limit), same 9-shape coverage. References use `#75` rather than `!42` so the row labels match GitLab's own UI convention. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Stargazer / fork / open-issue counts for one GitLab project. 6 shapes (Text headline, TextBlock, MarkdownTextBlock, Entries, Bars, Badge) — one fewer than the GitHub sibling because GitLab has no separate `watchers` concept, so that row is dropped rather than shipped as a zero. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Latest CI pipeline state for a GitLab project as a pass/fail Badge, short
Text line, or status / branch / sha / duration Entries rollup. Pulls from
`/api/v4/projects/{id}/pipelines?per_page=1[&ref=<branch>]`.
`classify(status)` maps GitLab's pipeline states (success / failed /
canceled / skipped / manual / running family / unknown) onto the Status
traffic-light tri-state used across the splashboard.
Two known limitations addressed in follow-up commits on this branch:
- `no runs` always returns Badge regardless of ctx.shape (fixed later).
- `branch` is interpolated raw into the query string (fixed later).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`IssueItem` gains two fields the wider shape coverage needs: - `comments: u64` → drives the `Bars` per-row activity weight. - `user: Option<GithubUserRef>` → carries `avatar_url` for `ImageLinkedList`. `render_items` now converts items into `forge_items::ForgeRow` via the new `to_forge_row` and delegates rendering to `forge_items::render_forge_rows`. The function signature stays unchanged so the existing per-fetcher call sites keep compiling; the per-fetcher files migrate to the richer `dispatch_rows_async` API in follow-up commits. `sample_rows` is a small fixture helper mirroring the gitlab/items.rs counterpart so docs / catalog samples format consistently across both forges. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces the local 4-element SHAPES const with the shared `LIST_SHAPES` (LinkedTextBlock / TextBlock / MarkdownTextBlock / ImageLinkedList / Entries / Text / Bars / Badge / Timeline). `fetch` routes through `forge_items::dispatch_rows_async` so `ImageLinkedList` resolves author avatars through the thumbnails cache and `Badge` produces the `"N open PRs"` count-pill. Entries key convention changes from "splashboard #54" to "#54" so the row label stays consistent across every shape variant. Repo-scope fetchers (which already used `#54`) are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…dispatch
Same migration as `github_my_prs`: SHAPES becomes `LIST_SHAPES`, fetch
goes through `dispatch_rows_async`, Badge noun pair is ("to review", "to
review") (verb-form, no plural drift).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…dispatch
Same migration as the sibling user-scope fetchers. Badge noun pair is
("open issue", "open issues").
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Same migration as the user-scope fetchers, but with `include_repo = false` so the row label stays the bare `#54` rather than the full `#54`. Badge noun pair is ("open PR", "open PRs"). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…atch Same migration as `github_repo_prs`. Pull-request filtering in the fetch path is unchanged; the conversion happens after the filter, so the rows the renderer sees are still pure issues. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds `TextBlock`, `MarkdownTextBlock`, `Bars`, and `Badge` on top of the existing `Text` and `Entries`. `Bars` ranks stars / forks / watchers / open_issues so the same fetched payload can fill a chart slot without a sibling fetcher. `Badge` is a calm "★ N" Info-tone pill suitable for a narrow status row. Renderer dispatch goes through a single `render_body(info, shape)` helper shared between `sample_body` and `fetch` so the two paths can't drift on new shapes. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds `Shape::Entries` to the SHAPES catalog with a status / branch / conclusion rollup. Pairs nicely with `grid_table` for an at-a-glance "why is CI flaky" view that the Badge / Text variants can't carry. Known limitation: the `no runs` branch always returns Badge regardless of `ctx.shape`. Follow-up commit on this branch reconciles that. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`render_items` is a public sync helper still called by `good_first_issues`, whose `shapes()` set is bounded to the four sync-renderable variants. Routing `Badge` or `ImageLinkedList` through it would silently degrade `Badge` to the `TextBlock` fallback (no count, no noun) and emit `ImageLinkedList` with every thumbnail column blank. Document the contract and `debug_assert` on both shapes so accidental misuse crashes loudly in tests instead of shipping broken bodies. Fetchers that accept those shapes already route through `forge_items::dispatch_rows_async`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…s path `github_action_status` advertises Badge / Text / Entries, but when the `workflow_runs` list came back empty the fetcher always returned a `Body::Badge` with `"no runs"`, regardless of `ctx.shape`. Consumers asking for Text or Entries got a shape mismatch and the runtime fell through to the placeholder. Extract a `no_runs_body(shape)` helper that mirrors the populated `render_body` shape selection so each advertised shape stays consistent across the "have runs" and "no runs" branches. Adds a unit test covering all three shapes. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…uns path Same shape-consistency fix as the github_action_status sibling: when the `pipelines` list comes back empty the fetcher used to always emit a `Body::Badge`, dropping the shape advertised in `ctx.shape`. Extract a `no_runs_body(shape)` helper so Text and Entries consumers keep the right variant. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Naive interpolation of `branch` into the `&ref=<branch>` query parameter broke the request semantics for any branch name carrying `&`, `=`, `#`, `+`, `?`, or a slash. The fetcher silently returned the wrong pipeline (or a parse error from GitLab) instead of failing fast. Route the value through `url::form_urlencoded::byte_serialize` so the encoded payload stays inside a single query pair. Adds a unit test pinning the encoding for the canonical reserved-character set so a future url-crate loosening surfaces here. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…arkdown `forge_items::render_markdown` interpolated user-controlled `label`, `title`, and `url` directly into Markdown source. A PR title like `fix ](oops)` would truncate the link target and trail the rest as plain text; `*_wip_*` would render as bold-italic instead of literal punctuation; and a URL carrying `)` would break the link target the same way. Add small `escape_markdown_inline` / `escape_markdown_url` helpers covering the documented set of CommonMark-significant inline glyphs and the two URL characters that can terminate a `(...)` link target. Adds unit coverage for both helpers and a regression test on the combined rendering path. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
37c595d to
b0aa0ca
Compare
Summary
Adds the
gitlab_*forge family so the per-dir killer feature works onGitLab repos the same way it does on GitHub, and brings the existing
github_*family up to the current shape-coverage convention (8 listshapes + count badge for list fetchers).
New fetchers (
Safety::Safe)gitlab_my_mrsgithub_my_prsgitlab_review_requestsgithub_review_requestsgitlab_repo_mrsgithub_repo_prsgitlab_repo_issuesgithub_repo_issuesgitlab_repo_starsgithub_repo_stars(nowatchersrow, GitLab has no equivalent)gitlab_pipeline_statusgithub_action_statusSelf-hosted GitLab via
hostoption; defaultgitlab.com. Host isvalidated (hostname-only allowlist) before any auth header leaves the
process, matching the
project_trust_modelrule.Auth:
GITLAB_TOKENenv var. PAT needsread_apiscope for user-scopequeries (
gitlab_my_mrs,gitlab_review_requests); public projectqueries (
gitlab_repo_*,gitlab_pipeline_status) are scope-tolerant.ProjectPathaccepts arbitrarily nested groups (group/sub/proj) andrequires at least two segments so a typo like
group/fails fastinstead of generating a 404 at the API.
Shared row model
src/fetcher/forge_items.rscarries theForgeRowrow struct and thenine-shape dispatcher used by both forge families. Adding a new shape
variant or label convention now lights up on github and gitlab
simultaneously.
Extended
github_*shape coveragegithub_my_prs,github_review_requests,github_assigned_issues,github_repo_prs,github_repo_issuesgithub_repo_starsgithub_action_statusNote: the
Entrieskey convention for list fetchers changes from"splashboard #54"to"unhappychoice/splashboard#54"to keep the row label consistent across every shape. Repo-scope fetchers (github_repo_prs/issues) already used#54and stay unchanged.Test plan
cargo test --lib: 2707 pass / 0 fail / 17 ignoredcargo clippy --all-targets -- -D warnings: cleancargo fmt --all -- --check: cleangitlab-org/gitlabproject:
gitlab_repo_mrs(Timeline),gitlab_repo_issues(Bars),gitlab_repo_stars(Entries / Bars / Badge),gitlab_pipeline_status(Badge / Entries) all render the expectedshapes. User-scope
gitlab_my_mrs/gitlab_review_requestsconfirmedto surface
403 insufficient_granular_scopefor a PAT withoutread_api, demonstrating the placeholder path.unhappychoice/splashboard:Bars / Badge / ImageLinkedList / MarkdownTextBlock all paint.
Catalog ticks
Ticks the six checkboxes under
gitlab_*in #63 once this lands. Alsocontributes the broader shape coverage hinted at in #41's "shapes are
the only coupling" rule by making the two forge families produce
structurally identical output for every shape.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor