Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stages/email: improve error handling for incorrect template syntax #7758

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Dec 2, 2023

Details

closes #7755

When an errors occurs while rendering an email template, handle the error, log it as event and mark the stage as invalid


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)
  • The translation files have been updated (make i18n-extract)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@BeryJu BeryJu marked this pull request as ready for review December 2, 2023 15:43
Copy link

netlify bot commented Dec 2, 2023

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 05971e2
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/656cfb8bd81cbf0008a5b765

@BeryJu BeryJu requested a review from a team as a code owner December 2, 2023 15:43
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (6bdbdaf) 92.64% compared to head (05971e2) 92.63%.
Report is 2 commits behind head on main.

Files Patch % Lines
authentik/flows/stage.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7758      +/-   ##
==========================================
- Coverage   92.64%   92.63%   -0.01%     
==========================================
  Files         588      588              
  Lines       29141    29192      +51     
==========================================
+ Hits        26997    27042      +45     
- Misses       2144     2150       +6     
Flag Coverage Δ
e2e 50.65% <20.68%> (-0.07%) ⬇️
integration 25.91% <6.89%> (-0.04%) ⬇️
unit 89.71% <94.82%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BeryJu BeryJu force-pushed the stages/email/template-error-handling branch from 68a6ff5 to f5a4cbf Compare December 3, 2023 18:09
@BeryJu BeryJu requested a review from a team as a code owner December 3, 2023 18:09
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu force-pushed the stages/email/template-error-handling branch from f5a4cbf to 4af86f4 Compare December 3, 2023 18:41
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu force-pushed the stages/email/template-error-handling branch from 4af86f4 to 05971e2 Compare December 3, 2023 22:04
@BeryJu BeryJu merged commit 893b837 into main Dec 4, 2023
@BeryJu BeryJu deleted the stages/email/template-error-handling branch December 4, 2023 10:02
kensternberg-authentik added a commit that referenced this pull request Dec 4, 2023
* main: (22 commits)
  stages/email: improve error handling for incorrect template syntax (#7758)
  core: bump github.com/go-openapi/strfmt from 0.21.7 to 0.21.8 (#7768)
  website: bump postcss from 8.4.31 to 8.4.32 in /website (#7770)
  web: bump the eslint group in /tests/wdio with 1 update (#7773)
  website: bump @types/react from 18.2.39 to 18.2.41 in /website (#7769)
  web: bump the eslint group in /web with 1 update (#7772)
  website: fix typos in example URLs (#7774)
  root: include ca-certificates in container (#7763)
  root: don't show warning when app has no URLs to import (#7765)
  web: revert storybook (#7764)
  web: bump the eslint group in /web with 2 updates (#7730)
  website: bump @types/react from 18.2.38 to 18.2.39 in /website (#7720)
  web: bump the storybook group in /web with 5 updates (#7750)
  website/blog: fix email syntax (#7753)
  web: bump the wdio group in /tests/wdio with 3 updates (#7751)
  web: bump the babel group in /web with 3 updates (#7741)
  web: bump the sentry group in /web with 2 updates (#7747)
  web: bump pyright from 1.1.337 to 1.1.338 in /web (#7743)
  website: bump the docusaurus group in /website with 9 updates (#7746)
  web: bump rollup from 4.6.0 to 4.6.1 in /web (#7748)
  ...
kensternberg-authentik added a commit that referenced this pull request Dec 4, 2023
* web/config-provider: (23 commits)
  web: Added a README with a description of the applications' "mental model," essentially an architectural description.
  stages/email: improve error handling for incorrect template syntax (#7758)
  core: bump github.com/go-openapi/strfmt from 0.21.7 to 0.21.8 (#7768)
  website: bump postcss from 8.4.31 to 8.4.32 in /website (#7770)
  web: bump the eslint group in /tests/wdio with 1 update (#7773)
  website: bump @types/react from 18.2.39 to 18.2.41 in /website (#7769)
  web: bump the eslint group in /web with 1 update (#7772)
  website: fix typos in example URLs (#7774)
  root: include ca-certificates in container (#7763)
  root: don't show warning when app has no URLs to import (#7765)
  web: revert storybook (#7764)
  web: bump the eslint group in /web with 2 updates (#7730)
  website: bump @types/react from 18.2.38 to 18.2.39 in /website (#7720)
  web: bump the storybook group in /web with 5 updates (#7750)
  website/blog: fix email syntax (#7753)
  web: bump the wdio group in /tests/wdio with 3 updates (#7751)
  web: bump the babel group in /web with 3 updates (#7741)
  web: bump the sentry group in /web with 2 updates (#7747)
  web: bump pyright from 1.1.337 to 1.1.338 in /web (#7743)
  website: bump the docusaurus group in /website with 9 updates (#7746)
  ...
kensternberg-authentik added a commit that referenced this pull request Dec 4, 2023
* main: (210 commits)
  stages/email: improve error handling for incorrect template syntax (#7758)
  core: bump github.com/go-openapi/strfmt from 0.21.7 to 0.21.8 (#7768)
  website: bump postcss from 8.4.31 to 8.4.32 in /website (#7770)
  web: bump the eslint group in /tests/wdio with 1 update (#7773)
  website: bump @types/react from 18.2.39 to 18.2.41 in /website (#7769)
  web: bump the eslint group in /web with 1 update (#7772)
  website: fix typos in example URLs (#7774)
  root: include ca-certificates in container (#7763)
  root: don't show warning when app has no URLs to import (#7765)
  web: revert storybook (#7764)
  web: bump the eslint group in /web with 2 updates (#7730)
  website: bump @types/react from 18.2.38 to 18.2.39 in /website (#7720)
  web: bump the storybook group in /web with 5 updates (#7750)
  website/blog: fix email syntax (#7753)
  web: bump the wdio group in /tests/wdio with 3 updates (#7751)
  web: bump the babel group in /web with 3 updates (#7741)
  web: bump the sentry group in /web with 2 updates (#7747)
  web: bump pyright from 1.1.337 to 1.1.338 in /web (#7743)
  website: bump the docusaurus group in /website with 9 updates (#7746)
  web: bump rollup from 4.6.0 to 4.6.1 in /web (#7748)
  ...
@BeryJu
Copy link
Member Author

BeryJu commented Dec 19, 2023

/cherry-pick version-2023.10

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Dec 19, 2023
…7758)

* stages/email: improve error handling for incorrect template syntax

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* add tests

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit that referenced this pull request Dec 19, 2023
…herry-pick #7758) (#7936)

stages/email: improve error handling for incorrect template syntax (#7758)

* stages/email: improve error handling for incorrect template syntax



* add tests



---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens L <jens@goauthentik.io>
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.

Custom Email Template raises exception, not sent; GET /api/v3/flows/executor/password-recovery/
1 participant