Metadata
Origin
Review of PR #264
What to build
src/docverse/factory.py repeats the same three-way is None check on _github_app_id, _github_app_private_key, and _github_webhook_secret in two methods:
create_github_app_client (lines ~300-306).
get_github_webhook_secret (lines ~420-441).
Both raise GitHubAppNotConfiguredError with the same message. Extract a private helper so the two sites cannot drift.
Approach sketch
Add _require_github_app_config(self) -> tuple[int, SecretStr, SecretStr] (or a small named tuple / dataclass) that performs the all-or-nothing check and returns the three values typed as non-None. Both call sites delegate. Helper raises GitHubAppNotConfiguredError with the existing message.
Acceptance criteria
Metadata
tickets/DM-54689-github-webhookOrigin
Review of PR #264
What to build
src/docverse/factory.pyrepeats the same three-wayis Nonecheck on_github_app_id,_github_app_private_key, and_github_webhook_secretin two methods:create_github_app_client(lines ~300-306).get_github_webhook_secret(lines ~420-441).Both raise
GitHubAppNotConfiguredErrorwith the same message. Extract a private helper so the two sites cannot drift.Approach sketch
Add
_require_github_app_config(self) -> tuple[int, SecretStr, SecretStr](or a small named tuple / dataclass) that performs the all-or-nothing check and returns the three values typed as non-None. Both call sites delegate. Helper raisesGitHubAppNotConfiguredErrorwith the existing message.Acceptance criteria
Nonecheck and returns the resolved values.create_github_app_clientandget_github_webhook_secretcall the helper.if ... is None or ... is None or ... is Noneblocks remain infactory.py.uv run --only-group=nox nox -s typingclean.