bridge.pipelines.policies.bt2gh.reconcile_bt_ontop_gh module#
Generic reconciliation policies for bio.tools-to-GitHub additive mappings.
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 values as additions on top of existing GitHub values.
- bridge.pipelines.policies.bt2gh.reconcile_bt_ontop_gh.reconcile_bt_ontop_gh(*, gh_norm, bt_norm, make_output, log_label)[source]#
Apply a generic bio.tools-on-top-of-GitHub policy for additive metadata.
This function is intended for multi-valued fields where bio.tools can contribute additional values without replacing existing GitHub ones (e.g. topics, labels, EDAM terms). Both GitHub and bio.tools values are provided as sets and the function computes the subset of bio.tools values that are missing from GitHub.
Policy: 1. If
bt_normisNoneor empty, bio.tools is treated as silent andno issue/pr is proposed. An “unchanged” log entry is emitted.
If
gh_normisNoneor empty, all values frombt_normare considered missing and an issue/pr is proposed with an “added” log entry.If both
gh_normandbt_normare non-empty: - If all values inbt_normare already present ingh_norm,no issue/pr is proposed and an “exact” log entry is emitted.
Otherwise, the set difference
missing = bt_norm - gh_normis passed tomake_outputand an “added” log entry is emitted.
- Parameters:
gh_norm (set[GHN] | None) – Normalized set of values currently present on GitHub, or
Noneif no values are recorded.bt_norm (set[BTN] | None) – Normalized set of values from bio.tools, or
Noneif bio.tools does not provide values for this field.make_output (Callable[[set[BTN]], OUTPUT]) – Callable that constructs an issue/pr payload from the set of missing bio.tools values.
log_label (str) – Short label used in log messages to identify the metadata field (e.g.,
"topics","edam terms").
- Returns:
Issue payload to propose according to the policy, or
Noneif no issue should be created.- Return type:
ISSUE | None