forked from vhaudiquet/rhema-claw
fix(forge,claw): forge keys separate the issue from the pull
The watch key encoded source, repo, and number but not the thread
kind, and on GitLab an issue and a merge request share one number
space: iid 7 twice produced one key, one snapshot, and comments on
the merge request landing in the issue (or a 404 fallback that
misrouted the other way). The key carries the kind now —
{source}:{kind}:{owner}/{name}#{number}, with GitLab spelling the
pull variant mr — comment and snapshot route outright by kind, and a
kind-less payload parses to the unparsable key instead of guessing
issue. The claw's callers thread the kind from the payload and strip
the segment where the bare repo is wanted; pre-kind stored keys parse
as None rather than misroute. Four route-pinning wiremock tests cover
the GitLab split, and the GitHub/Gitea clients take the kind without
using it (their issues and PRs share the same REST space).
This commit is contained in:
1 parent
10efe85f38
commit
00adf092ff
15 files changed
+478
-178
No files matched your search
@@ -137,7 +137,7 @@ async fn the_second_dispatch_resumes_the_first_conversation() {
|
||||
let dir = tempfile::tempdir().expect("tempdir");
|
||||
let config = config(&dir);
|
||||
seed_watch(&dir, &server.uri());
|
||||
let key = ResourceKey::from("github:acme/widgets#7");
|
||||
let key = ResourceKey::from("github:issue:acme/widgets#7");
|
||||
|
||||
// Pass one: the opened event alone. The cron shape — a fresh process,
|
||||
// a fresh watcher, the same db.
|
||||
|
||||
Reference in new issue
Block a user