Repository navigation
Setup asks for the Resend key and writes the Credentials - #198
Merged
Merged
Conversation
Closes #192 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the CONTEXT.md conflict on Setup: keep this branch's wording (the key is asked for only with Run notifications on) and main's "when a key is entered", since the key prompt can be skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
With Run notifications on, Setup now asks for the Resend API key with input hidden and saves it in the Credentials (
~/.thirdshift/credentials.toml, mode 0600). It no longer prints theexport RESEND_API_KEY=...shell-profile hint.thirdshift setupand the first Run's Setup offer, answered Yes, ask the same question.Setup reads and validates the Credentials before it asks anything, even if the user later turns notifications off. This follows #192's "refused before any questions". With notifications off, nothing about a key is asked and the file is never written.
README (Setup step 4 and the Email section), the
helptext and the Setup glossary entry now describe the key prompt.Evidence
Before: with notifications on and no key, Setup printed
export RESEND_API_KEY=re_...and wrote nothing. A Run from cron withemail.always = truethen stopped for want of a key.After: new binary-level tests on a pseudo-terminal (
run_on_terminal), all passing:The old key-hint test was rewritten for the new behaviour, not deleted. A manual check on a pty confirmed echo is off during the prompt and back on after Ctrl-C.
cargo testpasses in full, andcargo clippy --all-targetsis clean.Merge Danger
Door: two-way
Setup only writes a new file, and only when a key is typed. Reverting brings back the hint, and any saved Credentials keep working through the lookup from #191.
Blast Radius: Setup
Only
thirdshift setupand the first Run's Setup offer change. Runs,email-test,update,versionandhelpbehave as before. Setup from a terminal is now refused by a broken Credentials file, even for a user who will turn notifications off.Unaddressed findings
Standards
askblock insetupandoffer_setup: it is three lines, and the two callers treat failures after asking differently (error vs warning). A shared helper would add a layer without removing the fork.EchoOff(termios and signal code) lives inquestions.rs: the hidden question is its only user, andinterrupt.rsis about recording signals for a Run's Failed run path, not terminal state. Kept where it's used.config::replacemadepubfor the Credentials: reusing the one atomic, permission-keeping write beats copying it. Moving it to a new file-helpers module is a separate refactor.Credentials::lookupvsResendKey::findboth say "environment, else the file": kept deliberately.findmust not open the file whenRESEND_API_KEYis set (so broken Credentials can't block a Run), while Setup has already read it.Spec
[Y/n]offer: until the offer is accepted there is no Setup, and a Run that declines must not be blocked by a file it doesn't need (Setup asks for the Resend API key and saves it in a Credentials file #190 story 30). It is refused before any Setup question and before any work (now tested).Closes #192
🤖 Generated with Claude Code