Skip to content

Settings contract tests: follow MonitorLink into the API page's access group - #15500

Merged
danielhanchen merged 1 commit into
mainfrom
ci-monitor-link-contracts
Oct 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-monitor-link-contracts

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Repo tests (CPU, studio) fails on main since #15467, so every PR based on it inherits two failures (#15482 today):

tests/studio/test_settings_compact_overflow_contract.py::test_settings_monitor_link_can_shrink
E   assert '<SettingsSection title={t("settings.resources.liveMonitor.apiTitle")}>' in '...'
tests/studio/test_usage_examples_model_source_contract.py::test_auto_switch_section_sits_below_the_monitor_link
E   ValueError: substring not found

Bisected locally: both pass at 9fb0221~1 and fail from 9fb0221 (#15467) onwards.

Product or test

The tests. #15467 reorganised the API page on purpose:

  • MonitorLink takes hideHeading. Its SettingsSection keeps the same title, now with a second prop on its own line.
  • The API tab renders <MonitorLink hideHeading={true} /> inside a new titled <SettingsSection title="Access & monitoring">.
  • The usage examples now render inside ApiExamplesPanel.

Both tests matched the old spellings: the one-line <SettingsSection title={...}>, the bare <MonitorLink /> and <UsageExamples. The invariants they guard still hold on main:

  • the monitor never lands as a bare card among other sections
  • the examples come before the monitor link, which comes before auto-switch

Fix

  • test_settings_monitor_link_can_shrink:
    • checks that MonitorLink renders its own SettingsSection titled settings.resources.liveMonitor.apiTitle, whatever other props it takes
    • new: wherever a settings page renders <MonitorLink hideHeading ...>, it must sit inside an open, titled SettingsSection
  • test_auto_switch_section_sits_below_the_monitor_link: same order (UsageExamples or ApiExamplesPanel, then MonitorLink, then ModelAutoSwitchSection), matched by tag name instead of exact spelling.

Verification

  • Both files: 22 passed (2 failed on main).
  • Sabotage on main's sources, one at a time, each fails:
    • <MonitorLink hideHeading={true} /> moved out of its SettingsSection
    • <ModelAutoSwitchSection /> removed
    • the monitor section title changed
  • ruff format and check are clean.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T05:25:46.562943Z b0dcf7a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: b0dcf7ae42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8a1edb4 into main Oct 27, 2026
0 of 15 checks passed
@danielhanchen
danielhanchen deleted the ci-monitor-link-contracts branch October 27, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant