corvix.hydration.providers.github_web_url

Hydration provider for deriving browser URLs from GitHub notification subjects.

Attributes

Classes

GitHubWebUrlProvider

Hydrates notification.web_url with direct and API-based mappings.

_ParsedCheckSuiteTitle

Functions

_parse_github_api_path(...)

_is_str_object_map(→ TypeIs[dict[str, object]])

_parse_check_suite_title(→ _ParsedCheckSuiteTitle | None)

_build_actions_branch_url(→ str)

_build_actions_api_base(→ str)

_match_check_suite_run(→ dict[str, object] | None)

_parse_github_timestamp(→ datetime.datetime | None)

map_subject_api_url_to_web(→ str | None)

Map a subject API URL to its browser URL when possible.

Module Contents

corvix.hydration.providers.github_web_url._MIN_API_REPO_SEGMENTS = 4[source][source]
corvix.hydration.providers.github_web_url._MIN_RESOURCE_SEGMENTS = 2[source][source]
corvix.hydration.providers.github_web_url._RELEASE_TAG_SEGMENTS = 3[source][source]
corvix.hydration.providers.github_web_url._ACTIONS_RUNS_SEGMENTS = 3[source][source]
corvix.hydration.providers.github_web_url._API_RESOURCE_TO_WEB_PATH[source][source]
corvix.hydration.providers.github_web_url._CHECK_SUITE_TITLE_RE[source][source]
corvix.hydration.providers.github_web_url._parse_github_api_path(subject_url: str) tuple[urllib.parse.ParseResult, list[str], int][source][source]
corvix.hydration.providers.github_web_url._is_str_object_map(value: object) TypeIs[dict[str, object]][source][source]
class corvix.hydration.providers.github_web_url.GitHubWebUrlProvider[source][source]

Hydrates notification.web_url with direct and API-based mappings.

timeout_seconds: float = 10.0[source][source]
name: str = 'github.web_url'[source][source]
hydrate(notification: corvix.domain.Notification, client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.hydration.base.HydrationContext) corvix.domain.Notification[source][source]
_resolve_check_suite(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.hydration.base.HydrationContext, notification: corvix.domain.Notification, repo_base: str) str | None[source][source]
_resolve_check_suite_from_subject_url(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.hydration.base.HydrationContext, subject_url: str, repository: str) str | None[source][source]
_resolve_release(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.hydration.base.HydrationContext, subject_url: str) str | None[source][source]
class corvix.hydration.providers.github_web_url._ParsedCheckSuiteTitle[source][source]
workflow: str[source][source]
branch: str[source][source]
attempt: int | None[source][source]
corvix.hydration.providers.github_web_url._parse_check_suite_title(title: str) _ParsedCheckSuiteTitle | None[source][source]
corvix.hydration.providers.github_web_url._build_actions_branch_url(repo_base: str, branch: str) str[source][source]
corvix.hydration.providers.github_web_url._build_actions_api_base(repo_base: str) str[source][source]
corvix.hydration.providers.github_web_url._match_check_suite_run(workflow_runs: list[object], workflow_name: str, run_attempt: int | None, target_timestamp: datetime.datetime) dict[str, object] | None[source][source]
corvix.hydration.providers.github_web_url._parse_github_timestamp(raw: str) datetime.datetime | None[source][source]
corvix.hydration.providers.github_web_url.map_subject_api_url_to_web(subject_url: str, repo_name: str, repo_base: str) str | None[source][source]

Map a subject API URL to its browser URL when possible.