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

MBS-13876: Send verification emails through new mail service #3433

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JadedBlueEyes
Copy link
Contributor

@JadedBlueEyes JadedBlueEyes commented Dec 30, 2024

Problem

MBS-13876

Testing

Manual testing, and updating the automated tests.

params => {
to_name => $user_name,
verification_url => ${ $verification_link },
# TODO: Do we include the IP address, like with the previous email?
Copy link
Member

Choose a reason for hiding this comment

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

I can't remember, did we previously discuss removing it? I'm fine with dropping it, anyway.

@mwiencek mwiencek changed the title MBS-13876: Verification emails MBS-13876: Send verification emails through new mail service Jan 14, 2025
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

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

Updated this to fix the test failures and remove the unused ip parameter.

I did fully test it with a running mb-mail-service + local IMAP/SMTP services, and was able to verify my account with the sent email.

@mwiencek mwiencek marked this pull request as draft January 14, 2025 01:07
@mwiencek
Copy link
Member

Converting to draft because there are even more test failures I didn't see the first time.

@julian45
Copy link
Contributor

Attempting to pull out relevant test failures out of the very long CircleCI test output:

# t::MusicBrainz::Server::Controller::User::Edit
    # all
        ok 1 - GET /account/edit
        ok 2 - valid HTML5
        ok 3 - Invalid URL format 'foo' triggers validation failure.
        ok 4 - Invalid date 0-1-1 triggers validation failure.
        ok 5 - Content contains "Your profile has been updated"
        ok 6 - Content contains "We have sent you a verification email"
    not ok 1 - all

    # Failed test 'all'
    # at t/lib/t/MusicBrainz/Server/Controller/User/Edit.pm line 66.
    # Caught exception in subtest: Can't use an undefined value as a HASH reference at t/lib/t/MusicBrainz/Server/Controller/User/Edit.pm line 50.
    # Hide biography and website/homepage of beginners/limited users from not-logged-in users and only from them
        ok 1 - valid HTML5
        ok 2 - biography field of beginner/limited user is visible from logged-in user
        ok 3 - website field of beginner/limited user is visible from logged-in user
        ok 4 - valid HTML5
        ok 5 - valid HTML5
        ok 6 - biography field of beginner/limited user is hidden from not-logged-in user
        ok 7 - website field of beginner/limited user is hidden from not-logged-in user
        # We remove the beginner flag from the editor
        ok 8 - valid HTML5
        ok 9 - biography field of (not beginner/limited) user is visible from everyone
        ok 10 - website field of (not beginner/limited) user is visible from everyone
        1..10
    ok 2 - Hide biography and website/homepage of beginners/limited users from not-logged-in users and only from them
    # After removing email address, editors cannot edit
        ok 1
        ok 2 - GET /account/edit
        ok 3 - valid HTML5
        ok 4 - Content contains "Your profile has been updated"
        ok 5
        1..5
    ok 3 - After removing email address, editors cannot edit
    1..3
not ok 166 - t::MusicBrainz::Server::Controller::User::Edit
# Failed test 't::MusicBrainz::Server::Controller::User::Edit'
# at /home/musicbrainz/carton-local/lib/perl5/Test/Routine/Runner.pm line 88.

...

# t::MusicBrainz::Server::Controller::User::Register
    # Registering without verifying an email address
        ok 1 - Fetch registration page
        ok 2 - Response has referrer-policy header with value "strict-origin-when-cross-origin"
        ok 3 - should redirect to profile page after registering
        1..3
    ok 1 - Registering without verifying an email address
    # Registering and verifying an email address
        ok 1 - Fetch registration page
        ok 2 - should redirect to profile page after registering
    not ok 2 - Registering and verifying an email address

    # Failed test 'Registering and verifying an email address'
    # at t/lib/t/MusicBrainz/Server/Controller/User/Register.pm line 62.
    # Caught exception in subtest: Can't use an undefined value as a HASH reference at t/lib/t/MusicBrainz/Server/Controller/User/Register.pm line 48.
    # Trying to register with an invalid name
        ok 1 - fetch registration page
        ok 2 - stays on registration page
        ok 3 - form has error message
        ok 4 - stays on registration page
        ok 5 - form has error message for newlines in username
        ok 6 - stays on registration page
        ok 7 - form has error message for consecutive spaces in username
        ok 8 - stays on registration page
        ok 9 - form has error message for invisible characters in username
        ok 10 - stays on registration page
        ok 11 - form has error message for tag characters in username
        ok 12 - stays on registration page
        ok 13 - form has error message for :// in username
        1..13
    ok 3 - Trying to register with an invalid name
    # Trying to register with an existing name
        ok 1 - fetch registration page
        ok 2 - stays on registration page
        ok 3 - form has error message
        ok 4 - stays on registration page
        ok 5 - form has error message
        1..5
    ok 4 - Trying to register with an existing name
    # Opening a new registration form does not invalidate CSRF token on previous form
        ok 1 - fetch registration page
        ok 2 - fetch registration page again
        ok 3 - original form is submitted
        1..3
    ok 5 - Opening a new registration form does not invalidate CSRF token on previous form
    1..5
not ok 172 - t::MusicBrainz::Server::Controller::User::Register

# Failed test 't::MusicBrainz::Server::Controller::User::Register'
# at /home/musicbrainz/carton-local/lib/perl5/Test/Routine/Runner.pm line 88.

...

# t::MusicBrainz::Server::Controller::User::Reverify
    # all
        ok 1 - successfully inserted 2003-01-01 as old verification date
        ok 2 - current year is bigger than 2003
        ok 3 - Content contains "/account/resend-verification"
        ok 4 - User page contains a reverification link
    not ok 1 - all

    # Failed test 'all'
    # at t/lib/t/MusicBrainz/Server/Controller/User/Reverify.pm line 48.
    # Caught exception in subtest: Can't use an undefined value as a HASH reference at t/lib/t/MusicBrainz/Server/Controller/User/Reverify.pm line 31.
    1..1
not ok 173 - t::MusicBrainz::Server::Controller::User::Reverify

# Failed test 't::MusicBrainz::Server::Controller::User::Reverify'
# at /home/musicbrainz/carton-local/lib/perl5/Test/Routine/Runner.pm line 88.

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.

3 participants