Skip to content

feat: generate golden files for notification templates #14537

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

Merged
merged 24 commits into from
Sep 4, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Sep 3, 2024

Related: coder/internal#40

Changes:

  • generate golden files for notification templates (works only with export DB=ci, the simplest way is run ./scripts/develop.sh in background)
  • extend MessagePayload with Data map[string]any
  • add new template for the workspace failed build summary (will use it in the follow-up)

Note: I believe our notification templates need some love in favor of spelling/formatting consistency. I will follow-up on this.

@mtojek mtojek self-assigned this Sep 3, 2024
@mtojek mtojek changed the title feat: send reports with workspace build failures feat: generate golden files for notification templates Sep 4, 2024
@mtojek mtojek marked this pull request as ready for review September 4, 2024 12:45
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited for this! Thanks a mil.
Left a couple comments; there are some extraneous changes which don't belong in this PR which I think we should remove.

require.NoError(t, err, "failed to render notification body template")
require.NotEmpty(t, body, "body should not be empty")

partialName := strings.Join(strings.Split(t.Name(), "/")[1:], "_")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels odd to have this in a test which is not explicitly for this purpose.
Can we split this out, rather?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's rely depend on strings.Split

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry you interpreted what I said literally 😆
I meant splitting out the functionality into another test.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mtojek mtojek merged commit e6d8f67 into main Sep 4, 2024
26 checks passed
@mtojek mtojek deleted the 40-email-reports branch September 4, 2024 16:26
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2024
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge approval 👍 thanks Marcin!!

@mtojek mtojek restored the 40-email-reports branch September 5, 2024 12:12
@github-actions github-actions bot deleted the 40-email-reports branch March 5, 2025 00:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants