Skip to content

CI: target 90% fewer job-minutes, with full coverage assured before release #14597

Backlog

Description

@dsyme

Describe the issue

Scope clarification (2026-11-27): The primary 10% objective is GitHub-hosted job-minutes only. All-runner figures below are secondary context, not valid toward that target. The initial hosted baseline is 3,320,099 minutes per 7 days = 474,300 job-min/day, with a provisional 10% ceiling of 47,430/day. The older-run rerun audit hosted portion is not yet classified, so both hosted figures remain provisional.

BCApps can improve contributor feedback and reduce CI compute by avoiding repeated compilation and certification work. Two public runs show where to start:

  • A release/29.x push build used about 2,663 job-minutes, 96% in Compile Apps.
  • A main nightly used about 25,727 job-minutes, about 22,767 in test-project jobs. Most of that time is in a coarse Build step; we don't yet know how much is setup, publishing, or test execution.

These are sums of elapsed job time, not workflow wall time or billed minutes. The samples help prioritize investigation; they are not the repository-wide baseline.

Expected behavior

Goal: bring GitHub-hosted CI usage to at most 10% of the frozen GitHub-hosted baseline, measured in elapsed job-min/day, on a comparable workload. Count all GitHub-hosted workflows and runner sizes, including failed and cancelled jobs, retries, forced fresh runs and actual reruns, but exclude self-hosted jobs from the primary denominator. Track self-hosted job-min/day separately as a secondary compute metric. Report PR feedback time separately so a reduction in compute does not hide slower contributor feedback.

Not every country, test mode and check needs to run on every PR. Full coverage must be assured before release, but how much runs per PR, per merge and per nightly is a balance to find: run broadly where it's cheap, and defer to merge or pre-release certification where it isn't. Maintainers agree how long a regression may go undetected and what must pass before release. The 90% reduction is a target to validate, not a forecast.

Campaign baseline

  • Frozen pre-change window: 2026-11-17 22:26:32 UTC through 2026-11-24 22:26:32 UTC (start inclusive, end exclusive). This is the seven-day window already sampled before the first tracked CI change merged.
  • Denominator: Average elapsed GitHub-hosted job-minutes per day. Sum in-window runner time, count parallel jobs separately, and divide by seven days. Include GitHub-hosted successful, failed and cancelled jobs that ran, actual reruns, diagnostics and forced fresh runs. Exclude self-hosted jobs, queue time, skipped jobs, jobs that never got a runner, and prior jobs carried forward into rerun results. Track self-hosted job-min/day separately. These are elapsed job-minutes, not workflow wall time, vCPU-minutes, or billed minutes.
  • Source and current status: The initial frozen-window collection has 3,320,099 GitHub-hosted minutes / 7 = 474,300 hosted job-min/day. Runner records classify 14,312,529 minutes (81.2%; 2,044,647/day) as Default/GitHub-BCAppsPL self-hosted work and 3,320,099 minutes (18.8%; 474,300/day) as GitHub-hosted work. The initial collection covers 9,684 runs and 159,207 job-attempt records. A 90-day rerun audit found 32 older-created workflow runs whose latest attempt started in the frozen week; these add 356,457 minutes / 7 = 50,922 job-min/day across all runner pools, but their GitHub-hosted portion has not yet been classified. Therefore the hosted baseline and 47,430/day provisional 10% ceiling need that rerun split before they are final. The previous all-runner revised baseline was 2,569,869 job-min/day; retain it only as a secondary metric, not as the target denominator.

Initial GitHub-hosted workload (provisional)

Trigger/workload Hosted job-min/day
Pull requests 328,006
Pushes 80,669
Workflow dispatch 39,606
Merge queue 21,722
Other triggers 4,298
Initial hosted total 474,300

Within Pull Request Build, hosted Default Apps jobs used 147,106/day, hosted Clean Apps jobs 120,593/day, and other jobs 60,062/day. The all-runner PR path cohort table below still needs hosted-only reclassification.

  • After rollout: Use the same GitHub-hosted accounting on a complete seven-day window that includes the weekly full-validation cycle. Report self-hosted job-min/day alongside it, and compare incoming PR revisions, pushes/merges, and release activity so a quieter week is not mistaken for a CI saving. Reduction is 1 - (after hosted job-min/day / hosted baseline job-min/day); the target is after hosted job-min/day ≤ 10% of the hosted baseline on a comparable workload. Track PR feedback time separately.

Baseline PR workload (all-runner context; hosted reclassification pending)

The table below is from the prior all-runner analysis. Its cohort values and projections do not count toward the GitHub-hosted target until reclassified by runner group.

The initial hosted collection implies a provisional ceiling of 47,430 hosted job-min/day, down from 474,300 hosted job-min/day. The older-run rerun hosted share is still pending. The previous 256,987/day ceiling and the following all-runner PR breakdown are superseded for the primary objective; hosted PR/test/build contributions must be reclassified before setting a hosted budget.

Paths changed (PR-triggered runs) Runs in frozen week Baseline job-min/day Share of this subtotal Research probe
W1 apps, no country apps or layers 284 804,755 34.9% #14606
W1 layer, including PRs that also touch other layers 271 814,612 35.4% #14633 (W1-only example)
Changes include build/ or .github/ 149 286,876 12.5% #14631 implementation run
Country apps, no W1 apps or layers 65 191,764 8.3% #14632 (DE example)
Country layers, no W1 layer 30 93,893 4.1% Not yet run
Other paths (e.g. System Application or tests) 36 91,564 4.0% Not yet run
W1 and country apps, no layers 8 19,882 0.9% Not yet run
Subtotal 843 2,303,346 100%

This table covers the PR-triggered runs in the initial collection, including runs that consumed no runner time. Each run is counted once, with minutes clipped to the frozen window. We matched the 150 previously unlinked runs to PRs by head branch and fetched their current PR file lists; the only branch reused by multiple PRs contributed no job-minutes. This removes the prior “No PR confidently matched” row; it does not reduce costs or count as savings. Add 21,722 job-min/day for merge-group runs in the initial collection and 50,922 job-min/day from the older-run PR Build rerun audit to reconcile to 2,375,990 job-min/day. The earlier untrimmed PR subtotal of 2,315,589 included time outside the window. Path categories use current PR file lists, which can differ from the diff at an earlier run's SHA.

W1 app and W1 layer changes together account for 70.3% of the PR-triggered subtotal. W1 changes can expand to every country because country projects include the W1 apps; layer changes also trigger the full-test fallback. Those are distinct causes, so country scoping alone does not solve the layer case.

Implementation slate

The slate and traffic-weighted scenarios below were originally evaluated across all runner pools. Recalculate their savings against GitHub-hosted jobs before crediting them toward the 10% objective; keep self-hosted savings as a secondary measure.

Change Status and what to measure
Run only affected test apps on PRs. Restore dependency-based selection and derive the PR diff from the tested merge commit when available, instead of treating base-branch drift as a PR change. #14630, open. Probe Unit Tests jobs ran on self-hosted GitHub-BCAppsPL workers, so treat test-selection savings as secondary compute unless future measurement shows hosted runner reduction. Keep full testing on non-PR events.
Build W1 plus touched countries on PRs; defer Clean app compilation to post-merge. Drop legacy modes when no selected app needs them, while keeping Clean on post-merge/release builds. Hosted PR Clean Apps jobs alone used 120,593 job-min/day in the frozen week. #14631, open and stacked on #14630; 11 focused Pester tests pass. External Work Item Validation requires issue #14629 to receive its approved label; no issue workflow label was changed. Run 45885346833 had two attempts, 6,531.3 job-min combined (485.1 hosted, 6,046.2 self-hosted); attempt 2 used 3,273.5. No Apps Clean jobs ran. The run exercises the CI/build-script changes themselves; post-merge/release validation remains pending.
Reduce the W1 layer PR gate and avoid empty test jobs. Try a targeted smoke/test profile for base-layer changes instead of running every W1 legacy bucket on each revision. Omit Test Apps projects at matrix construction when the known affected-app set is empty; retain them for unknown diffs, full-build patterns, and build-settings changes. Empty-project omission is implemented in #14631; 11 focused tests pass, but no representative hosted-savings sample exists yet. A targeted W1 layer profile remains proposed: compare it with #14633, check historical failures, and run the complete suite on the agreed post-merge/pre-release cadence.
Narrow CI-only validation without dropping checks for CI changes. Try PowerShell, workflow, and configuration checks alone for files that cannot affect builds; run targeted country sentinels when common build logic actually changes. Fix over-selection from stale comparisons in AL-Go's own compile path and use the tested merge-SHA diff rather than current PR files when assigning paths to a run. Proposed follow-up PRs. Add a CI-only probe; the previously unlinked high-cost runs are now mapped to PR branches, but current PR file lists can differ from the run-time diff.
Build incrementally on pushes; reuse equivalent work. Compile shared inputs once and reuse trusted immutable build outputs or test preparation across modes or workflows when inputs, environment and validation policy match. #14577 merged. Successful main push run 45882249122 used 2,658 all-runner job-minutes (2,633 Apps-build minutes; 21 Clean App jobs; no Unit Tests). One run is not a daily saving; compare a full post-change week. Follow up on shared compilation and Default/Clean duplication. #14513 (skip redundant analyzers in the temporary Clean pass) and #14514 (faster preprocessor scan) are already merged.
Stop daily full stability on every supported branch. Keep daily validation on main and applicable releases/*.x, with a full Monday matrix and on-demand validation. #14576, open. Measure a full week including Monday; count release certification and investigate repeated stability failures.
Revisit merge-queue country compilation only if needed. #14583 is a separate W1-only draft, not a booked saving. Removing country compilation both on PRs and at merge requires an agreed replacement for country feedback and full pre-release coverage.

Research results so far (updated 2026-11-27)

Probe (do not merge) What Initialization selected All-runner job-min GitHub-hosted job-min
#14606 — W1-only BankDeposits change No extra countries; 3 affected apps; both legacy buckets omitted 348.1, success; 2 jobs skipped 144.1
#14632 — DE-only IntrastatDE change W1 + DE; 2 affected apps; both legacy buckets omitted 779.9, success; 2 jobs skipped 290.1
#14633 — W1 BaseApp layer change W1 only; full-test fallback, all five modes including legacy buckets retained 1,154.3, success; 2 jobs skipped 152.9

In all three probes, Unit Tests jobs ran on self-hosted GitHub-BCAppsPL workers, while Apps and System Application build jobs ran on GitHub-hosted runners. Thus affected-test selection primarily reduces secondary self-hosted compute; the hosted objective depends more directly on scoping hosted compile matrices and deferring hosted Clean work.

These three classes account for about 78.6% of the PR-triggered subtotal, but one example per class is not a cohort average. All three probes succeeded. Their hosted portions were 144.1, 290.1 and 152.9 job-min respectively. The all-runner totals were #14606 348.1 job-min against a historical W1-app average of 19,835.5 job-min/run; #14632 used 779.9 against a country-app average of 20,651.5; #14633 used 1,154.3 against a W1-layer average of 21,041.6. If each probe represented its cohort, weighting by baseline traffic would project 14,123 job-min/day for W1-app PRs, 7,242 for country-app PRs, and 44,688 for W1-layer PRs. Together those cohorts would move from 1,811,131 to 66,053 job-min/day, an illustrative reduction of 1,745,078 job-min/day (96.4%). This is not an achieved saving: it is one probe per class, actual changes vary, and deferred checks must be charged to their later workflow.

The CI-path cohort was 286,876 all-runner job-min/day across 149 runs. The #14631 implementation run had two attempts, 6,531.3 all-runner job-min combined (485.1 hosted, 6,046.2 self-hosted); attempt 2 used 3,273.5. Its multi-file build-script diff triggers fullBuildPatterns and is not a representative empty-matrix sample. The earlier 69,679/day CI-cohort projection and 135,732/day four-cohort projection are all-runner scenarios only, not hosted projections.

The previous all-runner scenario required removing 2,312,882 job-min/day and left a 350,607/day scenario gap; both figures are superseded for the hosted-only target. The hosted target currently implies reducing at least 426,870 hosted job-min/day from the initial collection, before adding the hosted share of older-run reruns. The one-run-per-class projections are not achieved savings; deferred checks must be charged to the workflow that runs them.

The probes exclude the stack's own CI edits from the test/country selector only; AL-Go's compile selection can still see those edits and rebuild more than a normal app-only PR. The earlier W1 + CZ compile-only control completed in about 274 elapsed job-minutes for that run. It did not include the unit-test matrix and cannot establish daily savings. The earlier W1 test attempt was cancelled before the test jobs. A separate full-matrix comparison, run 45877155435 on #14630, completed in two attempts: 25,394.4 and 25,733.0 job-min (164 jobs each), for 51,127.4 job-min total. Attempt 1 had three failed jobs; attempt 2 succeeded. This is not a controlled A/B, but contrasts with the scoped #14631 run's 3,273.5 job-min and shows why retries must remain in the ledger.

Previous all-runner budget (superseded for the primary target)

The following working daily caps allocated the old all-runner ceiling. They are retained as historical context only and must be replaced by a GitHub-hosted-only budget after the old-run rerun split and hosted workload reclassification.

Area Working cap (job-min/day)
PR-triggered builds and tests, including retries, cancellations and forced-full runs 150,000
Merge queue 22,000
Push CI/CD after incremental builds 40,000
Stability, including weekly full validation and deferred/release coverage 35,000
Other workflows 9,000
Total 256,000

The 150,000 job-min/day PR cap implies a 93.6% reduction against the 2,354,268 job-min/day PR-triggered plus older-run PR rerun subtotal; merge-group work is budgeted separately. This is more aggressive than a 90% PR reduction because non-PR work also consumes the total budget.

There is only about 987 job-min/day of headroom in this allocation. At 170,000 job-min/day for PRs, the same remaining allocations produce 276,000 job-min/day: about 19,000 job-min/day over target. If the budget is missed, prioritize a cheaper base-layer gate and eliminating empty test jobs before narrowing merge-queue coverage. Reallocate the caps against evidence rather than treating any line as an achieved saving.

Next: split the older-run rerun audit by runner group; compute hosted-only PR, merge_group, push and scheduled baselines; reclassify each optimization measured savings against GitHub-hosted usage; then set a hosted-only budget and obtain comparable seven-day validation including full release coverage. Continue reporting all-runner job-min/day as a secondary metric. Report PR feedback latency and time to catch deferred regressions separately. A release must have evidence that its candidate passed the full required country/test matrix, whether via equivalent prior results or a fresh run before release. The campaign succeeds only when both the hosted daily ceiling and that release requirement are met.

Related: #14512.

Activity

  1. added
    Team: Integrations
    on Nov 26, 2026
  2. github-actions commented on Nov 26, 2026

    @github-actions
    Contributor

    🤖 AI triage completed. Product group, please validate the triage report (Microsoft internal access only, use Ctrl+Click to open in new tab).


    Was this triage helpful? React with 👍 or 👎 on this comment to provide feedback.

  3. changed the title [-]CI: target 90% fewer job-minutes while preserving required coverage[/-] [+]CI: target 90% fewer job-minutes, with full coverage assured before release[/+] on Nov 26, 2026
  4. dsyme commented on Nov 26, 2026

    @dsyme
    ContributorAuthor

    Slate to reach 10% (all figures in job-min/day)

    Baseline is 2,569,869. Target is ≤ 256,987.

    # Change PR Baseline Projected
    1 PR builds: W1 + touched countries only. Infra changes run DE+US sentinels. Legacy buckets only if affected #14631 (#14629) 2,217k (full-matrix PRs) ~600k
    2 PR builds: run only affected test apps (re-wire #7392 selection, merge-commit diff) #14630 (#14628) (within 1) ~170k all PR runs
    3 Incremental builds on push #14577 ~80k ~40k
    4 Stability: main daily, release branches weekly #14576 (needs tweak) ~110k ~35k
    5 Merge queue: keep all-country compile as the pre-merge country guard #14583: recommend not merging 22k 22k
    Misc ~5–10k
    Total 2,570k ~270k (~10.5%)

    Coverage before release comes from the merge-queue all-country compile, post-merge CI/CD, and stability runs. A full-country-matrix label opts a PR into the full matrix.

    If measurement falls short, further levers include: drop country compile from PRs and rely on the merge queue (~-40k → ~8%), reduce failed-run reruns (failed PR runs = 469k/day at baseline), and trim CI/CD push builds.

    Measurement: research PR #14606 now carries #14630 + #14631 and runs one PR class per probe. Probe 1 is W1-app-only. #14631 itself is a live sample of the infra class. Results will be posted here.

  5. aholstrup1 commented on Nov 27, 2026

    @aholstrup1
    Contributor

    Source and current status: The initial GitHub Actions API collection found 17,632,628 elapsed job-minutes over seven days

    Don Syme (@dsyme) This includes both GitHub-hosted and self-hosted runner minutes though. 80% of this is already running on our own infrastructure. Is the goal of this issue to reduce the overall compute (self-hosted and github-hosted) to 10% of what is now? Or just the GitHub hosted minutes? My understanding was the latter.

    Both are worth optimizing, but they’re different objectives. A separate baseline and savings breakdown for each would help us prioritize the right changes. For example, a PR like #14630 is very nice (and something we should do), but it would not reduce the amount of GitHub Action minutes as testing already runs on self-hosted infrastructure.

  6. dsyme commented on Nov 27, 2026

    @dsyme
    ContributorAuthor

    Status: hosted-only objective and empty Test Apps optimization

    • The primary target is now GitHub-hosted minutes only, as confirmed by the user. The previous all-runner budget and projections are not valid against this target and will be reworked.
    • PR CI: scope PR builds to W1 and touched countries #14631 includes commit 483cb65: omit all Test Apps projects from a PR matrix only when the diff is known, no affected apps are found, and build settings are unchanged. Unknown/full-build fallbacks and build-settings changes retain Test Apps. Focused Pester suite: 11/11 passed. No daily saving is credited: the PR's own build/scripts diff triggers fullBuildPatterns, so its CI run does not exercise the empty-matrix path.
    • Reclassified initial frozen-window runner records (17,632,628 elapsed job-minutes over 7 days = 2,518,947/day): Default/GitHub-BCAppsPL (custom self-hosted label) 14,312,529 min (81.2%; 2,044,647/day); GitHub Actions/standard hosted labels 3,320,099 min (18.8%; 474,300/day). No minutes remain unclassified after grouping the custom label with self-hosted.
    • The provisional initial-collection GitHub-hosted baseline is therefore 474,300 job-min/day, with a provisional 10% ceiling of 47,430/day. The older-run rerun audit adds 356,457 minutes across all pools (50,922/day), but its hosted portion is not yet split; the final hosted-only denominator and ceiling remain pending that reconciliation.
    • Hosted-only levers are material: hosted PR Clean Apps jobs alone used 120,593 job-min/day in the frozen week; hosted PullRequestHandler and CICD workflows used 349,483/day and 120,213/day respectively. The PR clean deferral and incremental push work may reduce hosted use, but deferred work must be charged to the workflow that runs it.

    Next: split the older-run reruns by runner class, recast the cohort table and budget using hosted minutes only, and measure comparable hosted-only weekly usage. Keep all-runner job-min/day as a secondary compute metric.

  7. dsyme commented on Nov 27, 2026

    @dsyme
    ContributorAuthor

    Status (2026-11-27): after restoring Fixes #14629 on #14631, Work Item Validation ran again (run 45987606291) and still failed: The following issues are not open or approved: 14629. The PR link is now present and recognized; the remaining gate is that #14629 needs the repository-required approved label. I have not changed issue labels or requested a privileged rerun. The hosted baseline is still provisional pending runner-group classification of the 356,457 older-run rerun minutes.

  8. dsyme commented on Nov 27, 2026

    @dsyme
    ContributorAuthor

    Research probe closeout

    Closed #14606, #14632, and #14633 without merging. All three Pull Request Build probes succeeded. The results above are the measurements of record: 144.1, 290.1, and 152.9 GitHub-hosted job-min per run, respectively. W1 app changes stayed on W1, DE app changes ran W1 + DE, and the W1 base-layer change stayed on W1 but retained all test modes. Test jobs in these probes ran on self-hosted runners.

    These runs verified the intended matrix behavior for those examples, not daily savings, production coverage, or the 90% target. They used one example per class on an older research stack, with no same-change full-matrix control. The production PRs remain separate: #14631 has been rebased onto main and no longer depends on #14630.

    Remaining validation belongs with the production changes: finish the hosted rerun accounting, validate scoped behavior on representative changes (including CI/config or mixed-country diffs where needed), and compare a representative post-rollout week against the hosted baseline. Charge deferred work where it runs and verify the full required country/test matrix before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team: Integrations

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions