Skip to content

Automate PR Deploys via GitHub Workflow with Staff Verification #11259

@mekarpeles

Description

@mekarpeles

Feature Request

Problem / Opportunity

Currently, PR deploys are managed manually by staff, leading to inconsistent processes and delays. Automating PR deploys via GitHub workflow will streamline the deployment workflow for developers and ensure only qualified staff can trigger Jenkins PR deploys.

Mechanism:

  • GitHub workflow listens for label addition events, e.g. PR Deploy: @cdrini.
  • If the label is added by a non-staff account, remove the label immediately.
  • If label is added by a staff account, trigger Jenkins PR deploy for all PRs for the specified user.
  • Once PR is merged, automatically remove the PR Deploy label.
  • Integrate with https://jenkins.openlibrary.org/job/testing-deploy/buildWithParameters to trigger deploys.

Edge Cases:

  • If a PR deploy causes a merge conflict, apply a PR Deploy Conflict label for visibility and resolution.

Labels Used: Priority: 2, Lead: @mekarpeles, Affects: Developers.

Audience: Developers, Staff, Maintainers.

Constraints: Must check for staff status before triggering Jenkins jobs. Label management must be robust to avoid accidental deploys.

Breakdown

Related files

Implementation Steps

  1. Create/modify GitHub workflow to listen for label addition events.
  2. Build logic to check if label adder is staff.
  3. If not staff, auto-remove label and notify.
  4. If staff, trigger Jenkins PR deploy for all PRs for specified user.
  5. Remove PR Deploy label after merge.
  6. On merge conflict, add PR Deploy Conflict label.

Edge Cases

  • Handle race conditions if multiple PRs are labeled/merged simultaneously.
  • Robust error handling for Jenkins API failures.
  • Security: Prevent unauthorized Jenkins deploys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Affects: DevelopersLead: @mekarpelesIssues overseen by Mek (Staff: Program Lead) [managed]Needs: Staff / InternalReviewed a PR but don't have merge powers? Use this.Priority: 2Important, as time permits. [managed]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions