Bug 218227 - [ews] Ensure that uat instance doesn't send emails
Summary: [ews] Ensure that uat instance doesn't send emails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-27 05:18 PDT by Aakash Jain
Modified: 2022-01-24 18:14 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.45 KB, patch)
2020-10-27 05:26 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (1.50 KB, patch)
2020-10-28 06:38 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (1.55 KB, patch)
2020-10-28 08:21 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2020-10-27 05:18:09 PDT
uat instance (ews-buidl.webkit-uat.org) is for testing purposes and various times it runs queues/configurations which aren't ready for production yet. We should ensure that uat instance doesn't send emails to users.
Comment 1 Aakash Jain 2020-10-27 05:26:55 PDT
Created attachment 412414 [details]
Patch
Comment 2 Darin Adler 2020-10-27 14:26:23 PDT
Comment on attachment 412414 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412414&action=review

> Tools/BuildSlaveSupport/ews-build/send_email.py:52
> +    if 'uat' in HOSTNAME:

This seems like an imprecise check. Is there no chance that a host might have "uat" as a substring of its name? It’s in words like "graduate".
Comment 3 Keith Rollin 2020-10-27 14:32:35 PDT
Heh. The word that came to my mind was "squat".

The domain in question was "https://ews-build.webkit-uat.org". Would it cause problems to look for "ews-build.webkit-uat.org"? Or "webkit-uat.org"? Or "webkit-uat"? or "-uat.org"?
Comment 4 Darin Adler 2020-10-27 14:36:56 PDT
(In reply to Keith Rollin from comment #3)
> The domain in question was "https://ews-build.webkit-uat.org". Would it
> cause problems to look for "ews-build.webkit-uat.org"? Or "webkit-uat.org"?
> Or "webkit-uat"? or "-uat.org"?

or "-uat." or /\buat\b/
Comment 5 Aakash Jain 2020-10-28 06:35:43 PDT
(In reply to Keith Rollin from comment #3)
> Would it cause problems to look for "ews-build.webkit-uat.org"? Or "webkit-uat.org"? Or "webkit-uat"? or "-uat.org"?
Not really. This particular check is specifically for this host.

In fact any other host matching this check isn't much of a concern, since almost all other hosts will fail the previous check of is_test_mode_enabled. is_test_mode_enabled is disabled only when BUILDBOT_PRODUCTION env variable is set, which is not set by default. We need to set this variable on uat instance since we need it to mimic production environment (e.g.: reading passwords.json file so that we can easily connect bots to it).

Also, no other instance (like local testing instance) should send emails.

Instead of disallowing this particular host, I have reverted the check in updated patch to allow only one host: production EWS instance.
Comment 6 Aakash Jain 2020-10-28 06:38:46 PDT
Created attachment 412525 [details]
Patch
Comment 7 Aakash Jain 2020-10-28 08:21:13 PDT
Created attachment 412529 [details]
Patch
Comment 8 EWS 2020-10-28 09:17:14 PDT
Committed r269106: <https://trac.webkit.org/changeset/269106>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412529 [details].
Comment 9 Radar WebKit Bug Importer 2020-10-28 09:18:20 PDT
<rdar://problem/70766615>