Remote configuration improvements - #416
Open
helq wants to merge 7 commits into
Open
Conversation
Member
🤖 AI Code Review (Sashiko / Jetski)Here is a review of PR #416 ( 📋 SummaryThe PR introduces map-format deserialization for 🚨 1. Critical Regression Risks1.1 Complete Removal of
|
Add a submitted_at field to Event::RawMboxSubmitted, stamped with the server's current time when a raw mbox is submitted via POST /api/submit (Inject variant). This timestamp is propagated through metadata.received_date and used as the patchset date instead of the email's Date: header. This prevents stale mbox timestamps (which can be arbitrarily far in the past) from skewing queue ordering. The original email date is preserved in the messages table for display purposes. The Thread and Remote submission paths are unaffected as they already use server-side timestamps via create_fetching_patchset(). Signed-off-by: Elkin Cruz <elkin@google.com>
Define PriorityRule and CompiledPriorityRule structs for regex-based patchset priority classification. Add a custom serde deserializer (deserialize_indexed_vec) to handle both TOML array and env-var indexed-map representations. Add the priority_rules field to ReviewSettings with serde(default) so existing configs are unaffected. Signed-off-by: Elkin Cruz <elkin@google.com>
Add a priority INTEGER DEFAULT 500 column to the patchsets table and a composite index idx_patchsets_status_priority_date on (status, priority DESC, date ASC) for efficient priority-ordered queries. The column defaults to 500 so existing patchsets are unaffected. Signed-off-by: Elkin Cruz <elkin@google.com>
Add migration to create the priority column and composite index. Introduce create_patchset_with_priority() which threads an explicit priority through all INSERT/UPDATE paths, with MIN(priority, ?) semantics to preserve manual deprioritization. Refactor create_patchset() to delegate with default None. Change get_pending_patchsets() ordering to priority DESC, date ASC. Add calculate_priority() for evaluating compiled regex rules against subjects (last match wins). Signed-off-by: Elkin Cruz <elkin@google.com>
Compile priority_rules from settings at startup and thread them through the DB worker into process_parsed_article(). Use calculate_priority() to compute priority from the patchset subject before calling create_patchset_with_priority(). API callers pass None for priority to create_fetching_patchset(). Signed-off-by: Elkin Cruz <elkin@google.com>
The config crate deserializes custom_remotes environment variables SASHIKO__GIT__CUSTOM_REMOTES__* as a map with numeric string keys instead of a sequence. This caused a deserialization failure when attempting to parse into a Vec structure. Replace the untagged enum deserialization strategy with a custom Visitor pattern in settings.rs. This Visitor successfully handles both sequential TOML/JSON arrays and indexed map formats, preserving type coercion for nested fields. Signed-off-by: Elkin Cruz <elkin@google.com>
When a custom remote has thousands of branches (e.g. icebreaker with 4,467 branches), fetching all refs downloads millions of objects and saturates the pod for hours. Add a branch_patterns field to CustomRemoteSettings that accepts glob patterns (e.g. "*/6.18", "14*"). When configured: 1. ensure_remote builds refspecs from patterns so git fetch only downloads matching refs instead of all branches 2. check_all_branches filters the branch list through the same patterns before adding baseline candidates Implement a simple glob matcher supporting "*" (any substring) and "?" (any single character) in git_ops, avoiding an external dependency for this small use case. Signed-off-by: Elkin Cruz <elkin@google.com>
helq
force-pushed
the
upstream/remote-config
branch
from
August 21, 2026 18:38
82864af to
0906d97
Compare
Collaborator
Author
|
After a couple of rounds of AI reviews and subsequent fixes, I present to you the new code. It has been hardened and tested in production. Thanks for the review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On top of #415
Commits 7f947df and 82864af.
Two highly correlated changes:
Support map-format deserialization: allow custom_remotes in Settings.toml to be specified as either a TOML array ([[...]]) or as indexed environment variables (CUSTOM_REMOTES__0__URL), matching the pattern used by the config crate.
Add branch_patterns for selective fetching: when a custom remote has thousands of branches, fetching all refs downloads millions of objects and saturates the pod for 30 minutes. branch_patterns accepts glob patterns (e.g., /6.18, 14) so git fetch only downloads matching refs. The same patterns filter baseline branch candidates.