Skip to content

DM-54689: Collapse _split_full_name / _repo_from_full_name into one tuple-returning helper #270

@jonathansick

Description

@jonathansick

Metadata

Field Value
Parent PRD #232
Jira Key DM-54689
Jira URL https://rubinobs.atlassian.net/browse/DM-54689
Task Order 25
Type AFK
Blocked by #268
Parallel with #271
Branch tickets/DM-54689-github-webhook

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

  • Two helpers replaced by one returning tuple[str, str] | None.
  • Both call sites in process updated.
  • Existing push_processor tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    prd-taskImplementation task from a PRD

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions