feature: allow for agnostic git backends#187
Conversation
|
Hey! I asked Gemini to review this PR and it seems to be very concerned :) It makes me too. Db safety is top priority. Please, take a look. Overall stability > velocity at this point, Sashiko is actively used by the kernel community and just keep it afloat is p0. 🚨 Critical Regression Risks
1 let ingestor_handle = if !settings.forge.enabled {
1 if !matched && mapping.is_empty() { |
|
Hey!
Interesting that the Would you mind following up on #128? It would allow me to test this with a bit more certainty 😅 Otherwise I can just implement the proposed fixes and re-run the reviews.
Is this actually critical? I would imagine a user spinning up a sashiko instance to track a github repository isn't particularly interested in also tracking NNTP. If it is to be desired though, it is an easy enough fix.
At first, this was intended behavior to prevent any collisions from happening with custom subsystem mappings. I realize now that it needs to be reworked a bit. Thanks for the review! v2 coming soon :-) |
Add slug, mr_url, mr_title, and mr_number columns to the patchsets table to support forge-based (GitHub/GitLab) merge request tracking. Extend PatchsetRow, all SELECT queries, and create_fetching_patchset with the new fields. Add get_patchset_details_by_slug and get_patchset_summary_by_slug lookup methods. Add mr_url, mr_title, and mr_number fields to Event::PatchSubmitted and ParsedArticle. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
Add configuration structs for multi-forge integration and subsystem mapping. Add ProjectSettings, ForgeSettings, and SubsystemsSettings types with defaults. Add [project], [forge], and [subsystems] sections to Settings.toml. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
Add ForgeProvider trait with GitHubForge and GitLabForge implementations for webhook handling. Add ForgeRegistry for provider lookup. Add extract_repo_name_from_url and extract_repo_name_from_mr_url utility functions. Add bytes dependency for webhook body parsing. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
Extend AppState with Settings and ForgeRegistry. Change run_server
to accept Arc<Settings> instead of ServerSettings. Add GET /api/config
endpoint returning project metadata. Add POST /api/webhook/{provider}
for forge-agnostic webhook handling via ForgeRegistry trait dispatch.
Add slug-based patchset lookup in GET /api/patch handler. Add MR
metadata fields to FetchRequest for forge-sourced patches.
Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
Add gitlab_token and mr_metadata fields to FetchAgent. Thread mr_url, mr_title, mr_number through extract_patch into Event::PatchSubmitted. Add commit range splitting for base..head ranges from forge webhooks. Inject GitLab auth tokens via oauth2 URL format in ensure_remote. Add safe.bareRepository=all to all git subprocess calls for bare repo compatibility. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
Add conditional ingestor startup (disabled when forge is enabled). Thread mr_url, mr_title, mr_number through Event::PatchSubmitted into ParsedArticle and process_parsed_article. Add configurable subsystem mapping via regex patterns. Add identify_subsystems_from_paths for file-path-based subsystem detection. Use MR title as patchset subject for forge-sourced patches. Move email policy loading outside the DB worker loop. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
0bfe206 to
96d7854
Compare
Add setup guides for GitHub and GitLab forge integration. Add webhook testing and configuration validation scripts. Update README with forge integration features and configuration sections. Update service skeleton routing and landing page for webhook endpoints. Signed-off-by: derekbarbosa <derekasobrab@gmail.com>
96d7854 to
3376367
Compare
|
V1->V2:
|
Multi-Forge Integration via ForgeProvider Trait
Patches are currently ingested exclusively via NNTP (mailing list).
This patch adds a ForgeProvider trait that abstracts webhook-based
ingestion from code forges, with built-in implementations for GitHub and
GitLab:
The forge layer is entirely opt-in. When [forge] enabled = false (default),
no webhook routes are registered and the NNTP pipeline is unchanged.