bridge.pipelines.policies.bt2gh.reconcile_bt_over_gh module#
Generic reconciliation policies for bio.tools to GitHub mapping.
This module provides a generic function to determine whether a GitHub issue or pull request should be proposed based on bio.tools metadata, according to a policy that treats bio.tools as authoritative while preserving existing GitHub values when bio.tools is silent.
- async bridge.pipelines.policies.bt2gh.reconcile_bt_over_gh.reconcile_bt_over_gh(*, gh_norm, bt_norm, make_output, log_label, equality_fn=None)[source]#
Apply a generic bio.tools-over-GitHub policy to decide whether to propose a GitHub issue or pull request based on bio.tools metadata.
This function operates on normalized representations of GitHub and bio.tools values (
gh_normandbt_norm) and returns an issue/pr payload constructed from the bio.tools value when applicable.Policy: 1. If
bt_normisNone, bio.tools is treated as silent and noissue/pr is proposed. An “unchanged” log entry is emitted.
If
gh_normis notNoneand equalsbt_norm, the values are considered aligned and no issue/pr is proposed. An “exact” log entry is emitted.If
gh_normis notNoneand differs frombt_norm, GitHub is treated as conflicting with bio.tools. A conflict log entry is emitted and an issue/pr proposing the bio.tools value is constructed viamake_output(bt_norm).If
gh_normisNoneandbt_normis notNone, GitHub is missing the value and an issue/pr proposing the bio.tools value is constructed viamake_output(bt_norm)with an added log entry.
- Parameters:
gh_norm (GHN | None) – Normalized representation of the GitHub value, or
Noneif no usable value is available from GitHub.bt_norm (BTN | None) – Normalized representation of the bio.tools value, or
Noneif no value is recorded in bio.tools.make_output (Callable[[BTN], Awaitable[OUTPUT] | OUTPUT]) – Callable that constructs an issue/pr payload from the normalized bio.tools value. The callable may be asynchronous.
log_label (str) – Short label used in log messages to identify the metadata field (e.g.,
"description","homepage","license").equality_fn (Callable[[GHN, BTN], bool] | None, optional) – Optional equality function to compare normalized GitHub and bio.tools values. If
None, the default equality operator (==) is used.
- Returns:
Issue/pr payload to propose according to the policy, or
Noneif no issue should be created.- Return type:
OUTPUT | None