← Back to Pull requests

feat(schedules): support schedule labels in the WebUI #3701

Open
demonpig opened this pull request with 3544 lines diff across 32 files
View on GitHub
demonpig demonpig commented on Oct 03, 2026 20:49 UTC
Author

Summary

This change adds schedule label support to the AWX schedule wizard and preserves label edits across the wizard flow. It also improves schedule label validation errors by including the affected label titles.

The change adds coverage for schedule form validation, edit and selection wizard flows, prompt review details, schedule label processing, and schedule review behavior.

Type of Change

  • Bug fix

  • Enhancement

  • Tests

  • Documentation

  • Other (please specify)
  • Risk Analysis - REQUIRED

    <!-- SELECT ONE. This is required — the PR check will fail if none is selected. -->

  • High — Broad platform impact (e.g., SWR config, shared framework components, authentication, routing, API wrappers, build/bundler config). Changes affect multiple workspaces or could cause widespread regressions.

  • Medium — Scoped but cross-cutting (e.g., shared utility functions, changes to multiple pages within one workspace, component library updates, test infrastructure). Limited blast radius but touches common code paths.

  • Low — Narrowly scoped (e.g., single page fix, styling tweak, documentation, test-only changes, copy/string updates). Minimal risk of unintended side effects.
  • Dependencies

    None.

    Testing

    Ephemeral E2E Tests

    Once PR is ready and preliminary checks pass, trigger tests by posting a comment /run-playwright on this PR.

    Tests run against a fresh AAP instance (version based on branch).

    External Server E2E Runs

    Not applicable.

    Manual Testing

    1. Create a job-template schedule and manage labels

    Setup: Use a job template in an organization with at least one existing organization-scoped label. Ensure the template's launch configuration does not require labels at launch.

    1. Start Create Schedule for the job template.
    2. Confirm the Labels selector loads and is enabled only after the label list finishes loading.
    3. Select an existing label; create a new label by typing a name and choosing Create; remove one selected chip; then clear the complete label group.
    4. Select two labels, complete the wizard, and save.
    5. Reopen/edit the schedule and verify the same labels are preselected.
    6. Remove one label and save; reopen and verify only the retained label remains.
    7. Clear all labels and save; verify the schedule has no labels.

    Expected: Selection, creation, chip removal, full clear, persistence, and removal all work without duplicate labels or stale chips. The schedule detail page shows the saved labels.

    2. Job-template schedule with labels prompted at launch

    Setup: Use a job template with ask_labels_on_launch enabled.

    1. Create/edit a schedule and proceed through the prompt step.
    2. Verify the normal prompt label control is used and remains functional.
    3. Select labels, review the schedule, save, reopen, and verify the selected labels are retained.

    Expected: The schedule-specific selector does not appear in the wrong step, and labels are included in the review and persisted after saving.

    3. Workflow-job-template schedule labels

    Repeat test 1 with a workflow job template, including save, edit, removal, and schedule details.

    Expected: Workflow schedules use the correct workflow endpoint and label association behaves the same as job-template schedules.

    4. Existing schedule defaults are loaded correctly

    Setup: Existing schedule with non-default values: credentials, instance groups, labels, job/skip tags, survey answers, extra vars, and (where enabled) source-control branch.

    1. Open Edit Schedule.
    2. Verify all existing values are populated before editing.
    3. Change only one value, save, and reopen.
    4. Confirm unchanged values remain unchanged, especially labels, credentials, instance groups, tags, survey answers, and extra vars.

    Expected: Existing schedule-specific values take precedence over template defaults; an explicitly empty label selection remains empty rather than restoring template labels.

    5. Labels for a resource without an organization

    Setup: Use a schedule resource with no organization (including a job template whose organization is inherited/absent).

    1. Open the schedule wizard.
    2. Verify the warning that schedule labels cannot be created is shown.
    3. Verify the selector is disabled and cannot create or select labels.
    4. Complete/save the schedule without labels.

    Expected: No fabricated label is added, no save-time organization error occurs for an empty selection, and the rest of the schedule can still be saved.

    6. Label identity and API failure behavior

    Setup: Have duplicate label names across organizations, and use browser network throttling or a request blocker for GET /api/v2/labels/.

    1. Confirm unrelated-organization labels are not offered.
    2. Confirm duplicate names are distinguishable where they are displayed, and selecting/removing a chip affects the intended label.
    3. Make the labels request fail (403/500).
    4. Verify an inline error appears, the selector is disabled, and existing selected chips are not silently discarded.
    5. Restore the request and reload/retry.

    Expected: Label identity is stable, failures are visible, and the UI never creates a label from an incomplete label list.

    7. Large label set and save retry

    Setup: Schedule with 100+ associated labels (or a test environment/API fixture that can provide them).

    1. Edit the schedule and verify all pages of labels are loaded before the control becomes usable.
    2. Verify the informational 100-label warning is non-blocking.
    3. Save with a changed selection and inspect network requests: removals complete before additions.
    4. Force one label-add request to fail, then retry the save.

    Expected: All existing pages are considered, the warning does not block normal use, partial success is reported, and retry reconciles the remaining delta without duplicating successful additions.

    8. Schedule details and non-job schedule regression

    1. Open details for a job-template and workflow schedule with labels; verify labels are displayed.
    2. Open details for project, inventory-source, and system/management schedules.
    3. Verify those pages do not show an incorrect labels section or make an invalid labels request.
    4. Check source-control branch, credentials, recurrence, timezone toggle, rules, exceptions, and extra variables remain readable.

    Expected: Labels appear only for supported job/workflow schedules, while existing detail fields and timezone/rule behavior remain intact.

    9. Shared typeahead regression

    On any existing form using FormGroupTypeAheadMultiSelect:

    1. Select multiple values.
    2. Remove one chip, click the label-group clear affordance, and use the input clear button while typing a new filter.
    3. Verify keyboard navigation (Arrow keys, Enter, Escape) still works.

    Expected: Clearing the input does not clear selected values; clearing chips does, and the control remains keyboard accessible.

    Screenshots

    <img width="1317" height="799" alt="Screenshot From 2026-10-03 16-44-10" src="https://github.com/user-attachments/assets/a9ad22d4-eaf6-4049-b01d-c40d081d8fc3" />
    <img width="1317" height="799" alt="Screenshot From 2026-10-03 16-43-48" src="https://github.com/user-attachments/assets/04550d16-4a29-4625-86cb-017037f81c95" />
    <img width="1293" height="368" alt="Screenshot From 2026-10-03 16-43-27" src="https://github.com/user-attachments/assets/0e50cc8d-95cd-427c-88d8-e371bacaaa79" />
    <img width="1293" height="368" alt="Screenshot From 2026-10-03 16-43-07" src="https://github.com/user-attachments/assets/b4390353-2a48-46e4-aacb-7425ea404abb" />
    <img width="1307" height="345" alt="Screenshot From 2026-10-03 16-48-03" src="https://github.com/user-attachments/assets/28b963e9-800c-489f-a2f8-5a57255169dd" />

    Diff: 3544 lines (+2256 / -1288) across 32 files Reviewer: h-kataria Review duration: 18645m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.72) × (1 − Review Confidence (0.73)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.72 · 3544 lines diff across 32 files
    0.72
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.49 · 1 substantive comment(s)
    0.49
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    72%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Mass File Touch mass_file_touch
    0.080
    Reviewers
    Assignees
    demonpig demonpig
    Labels
    risk: low confidence: 72.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 71.5% (HIGH) · Higher = larger blast radius
    71.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 72.9% · Lower = rushed or shallow review
    72.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.4% · Safe to merge
    19.4%