notifications: regression/ recipients with scope

オープン
#2,114 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@felipebergamin がすでに取り組んでいます。

2026年10月22日 から。

  • #8 @felipebergamin による — マージされずにクローズ
  • #2193 @felipebergamin による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

まず、backend/data/notifications/subscriptions/ 配下にある既存のサブスクリプションファイルと、typeModels で使用されている Pydantic モデルを調査します。次に、backend/data/notifications/metrics/ を追加して docs/notifications.md を更新する前に、現在のパーサーと CI 検証テストを追跡します。完了の条件は、既存のすべてのファイルを読み込めること、無効なファイルによってファイルおよびフィールドのエラーとともに CI が失敗すること、そして受信者の同値性がテストされていることです。

索引モデルが issue の本文から書いたものです。

説明

notifications

Problem

[REGRESSION] Cc is the default_recipients of the tree file whose url matches the issue (_get_default_tree_recipients in helpers/common.py). Branch and architecture are ignored. The same list is also Cc on the daily [STATUS] summary.

Change

[REGRESSION] Cc moves to backend/data/notifications/regression/. default_recipients stays in subscriptions/ and stays the [STATUS] Cc. Do not remove or empty it. Automatic sending stays maestro build issues. Regzbot Cc, REGZBOT_TREES, and KERNELCI_REPLYTO stay in helpers/common.py.

The first commit copies recipients once: for every subscriptions/*.yaml that is not *_hardware.yaml, including files with no reports key, write regression/<tree>.yaml with one entry whose recipients are that file's default_recipients, copied unchanged (display name included). Skip files with an empty list. This is committed data. Do not add a command or any runtime read of subscriptions/ to fill regression/. After the commit, regression/ is edited by hand.

# regression/default.yaml
# Replaces KERNELCI_RESULTS on the regression path only. The [STATUS] cron
# keeps --add-mailing-lists and the constants in common.py.
to: [email protected]
# regression/stable.yaml — top-level key must be a tree key in subscriptions/
stable:
  - recipients: [[email protected]]          # no scope keys: every build issue on this tree's URL
  - branch: [linux-6.12.y, linux-6.6.y]
    architecture: [arm64]
    recipients: [[email protected]]
Key Values Matched against
recipients RFC 5322 strings, ≥1, stored and sent unchanged —
issues build only issue kind
branch str or list git_repository_branch already returned by kcidb_issue_details (first incident, the branch printed in the mail)
architecture, config_name, compiler str or list any row already returned by kcidb_build_incidents

No new query. An entry matches when every key it sets is satisfied. Cc is the union of matching entries, deduplicated. An entry with only recipients matches every build issue on that tree's URL. platform, origin, hardware-keyed files, and issues other than build are validation errors.

--to, --cc, --add-mailing-lists, and --ignore-recipients keep today's semantics; --ignore-recipients skips regression/. generate_test_report does not use scoped entries: its Cc is the union of entries that have no scope keys, matched by URL, which is today's list.

Implementation

  1. typeModels/notificationRecipients.py: RecipientEntry (pydantic, extra="forbid", str-or-list normalized to list), RecipientDefault (to only). load_recipient_files(directory, *, allowed_keys, allowed_issues) -> dict[str, list[RecipientEntry]]. Each tree key must exist in subscriptions/; the loader records that tree's url. Two subscription files with the same url is a validation error. Errors carry file, entry index, and key.
  2. Commit the copied regression/<tree>.yaml files.
  3. helpers/common.py: replace _get_default_tree_recipients with resolve_regression_recipients(issue, build_incidents) -> list[str], reading only regression/. send_email_report stops calling the lookup; generate_issue_report passes recipients=. generate_test_report passes the unscoped entries for that URL.
  4. On the regression path, the list address used when --add-mailing-lists is set comes from regression/default.yaml instead of KERNELCI_RESULTS. Reply-To and regzbot behavior are unchanged.
  5. Header line in issue_build.txt.j2 and issue_boot.txt.j2: Cc from: regression/<tree>.yaml. No header change in test_report.txt.j2.
  6. docs/notifications.md: regression Cc is edited in regression/; default_recipients is the [STATUS] list only.

Tests

Loader fixtures: valid, unknown tree, duplicate URL, unknown key, platform, origin, issues: [boot]. Resolver fixtures: branch, architecture, no match, dedup, scope-less entry matches all, test-report path ignores scoped entries. One test loads the real regression/ directory so an invalid committed file fails pytest -m unit.

Acceptance

  • After the copy commit, every tree's [REGRESSION] Cc equals its old default_recipients, and [STATUS] Cc is unchanged
  • A scoped entry is Cc'd only when the branch and a build incident match
  • An invalid file fails CI with file, entry, and key
  • The build and boot bodies name the regression/ file

#2159 is rebased onto this scope: keep the loader and validation work, drop the per-recipient issues list, the rewrite of the subscription files, and the metrics directory.

Closes #1080.

主要言語
Python
スター
10
フォーク
31
平均マージ
2日 18時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kernelci/dashboard のほかの issue

kernelci/dashboard の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。