Skip to content

Separate origin trial requester email from Google point of contact #6221

@DanielRyanSmith

Description

@DanielRyanSmith

Background & Motivation

When an origin trial creation request is submitted, an email is sent to origin-trials-support@google.com (for non-automated requests) or if automated creation fails. Currently, the email populates the "Requested by" line using the ot_owner_email field, which corresponds to the "Google point of contact" on the form. However, the person submitting the form may not always be the point of contact. To properly track and communicate who is actually submitting the origin trial request, we need a separate field to capture the requester's email address and use this in the support notification emails.

Proposed Changes

  1. Backend / Data Models (internals/core_models.py, internals/data_types.py):

    • Add a new StringProperty (e.g., ot_requester_email) to the Stage model to track the email of the user who requested the origin trial creation.
    • Update StageDict in internals/data_types.py to include ot_requester_email: str | None.
  2. API & Handlers (api/api_specs.py, api/converters.py, framework/basehandlers.py):

    • Add ot_requester_email to STAGE_FIELD_DATA_TYPES in api/api_specs.py with type 'str'.
    • Update converters.stage_to_json_dict to include ot_requester_email.
    • In framework/basehandlers.py's update_stage method, when an origin trial action is requested (ot_action_requested is true), capture the current user's email (self.get_current_user().email()) and save it to the ot_requester_email field on the Stage entity.
  3. OpenAPI Definitions (openapi/api.yaml):

    • Add ot_requester_email to the OpenAPI schema for StageField and CreateOriginTrialRequest, then regenerate the python and typescript models (via make openapi).
  4. Email Templates & Notifiers (internals/notifier.py, templates/origintrials/):

    • Update internals/notifier.py make_creation_request_email to use stage['ot_requester_email'] (falling back to ot_owner_email if absent for backwards compatibility) for the "Requested by:" field instead of stage['ot_owner_email'].
    • Update templates/origintrials/ot-creation-request-failed-email.html to use ot_requester_email.
    • Update tests in internals/notifier_test.py to assert the correct requester email is used.
  5. Frontend / Lit Components (client-src/js-src/cs-client.js):

    • Update the frontend models (cs-client.js) to recognize ot_requester_email.
    • Update admin/features/ot_requests.html to display the "Requester" utilizing ot_requester_email alongside the "Owner" (ot_owner_email).

Acceptance Criteria

  • A new ot_requester_email field exists on the Stage model.
  • Submitting an origin trial creation request saves the current user's email to ot_requester_email.
  • The "Requested by" line in the origin trial creation request email and failure email correctly displays the ot_requester_email.
  • Existing functionality works as expected, and tests are updated to reflect the new field and email template changes.

This issue description was drafted by Gemini

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions