corvix.pipeline.providers.github_web_url ======================================== .. py:module:: corvix.pipeline.providers.github_web_url .. autoapi-nested-parse:: Hydration provider for deriving browser URLs from GitHub notification subjects. Attributes ---------- .. autoapisummary:: corvix.pipeline.providers.github_web_url._MIN_API_REPO_SEGMENTS corvix.pipeline.providers.github_web_url._MIN_RESOURCE_SEGMENTS corvix.pipeline.providers.github_web_url._RELEASE_TAG_SEGMENTS corvix.pipeline.providers.github_web_url._ACTIONS_RUNS_SEGMENTS corvix.pipeline.providers.github_web_url._API_RESOURCE_TO_WEB_PATH corvix.pipeline.providers.github_web_url._CHECK_SUITE_TITLE_RE Classes ------- .. autoapisummary:: corvix.pipeline.providers.github_web_url.GitHubWebUrlProvider corvix.pipeline.providers.github_web_url._ParsedCheckSuiteTitle Functions --------- .. autoapisummary:: corvix.pipeline.providers.github_web_url._parse_github_api_path corvix.pipeline.providers.github_web_url._is_str_object_map corvix.pipeline.providers.github_web_url._parse_check_suite_title corvix.pipeline.providers.github_web_url._build_actions_branch_url corvix.pipeline.providers.github_web_url._build_actions_api_base corvix.pipeline.providers.github_web_url._match_workflow_run_url corvix.pipeline.providers.github_web_url._run_matches_check_suite corvix.pipeline.providers.github_web_url._run_distance_seconds corvix.pipeline.providers.github_web_url._match_check_suite_run corvix.pipeline.providers.github_web_url._parse_github_timestamp corvix.pipeline.providers.github_web_url.map_subject_api_url_to_web Module Contents --------------- .. py:data:: _MIN_API_REPO_SEGMENTS :value: 4 .. py:data:: _MIN_RESOURCE_SEGMENTS :value: 2 .. py:data:: _RELEASE_TAG_SEGMENTS :value: 3 .. py:data:: _ACTIONS_RUNS_SEGMENTS :value: 3 .. py:data:: _API_RESOURCE_TO_WEB_PATH .. py:data:: _CHECK_SUITE_TITLE_RE .. py:function:: _parse_github_api_path(subject_url: str) -> tuple[urllib.parse.ParseResult, list[str], int] .. py:function:: _is_str_object_map(value: object) -> TypeIs[dict[str, object]] .. py:class:: GitHubWebUrlProvider Hydrates notification.web_url with direct and API-based mappings. .. py:attribute:: timeout_seconds :type: float :value: 10.0 .. py:attribute:: name :type: str :value: 'github.web_url' .. py:method:: hydrate(notification: corvix.domain.Notification, client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.pipeline.provider.PipelineContext) -> corvix.domain.Notification .. py:method:: _resolve_check_suite(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.pipeline.provider.PipelineContext, notification: corvix.domain.Notification, repo_base: str) -> str | None .. py:method:: _resolve_check_suite_from_title(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.pipeline.provider.PipelineContext, notification: corvix.domain.Notification, repo_base: str) -> str | None .. py:method:: _resolve_check_suite_from_subject_url(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.pipeline.provider.PipelineContext, subject_url: str, repository: str) -> str | None .. py:method:: _resolve_release(client: corvix.pipeline.base.JsonFetchClient, ctx: corvix.pipeline.provider.PipelineContext, subject_url: str) -> str | None .. py:class:: _ParsedCheckSuiteTitle .. py:attribute:: workflow :type: str .. py:attribute:: branch :type: str .. py:attribute:: attempt :type: int | None .. py:function:: _parse_check_suite_title(title: str) -> _ParsedCheckSuiteTitle | None .. py:function:: _build_actions_branch_url(repo_base: str, branch: str) -> str .. py:function:: _build_actions_api_base(repo_base: str) -> str .. py:function:: _match_workflow_run_url(payload: object, parsed_title: _ParsedCheckSuiteTitle, target_timestamp: datetime.datetime) -> str | None .. py:function:: _run_matches_check_suite(run: dict[str, object], normalized_name: str, run_attempt: int | None) -> bool .. py:function:: _run_distance_seconds(run: dict[str, object], target_timestamp: datetime.datetime) -> float .. py:function:: _match_check_suite_run(workflow_runs: collections.abc.Sequence[object], workflow_name: str, run_attempt: int | None, target_timestamp: datetime.datetime) -> dict[str, object] | None .. py:function:: _parse_github_timestamp(raw: str) -> datetime.datetime | None .. py:function:: map_subject_api_url_to_web(subject_url: str, repo_name: str, repo_base: str) -> str | None Map a subject API URL to its browser URL when possible.