Skip to content

Commit

Permalink
Re-enable emails on package publishing. (dart-lang#7439)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jan 30, 2024
1 parent f95d4bc commit 4c0bfba
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Important changes to data models, configuration, and migrations between each
AppEngine version, listed here to ease deployment and troubleshooting.

## Next Release (replace with git tag when deployed)
* Note: re-enabled email notification on package published events.

## `20240125t125400-all`
* Bumped runtimeVersion to `2024.01.22`.
Expand Down
1 change: 0 additions & 1 deletion app/config/dartlang-pub-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pubSiteAudience: 621485135717-idb8t8nnguphtu2drfn2u4ig7r56rm6n.apps.googleuserco
pubServerAudience: 621485135717-082tj8o9vu32lbmquftsolqngk2o13lp.apps.googleusercontent.com
externalServiceAudience: https://pub.dev
gmailRelayServiceAccount:
gmailRelayImpersonatedGSuiteUser:
uploadSignerServiceAccount: [email protected]
blockRobots: true
productionHosts:
Expand Down
1 change: 0 additions & 1 deletion app/config/dartlang-pub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pubSiteAudience: 818368855108-e8skaopm5ih5nbb82vhh66k7ft5o7dn3.apps.googleuserco
pubServerAudience: 818368855108-ulq5tn5t51ga21hg8jkcavbooaljiasp.apps.googleusercontent.com
externalServiceAudience: https://pub.dev
gmailRelayServiceAccount: [email protected]
gmailRelayImpersonatedGSuiteUser: [email protected]
uploadSignerServiceAccount: [email protected]
blockRobots: false
productionHosts:
Expand Down
6 changes: 2 additions & 4 deletions app/lib/package/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,7 @@ class PackageBackend {
newVersion,
entities.packageVersionInfo,
...entities.assets,
if (activeConfiguration.isPublishedEmailNotificationEnabled)
outgoingEmail,
outgoingEmail,
if (isNew)
AuditLogRecord.packageCreated(
uploader: agent,
Expand Down Expand Up @@ -1178,8 +1177,7 @@ class PackageBackend {
) async {
try {
await Future.wait([
if (activeConfiguration.isPublishedEmailNotificationEnabled)
emailBackend.trySendOutgoingEmail(outgoingEmail),
emailBackend.trySendOutgoingEmail(outgoingEmail),
taskBackend.trackPackage(newVersion.package, updateDependants: true),
if (apiExporter != null)
apiExporter!
Expand Down
2 changes: 1 addition & 1 deletion app/lib/service/services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Future<void> withServices(FutureOr<void> Function() fn) async {
registerDomainVerifier(DomainVerifier());
registerEmailSender(
activeConfiguration.gmailRelayServiceAccount != null &&
activeConfiguration.gmailRelayImpersonatedGSuiteUser != null
activeConfiguration.isProduction
? createGmailRelaySender(
activeConfiguration.gmailRelayServiceAccount!,
authClient,
Expand Down
17 changes: 0 additions & 17 deletions app/lib/shared/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,6 @@ class Configuration {
/// **Optional**, if omitted email sending is disabled.
final String? gmailRelayServiceAccount;

/// Email of the GSuite user account to impersonate when sending emails
/// through the gmail SMTP relay.
///
/// This must be the email for an account within the GSuite used for sending
/// emails. It is important that the gmail SMTP relay is enabled for this
/// GSuite, for configuration see:
/// https://support.google.com/a/answer/176600?hl=en
///
/// **Optional**, if omitted email sending is disabled.
final String? gmailRelayImpersonatedGSuiteUser;

/// The email of the service account which has access rights to sign upload
/// requests. The current service must be able to impersonate this account.
///
Expand Down Expand Up @@ -295,7 +284,6 @@ class Configuration {
required this.pubServerAudience,
required this.externalServiceAudience,
required this.gmailRelayServiceAccount,
required this.gmailRelayImpersonatedGSuiteUser,
required this.uploadSignerServiceAccount,
required this.blockRobots,
required this.productionHosts,
Expand Down Expand Up @@ -363,7 +351,6 @@ class Configuration {
externalServiceAudience: _fakeExternalAudience,
defaultServiceBaseUrl: 'http://localhost:$frontendPort/',
gmailRelayServiceAccount: null, // disable email sending
gmailRelayImpersonatedGSuiteUser: null, // disable email sending
uploadSignerServiceAccount: null,
blockRobots: false,
productionHosts: ['localhost'],
Expand Down Expand Up @@ -415,7 +402,6 @@ class Configuration {
externalServiceAudience: _fakeExternalAudience,
defaultServiceBaseUrl: primaryApiUri?.toString() ?? 'http://localhost:0/',
gmailRelayServiceAccount: null, // disable email sending
gmailRelayImpersonatedGSuiteUser: null, // disable email sending
uploadSignerServiceAccount: null,
blockRobots: true,
productionHosts: ['localhost'],
Expand Down Expand Up @@ -454,9 +440,6 @@ class Configuration {
late final isProduction = projectId == 'dartlang-pub';
late final isNotProduction = !isProduction;
late final isStaging = projectId == 'dartlang-pub-dev';

/// NOTE: email notification on package published is temporarily disabled.
late final isPublishedEmailNotificationEnabled = isNotProduction;
}

/// Data structure to describe an admin user.
Expand Down
5 changes: 0 additions & 5 deletions app/lib/shared/configuration.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/test/shared/test_data/foo_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pubClientAudience: _pubClientAudience
pubSiteAudience: 'foo-foo.apps.googleusercontent.com'
externalServiceAudience: 'https://pub.dev'
gmailRelayServiceAccount:
gmailRelayImpersonatedGSuiteUser:
uploadSignerServiceAccount: '[email protected]'
blockRobots: true
productionHosts:
Expand Down

0 comments on commit 4c0bfba

Please sign in to comment.