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
@@ -125,7 +125,7 @@ async fn one_pass_polls_reasons_and_posts() {
|
||||
Arc::new(SystemClock),
|
||||
Arc::new(store),
|
||||
);
|
||||
let key = ResourceKey::from("github:acme/widgets#7");
|
||||
let key = ResourceKey::from("github:issue:acme/widgets#7");
|
||||
let status = dispatcher.status(&key).expect("status reads");
|
||||
assert_eq!(status.state, KeyState::Idle);
|
||||
assert_eq!(status.inbox_depth, 0);
|
||||
|
||||
Reference in new issue
Block a user