Skip to content

Conversation

@AlexWaygood
Copy link
Member

Summary

Some of our ty snapshots (in particular, several in the ty_ide crate that relate to autocompletions) are very sensitive to changes in typeshed. If typeshed changes the line number a class or function is defined on, that often leads to the snapshots in ty_ide needing to be updated manually before a typeshed-sync PR can be merged, which is a bit of a pain.

This PR adds a step to the sync_typeshed.yaml workflow that checks for changes to snapshots and automatically accepts them all before the PR is made. This should hopefully reduce the number of changes we need to make manually to sync-typeshed PRs. (We'll still need to review these PRs carefully to check that all the changes to the snapshots are desirable, but I still think that this will probably save us time overall.) The step is allowed to fail; if checking for changes to snapshots produces a nonzero exit code, the sync-typeshed PR should still be filed.

The cargo insta docs are here: https://insta.rs/docs/cli/

Test Plan

I:

  1. Ran git checkout dc64c086336148c57db14060c86f448351710b2e -- crates/ty_python_semantic/resources/mdtest/snapshots. This reverted all the snapshot changes from [ty] Filter out revealed-type and undefined-reveal diagnostics from mdtest snapshots #20820, a PR which resulted in lots of snapshot changes -- multiple snapshot changes per mdtest file, in some cases.
  2. Ran cargo insta test --accept. I observed that this command reverted all changes from step (1).

@AlexWaygood AlexWaygood requested a review from sharkdp October 15, 2025 13:51
@AlexWaygood AlexWaygood added ci Related to internal CI tooling ty Multi-file analysis & type inference labels Oct 15, 2025
@AlexWaygood AlexWaygood changed the base branch from main to alex/snapshots-merge-race October 15, 2025 14:17
@AlexWaygood AlexWaygood reopened this Oct 15, 2025
Base automatically changed from alex/snapshots-merge-race to main October 15, 2025 14:21
@AlexWaygood

This comment was marked as resolved.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome idea.

@AlexWaygood AlexWaygood force-pushed the alex/sync-typeshed-snapshots branch from 59dcd49 to b9c2375 Compare October 15, 2025 14:52
@AlexWaygood AlexWaygood force-pushed the alex/sync-typeshed-snapshots branch from b9c2375 to 6b62346 Compare October 15, 2025 14:54
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Oct 15, 2025

I kicked off a test run here using this branch: https://github.com/astral-sh/ruff/actions/runs/18533177734

@AlexWaygood AlexWaygood force-pushed the alex/sync-typeshed-snapshots branch from 11f005f to e7b81ae Compare October 15, 2025 16:09
@AlexWaygood
Copy link
Member Author

I kicked off a test run here using this branch: astral-sh/ruff/actions/runs/18533177734

It took a few iterations but I think it all looks good now:

@AlexWaygood AlexWaygood merged commit 4b7f184 into main Oct 15, 2025
64 of 65 checks passed
@AlexWaygood AlexWaygood deleted the alex/sync-typeshed-snapshots branch October 15, 2025 16:37
dcreager added a commit that referenced this pull request Oct 16, 2025
…rable

* origin/main:
  Don't use codspeed or depot runners in CI jobs on forks (#20894)
  [ty] cache Type::is_redundant_with (#20477)
  Fix run-away for mutually referential instance attributes (#20645)
  [ty] Limit shown import paths to at most 5 unless ty runs with `-v` (#20912)
  [ty] Use field-specifier return type as the default type for the field (#20915)
  [ty] Do not assume that `field`s have a default value (#20914)
  [ty] Fix match pattern value narrowing to use equality semantics (#20882)
  Update setup instructions for Zed 0.208.0+ (#20902)
  Move TOML indent size config (#20905)
  [syntax-errors]: implement F702 as semantic syntax error (#20869)
  [ty] Heterogeneous unpacking support for unions (#20377)
  [ty] refactor `Place` (#20871)
  Auto-accept snapshot changes as part of typeshed-sync PRs (#20892)
  [`airflow`] Add warning to `airflow.datasets.DatasetEvent` usage (`AIR301`) (#20551)
  [`flake8-pyi`] Fix operator precedence by adding parentheses when needed (`PYI061`) (#20508)
  [`pyupgrade`] Fix false negative for `TypeVar` with default argument in `non-pep695-generic-class` (`UP046`) (#20660)
  Update parser snapshots (#20893)
  Fix syntax error false positives for escapes and quotes in f-strings (#20867)
dcreager added a commit that referenced this pull request Oct 16, 2025
…nt-sets

* dcreager/non-non-inferable:
  Don't use codspeed or depot runners in CI jobs on forks (#20894)
  [ty] cache Type::is_redundant_with (#20477)
  Fix run-away for mutually referential instance attributes (#20645)
  [ty] Limit shown import paths to at most 5 unless ty runs with `-v` (#20912)
  [ty] Use field-specifier return type as the default type for the field (#20915)
  [ty] Do not assume that `field`s have a default value (#20914)
  [ty] Fix match pattern value narrowing to use equality semantics (#20882)
  Update setup instructions for Zed 0.208.0+ (#20902)
  Move TOML indent size config (#20905)
  [syntax-errors]: implement F702 as semantic syntax error (#20869)
  [ty] Heterogeneous unpacking support for unions (#20377)
  [ty] refactor `Place` (#20871)
  Auto-accept snapshot changes as part of typeshed-sync PRs (#20892)
  [`airflow`] Add warning to `airflow.datasets.DatasetEvent` usage (`AIR301`) (#20551)
  [`flake8-pyi`] Fix operator precedence by adding parentheses when needed (`PYI061`) (#20508)
  [`pyupgrade`] Fix false negative for `TypeVar` with default argument in `non-pep695-generic-class` (`UP046`) (#20660)
  Update parser snapshots (#20893)
  Fix syntax error false positives for escapes and quotes in f-strings (#20867)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants