fix(forward-email): keep applying a domain's alias writes after one fails - #3
Conversation
…ails One failing alias write (create/update/delete raising ForwardEmailApiError) no longer aborts the domain's remaining, independent writes: the error is printed per alias and the run still exits 1. Found live (issue #2): Forward Email re-validates an alias's stored regex pattern on every write and now rejects Perl-style look-around, so a grandfathered `(?!...)` alias 400s on a quota-only update — and took its domain's other pending update down with it. The pattern trap itself is FE-side and unfixable from the client (probed: omitting `name` from the update body still 400s), so surface it early instead: plan prints a WARNING when a planned create/update touches an alias whose name contains look-around, and the README documents the contract. Closes #2.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 841386109e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ok = False | ||
| continue | ||
| out.write(f" applied alias {chg.action} {chg.name}\n") | ||
| for chg in deletes: |
There was a problem hiding this comment.
Do not prune aliases after a replacement create fails
With PRUNE=1, a rename or migration is planned as a create for the new alias plus a delete for the old alias. If that create raises ForwardEmailApiError, ok becomes false but this loop still deletes the old, working alias, leaving the address with no delivery target; previously the exception reached the outer handler before any deletes ran. Continue attempting the remaining creates/updates, but skip the delete phase if any of those writes failed.
Useful? React with 👍 / 👎.
Fixes #2.
_applywraps each alias create/update/delete in its ownForwardEmailApiErrorhandler: the error is printed for that alias, the domain's remaining writes still run, and the run exits 1.WARNINGwhen a planned create/update touches an alias whose regex name contains Perl-style look-around ((?!,(?=,(?<) — FE re-validates the stored pattern on every write and rejects these, even for a quota-only update with nonamein the body (probed live, see the issue). A look-around alias with no planned change stays silent.Tests: 3 new (failing-alias-continues, warning-on-planned-change, silent-when-clean), written first and watched fail; suite 448 -> 451 green.