-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Affects: DevelopersLead: @mekarpelesIssues overseen by Mek (Staff: Program Lead) [managed]Issues overseen by Mek (Staff: Program Lead) [managed]Needs: Staff / InternalReviewed a PR but don't have merge powers? Use this.Reviewed a PR but don't have merge powers? Use this.Priority: 2Important, as time permits. [managed]Important, as time permits. [managed]
Description
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
.github/workflows/
for workflow automation- Label management in PRs
- Jenkins integration script for triggering builds: https://jenkins.openlibrary.org/job/testing-deploy/buildWithParameters
- Staff account verification logic
- Conflict label logic for failed merges
Implementation Steps
- Create/modify GitHub workflow to listen for label addition events.
- Build logic to check if label adder is staff.
- If not staff, auto-remove label and notify.
- If staff, trigger Jenkins PR deploy for all PRs for specified user.
- Remove
PR Deploy
label after merge. - 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
Labels
Affects: DevelopersLead: @mekarpelesIssues overseen by Mek (Staff: Program Lead) [managed]Issues overseen by Mek (Staff: Program Lead) [managed]Needs: Staff / InternalReviewed a PR but don't have merge powers? Use this.Reviewed a PR but don't have merge powers? Use this.Priority: 2Important, as time permits. [managed]Important, as time permits. [managed]