Repository navigation
Email a Run notification only when the Command did not end merged - #1201
Merged
Merged
Conversation
A Run notification asked for with the email-unless-merged flag, or by email.always with email.unless_merged in the User config, is saved but not emailed when the command ended merged.
…that left work waiting Address the review of the email-unless-merged change: - email.unless_merged asks for a Run notification on its own, as email-unless-merged does; Setup counts it as on, and answering no turns it off. - A merged Security run whose fix left its finding open, or whose audit left findings waiting for the Day shift, is still emailed. - Fold the flag into the help's email line, keeping help within its cap. - Name the new tests in Ticket run vocabulary and fix the guide and glossary wording.
# Conflicts: # site/docs/index.html
Merged
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.
Summary
A Run notification can now be emailed only when the Command did not end merged. Choose it per command with
email-unless-merged [<address>](or--email-unless-merged), or on every Command withemail.unless_merged = truein the User config. A merged Command's notification is still saved beside its Command log; it just isn't emailed.How the flags and the User config decide (
Flags::notification):merged, with no Security finding left open by its fix and none waiting for the Day shift. So a merged Security fix that still needs a human is still emailed.email.unless_mergedas notifications on. Answering no to the notifications question turns it off too. Setup writes the key at its default with the other settings.docs/guide.md(with the regeneratedsite/docs/index.html) and theGLOSSARY.mdentries for Run notification and User config are updated. The hand-written site pages don't cover the email flags, so they are unchanged.Evidence
Before: the new
tests/run_notification.rstests failed againstmain's behaviour (unknown key email.unless_merged, and the flag was not recognised): 0 passed, 6 failed. The reviewers' two tests also failed against the first commit, each withleft: 0, right: 1requests:unless_merged_alone_in_the_user_config_emails_a_ticket_run_that_did_not_mergeemail_unless_merged_still_emails_a_merged_fix_that_left_its_finding_openAfter: these all pass:
Full Rust suite on cfd4025:
cargo test --no-fail-fastgave 2431 passed, 0 failed. It ran withtag.gpgsign=falseset throughGIT_CONFIG_*, because this host's globaltag.gpgsign = truefails three unrelatedworktree::synchronization_testswith "no tag message?".Site:
npm test --prefix sitepassed 49 of 49.After the last
origin/mainmerge (d449187):cargo clippy --all-targets -D warningsandcargo fmt --checkare clean.setup,asks,config,args,run_endingandnotificationpass.run_notification,command_surface,setup,user_configand thesecurity_runemail tests pass.npm run docs:checkpasses.Merge Danger
Door: two-way
The change is additive: a new flag and a new User config key, both off by default. One existing message changes: the email-flag conflict error now reads "email, email-unless-merged and no-email can't be used together".
Blast Radius: notifications
Only whether a Run notification is emailed is affected, and only when the new flag or key is used. A wrong decision could drop an email you wanted, but the notification file is always saved.
Review coverage
Both reviewers used
origin/mainas the fixed point, since localmainwas behind it.Excluded as generated:
site/docs/index.html. Its source isdocs/guide.md, andcd site && npm run docs:checkexits 0.Changed after review, new hunks not reviewed:
src/run_ending.rssrc/setup/questions.rstests/security_run.rsEvery other changed file was read by both reviewers.
Unaddressed findings
Standards
NotificationAsk::SendUnlessMergedrepeatsSendintake_flag,public_flag_wordsandRunNotification::new): declined as a judgement call. The variant follows the existingSend(Option<String>)/Skipshape insrc/notification.rs. Merging them intoSend { to, unless_merged }would rewrite everyNotificationAsk::Send(..)site insrc/asks.rs,src/args.rsand their tests, to save three small arms.Account.outcome's display string): partly addressed. The comparison now lives once, inAccount::merged_with_nothing_waiting(src/run_ending.rs), beside the existingself.outcome == "review required"inAccount::summary. GivingAccount.outcomeits own type is outside add user config / command flag that lets you get emailed notice of run completion only when the result is not merged #1114.EMAIL_FLAGSerror string changed in several tests): declined. It comes from the existingEMAIL_FLAGSconstant andask_oncedesign insrc/args.rs, as the reviewer notes.Security
c32f00b...HEADfound no unaddressed finding: the address afteremail-unless-mergedpasses the sameis_addresscheck asemailand goes into retry commands as one quoted word (shell_commandinsrc/args.rs). A malformedemail.unless_mergedis rejected (src/config.rs). Holding back an email is the user's own choice, and a merged Security fix whose finding is left open, or whose findings are waiting, is still emailed (Account::merged_with_nothing_waiting).Spec
Flags::notification(src/asks.rs), which unit tests cover.RunNotification::finish(src/notification.rs).Account::of_run(src/run_ending.rs), the same as the Ticket run tests exercise.Closes #1114
Built with claude · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.