Skip to content

feat(notifications): scope regression recipients in regression/ - #8

Closed
felipebergamin wants to merge 2 commits into
mainfrom
feat/regression-recipient-scope
Closed

felipebergamin wants to merge 2 commits into
mainfrom
feat/regression-recipient-scope

Conversation

@felipebergamin

Copy link
Copy Markdown
Member

Closes kernelci#2114
Closes kernelci#1080

[REGRESSION] mail used to Cc the default_recipients of whichever subscription file had the issue's git URL, whatever the branch or architecture. The [STATUS] summary Cc's the same list, so a maintainer of one stable branch got regressions from every branch.

This PR moves the regression Cc to backend/data/notifications/regression/. An entry there can narrow who gets Cc'd by branch, architecture, config or compiler. default_recipients in subscriptions/ is still the [STATUS] Cc and is not modified.

Commits

  1. copy tree recipients into regression/ is data only. Each of the 45 non-hardware subscription trees gets regression/<tree>.yaml with one unscoped entry, copied from its default_recipients (display names kept). regression/default.yaml holds the To address. Nothing reads these files in this commit, so it can be reviewed by checking that each list equals the old one.
  2. Cc regression reports from regression/ contains the logic.

How it works

# regression/stable.yaml
stable:
  - recipients: [stable@vger.kernel.org]   # no scope keys: every build issue on this tree's URL
  - branch: [linux-6.12.y]
    architecture: arm64
    recipients: [maintainer@example.com]
  • The top-level key must be a tree key from subscriptions/. The loader uses that tree's url to match issues.
  • An entry matches when every key it sets matches. branch is compared with the issue's branch, the one printed in the mail. architecture, config_name and compiler are compared with the build incidents generate_issue_report already fetches, so there is no new query.
  • The Cc is the union of matching entries. An address listed twice, even with different display names, is sent once.
  • test_report uses only entries without scope keys, which reproduces today's list.
  • With --add-mailing-lists, regression reports take To from regression/default.yaml. [STATUS] keeps KERNELCI_RESULTS. Reply-To and the regzbot Cc did not change.
  • Build and boot report bodies start with Cc from: regression/<tree>.yaml so a reader knows which file to edit.

typeModels/notificationRecipients.py validates the files. An unknown tree, a repeated subscription URL, platform, origin, any other unknown key, issues other than build, or a *_hardware.yaml file raises an error that names the file, entry index and key. A unit test loads the committed directory, so a bad edit fails pytest -m unit in CI.

send_email_report no longer looks recipients up itself. Callers pass recipients=, so I removed the git_url and signup_folder arguments that only fed the old lookup.

Trade-offs

  • The header line uses the issue's tree_name, while the Cc is chosen by URL. If a KCIDB tree name differs from the subscription key, the header names a file that does not exist. Today the keys follow the dashboard tree names.
  • test_report also counts as a regression report, so with --add-mailing-lists it takes To from default.yaml as well. The address is the same as before.

Test plan

From backend/:

  • poetry run pytest -m unit kernelCI_app/tests/unitTests/commands/ passes, including the new regression_recipients_test.py and the refreshed golden reports.
  • Break a file on purpose, for example add platform: foo to an entry in regression/stable.yaml. The real-directory test fails with regression/stable.yaml: entry 0: key 'platform'.
  • Dry run without sending: poetry run python manage.py notifications --action issue_report --id <maestro build issue id>. The body starts with Cc from: regression/<tree>.yaml.
  • Add --send and answer n at the prompt (do not pass --yes). The printed Cc is the tree's old default_recipients. Add --add-mailing-lists and check that To is kernelci-results@groups.io.
  • Add a scoped entry, for example branch: <another branch> with a test address, and repeat. That address is not Cc'd. Change the branch to the issue's branch and it is.
  • poetry run python manage.py notifications --action summary --summary-origins maestro without --send behaves as before. [STATUS] still reads default_recipients.

Locally: 970 backend unit tests pass, ruff check and ruff format --check are clean.

felipebergamin and others added 2 commits October 21, 2026 17:26
Seed backend/data/notifications/regression/ with one unscoped entry per
non-hardware subscription tree, copied from default_recipients. After
this commit the directory is edited by hand. default.yaml holds the
regression To address used with --add-mailing-lists.

Nothing reads these files yet.

Part of kernelci#2114

Assisted-by: Cursor
Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Co-authored-by: Cursor <cursoragent@cursor.com>
[REGRESSION] Cc came from the default_recipients of the subscription
whose url matched the issue, regardless of branch or architecture. That
list stays the [STATUS] Cc. Regression Cc now comes from
backend/data/notifications/regression/, where an entry can be scoped by
issues, branch, architecture, config_name and compiler.

The loader validates every file against the subscription tree keys and
raises with the file, entry index and key. A unit test loads the
committed directory, so a bad file fails CI. Branch is matched against
the issue's first incident and the build keys against the incidents
already queried, so no new query is added.

test_report keeps using only the unscoped entries. With
--add-mailing-lists, regression reports take their To from
regression/default.yaml. Build and boot report bodies name the file
the Cc came from.

send_email_report no longer looks up recipients itself, so the
signup_folder and git_url plumbing on the regression path is removed.

Closes kernelci#2114
Closes kernelci#1080

Assisted-by: Cursor
Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

notifications: regression/ recipients with scope notifications: add support for recipients list based on architecture

1 participant