Metadata
Origin
Review of PR #264
What to build
src/docverse/services/dashboard_templates/push_processor.py has two near-identical helpers that each parse owner/repo strings:
_split_full_name(full_name) -> str | None returns the owner.
_repo_from_full_name(full_name) -> str | None returns the repo.
They are called once each, on adjacent lines in process (lines 80 and 82-83). Reviewer noted the current form is readable; collapsing to one helper that returns (owner, repo) | None is a small win and avoids the parallel definitions drifting.
Approach sketch
- Replace the two helpers with
_split_full_name_tuple(full_name: object) -> tuple[str, str] | None.
- Update the two call sites in
process to unpack the tuple (or fall back to a (None, None) pattern that preserves existing semantics).
After #268 lands (this issue is Blocked by #268), the call sites at lines 80, 82-83 will have shifted slightly due to the payload.get(..., {}) cleanups — pick up the latest line numbers from the current branch state.
Acceptance criteria
Metadata
tickets/DM-54689-github-webhookOrigin
Review of PR #264
What to build
src/docverse/services/dashboard_templates/push_processor.pyhas two near-identical helpers that each parseowner/repostrings:_split_full_name(full_name) -> str | Nonereturns the owner._repo_from_full_name(full_name) -> str | Nonereturns the repo.They are called once each, on adjacent lines in
process(lines 80 and 82-83). Reviewer noted the current form is readable; collapsing to one helper that returns(owner, repo) | Noneis a small win and avoids the parallel definitions drifting.Approach sketch
_split_full_name_tuple(full_name: object) -> tuple[str, str] | None.processto unpack the tuple (or fall back to a(None, None)pattern that preserves existing semantics).After #268 lands (this issue is
Blocked by #268), the call sites at lines 80, 82-83 will have shifted slightly due to thepayload.get(..., {})cleanups — pick up the latest line numbers from the current branch state.Acceptance criteria
tuple[str, str] | None.processupdated.push_processortests pass.