bridge.pipelines.bt2gh_for_pr_issues.map_funcs.homepage module#
Map homepage URL from bio.tools to a GitHub.
This module compares the homepage URL recorded in bio.tools with the homepage (and HTML URL) of a GitHub repository and, when appropriate, proposes a GitHub issue suggesting that the bio.tools homepage be added to the repository settings. It applies a bio.tools-over-GitHub policy.
- async bridge.pipelines.bt2gh_for_pr_issues.map_funcs.homepage.map_homepage(gh_schema, bt_homepage)[source]#
Propose a GitHub issue to add a homepage based on bio.tools metadata, using the generic bio.tools-over-GitHub issue policy.
All URLs (GitHub homepage, GitHub HTML URL, and bio.tools homepage) are compared in canonicalized form to avoid spurious differences due to trailing slashes, case, or query parameter ordering. If the bio.tools homepage is equal to the repository HTML URL, no suggestion is made. If GitHub already has a different homepage configured, that value is treated as authoritative and a conflict is logged while still proposing an issue. When the bio.tools homepage is present, differs from the HTML URL, and the GitHub homepage is unset does this function propose an issue.
- Parameters:
gh_schema (dict[AnyUrl | str | None]) – A dictionary containing existing GitHub repository data. Expected keys: - “homepage”: the configured GitHub homepage URL, or None/empty if unset. - “html_url”: the canonical GitHub repository URL.
bt_homepage (UrlftpType | None) – The homepage URL defined in the bio.tools metadata, or None if no homepage is provided.
- Returns:
A mapping with the issue title as key and the issue body as value, or
Noneif no issue is to be created.- Return type:
dict[str, str] | None