Repository navigation
feat(notifications): scope regression recipients in regression/ - #8
Closed
felipebergamin wants to merge 2 commits into
Closed
felipebergamin wants to merge 2 commits into
felipebergamin wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes kernelci#2114
Closes kernelci#1080
[REGRESSION]mail used to Cc thedefault_recipientsof 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_recipientsinsubscriptions/is still the[STATUS]Cc and is not modified.Commits
copy tree recipients into regression/is data only. Each of the 45 non-hardware subscription trees getsregression/<tree>.yamlwith one unscoped entry, copied from itsdefault_recipients(display names kept).regression/default.yamlholds the To address. Nothing reads these files in this commit, so it can be reviewed by checking that each list equals the old one.Cc regression reports from regression/contains the logic.How it works
subscriptions/. The loader uses that tree'surlto match issues.branchis compared with the issue's branch, the one printed in the mail.architecture,config_nameandcompilerare compared with the build incidentsgenerate_issue_reportalready fetches, so there is no new query.test_reportuses only entries without scope keys, which reproduces today's list.--add-mailing-lists, regression reports take To fromregression/default.yaml.[STATUS]keepsKERNELCI_RESULTS. Reply-To and the regzbot Cc did not change.Cc from: regression/<tree>.yamlso a reader knows which file to edit.typeModels/notificationRecipients.pyvalidates the files. An unknown tree, a repeated subscription URL,platform,origin, any other unknown key,issuesother thanbuild, or a*_hardware.yamlfile raises an error that names the file, entry index and key. A unit test loads the committed directory, so a bad edit failspytest -m unitin CI.send_email_reportno longer looks recipients up itself. Callers passrecipients=, so I removed thegit_urlandsignup_folderarguments that only fed the old lookup.Trade-offs
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_reportalso counts as a regression report, so with--add-mailing-listsit takes To fromdefault.yamlas 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 newregression_recipients_test.pyand the refreshed golden reports.platform: footo an entry inregression/stable.yaml. The real-directory test fails withregression/stable.yaml: entry 0: key 'platform'.poetry run python manage.py notifications --action issue_report --id <maestro build issue id>. The body starts withCc from: regression/<tree>.yaml.--sendand answernat the prompt (do not pass--yes). The printedCcis the tree's olddefault_recipients. Add--add-mailing-listsand check thatToiskernelci-results@groups.io.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 maestrowithout--sendbehaves as before.[STATUS]still readsdefault_recipients.Locally: 970 backend unit tests pass,
ruff checkandruff format --checkare clean.