Skip to content

Refactor Runner base class: rename run_multiple→run_trials, add stage_trials/stop_trial/stop_arms/poll_run_metadata/apply_status_change_side_effects, deprecate run/poll_exception/stop#5094

Closed
lena-kashtelyan wants to merge 1 commit intofacebook:mainfrom
lena-kashtelyan:export-D97842794

Conversation

@lena-kashtelyan
Copy link
Copy Markdown
Contributor

Summary:
Refactors the core Runner base class per the E2E Automation design doc:

Renamed/restructured methods:

  • run_multiplerun_trials (kept run_multiple as deprecated wrapper)
  • stopstop_trial (kept stop as deprecated fallback)
  • run is no longer abstract; run_trials default implementation calls it for backward compat

New methods added:

  • stage_trials(trials) — does nothing by default, override for staging
  • stop_arms(trial, arm_names, reason) — stop specific arms in a trial
  • poll_run_metadata(trials) — update run metadata from actual deployment
  • apply_status_change_side_effects(trials) — dedicated place for status-change side effects

Deprecated methods (to be removed after runner migration):

  • run(trial) — override run_trials instead
  • poll_exception(trial) — fold into poll_trial_status
  • stop(trial, reason) — override stop_trial instead
  • run_multiple(trials) — use run_trials instead

Differential Revision: D97842794

…_trials/stop_trial/stop_arms/poll_run_metadata/apply_status_change_side_effects, deprecate run/poll_exception/stop

Summary:
Refactors the core Runner base class per the E2E Automation design doc:

**Renamed/restructured methods:**
- `run_multiple` → `run_trials` (kept `run_multiple` as deprecated wrapper)
- `stop` → `stop_trial` (kept `stop` as deprecated fallback)
- `run` is no longer abstract; `run_trials` default implementation calls it for backward compat

**New methods added:**
- `stage_trials(trials)` — does nothing by default, override for staging
- `stop_arms(trial, arm_names, reason)` — stop specific arms in a trial
- `poll_run_metadata(trials)` — update run metadata from actual deployment
- `apply_status_change_side_effects(trials)` — dedicated place for status-change side effects

**Deprecated methods (to be removed after runner migration):**
- `run(trial)` — override `run_trials` instead
- `poll_exception(trial)` — fold into `poll_trial_status`
- `stop(trial, reason)` — override `stop_trial` instead
- `run_multiple(trials)` — use `run_trials` instead

Differential Revision: D97842794
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 24, 2026

@lena-kashtelyan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97842794.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.29%. Comparing base (6e527d5) to head (50a988c).

Files with missing lines Patch % Lines
ax/core/runner.py 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5094      +/-   ##
==========================================
- Coverage   96.30%   96.29%   -0.01%     
==========================================
  Files         611      611              
  Lines       67534    67566      +32     
==========================================
+ Hits        65040    65066      +26     
- Misses       2494     2500       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@saitcakmak saitcakmak closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants