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

ROX-23249: multiple emailsender issues discovered by debugging #1869

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

johannes94
Copy link
Contributor

@johannes94 johannes94 commented Jun 7, 2024

Description

I tested sending emails via emailservice locally and discovered some problem that I needed to be fixed to be able to send a first email.

  • Add a from header that looks more human friendly than the only the email address
  • Have the sender address configurable (addon part t.b.d but it is now a helm value)
  • Adding json tags to the SendEmailRequest so that it fits to the object send by central
  • Adding some comments to satisfy Go linter

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • Add secret to app-interface Vault or Secrets Manager if necessary
  • RDS changes were e2e tested manually
  • Check AWS limits are reasonable for changes provisioning new resources
  • (If applicable) Changes to the dp-terraform Helm values have been reflected in the addon on integration environment

Test manual

  • Run the emailsender locally
  • Open stackrox repo
  • add a temporary test:
func TestEmailSending(t *testing.T) {
	t.Setenv("ROX_ACSCS_EMAIL_URL", "http://localhost:8080")
	acscsEmail := acscsEmail{
		client: &clientImpl{
			loadToken: func() (string, error) {
				return "<your-ocm-token-here>", nil
			},
			url:        fmt.Sprintf("http://localhost:8080%s", sendMsgPath),
			httpClient: http.DefaultClient,
		},
		notifier: &storage.Notifier{
			LabelDefault: "[email protected]",
		},
	}

	err := acscsEmail.Test(context.Background())
	require.Nil(t, err, "failed to send test email")
}
  • Login to AWS dev account for local AWS authentication
  • Verify my email for aws ses sandbox in dev account
  • Run the test, verify I got a test email
# To run tests locally run:
make db/teardown db/setup db/migrate
make ocm/setup
make verify lint binary test test/integration

@johannes94 johannes94 requested a review from kurlov June 7, 2024 07:17
@openshift-ci openshift-ci bot added the approved label Jun 7, 2024
@johannes94 johannes94 changed the title fix: some issue discovered by local debugging fix: minor emailsender issues discovered by debugging Jun 7, 2024
@johannes94 johannes94 changed the title fix: minor emailsender issues discovered by debugging fix: multiple emailsender issues discovered by debugging Jun 7, 2024
@johannes94 johannes94 changed the title fix: multiple emailsender issues discovered by debugging ROX-23249: multiple emailsender issues discovered by debugging Jun 7, 2024
@johannes94
Copy link
Contributor Author

/retest

Failure seems to be unrelated, this is probably a flake. I'll create a ticket since I had another one of those occur in a different PR.

Copy link
Contributor

openshift-ci bot commented Jun 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johannes94, kurlov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@johannes94 johannes94 merged commit ed33c31 into main Jun 10, 2024
6 checks passed
@johannes94 johannes94 deleted the jmalsam/emailsender-fix-local-debug-issues branch June 10, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants