gstack-pregate now finds the tests for your Python files

1 month ago

gstack 1.91.131.0 to 1.91.132.0: gstack-pregate follows Python imports to pick the pytest files a change reaches, a checkout without node_modules reports missing dependencies instead of stale files, the gstack repo's test tier clears on one Ubicloud VM in about 7 minutes, and gstack-next-version reads open PRs' claims in parallel.

Ask about this presentation

Chapters

Show transcript
  1. gstack-pregate now follows Python imports, so a changed module picks the pytest files that import it. In one FastAPI service, unmapped modules fell from almost fifteen hundred to 780.

    Slide text
    gstack logo

    gstack-pregate now finds the tests for your Python files

    from app.billing import charge app/billing.py
    from . import utils relative to the package
    1,473
    unmapped modules before, in a FastAPI service
    780
    unmapped now, mostly migrations and scripts
    Python Deps Remote gate Fixes Your repo
    garrytan/gstack · CHANGELOG.md 1.91.131.0 · #3201, thanks @scottgigante-hubflow
  2. A fresh checkout without node_modules used to report stale generated files and send you to rerun the generator. Now the pre-gate says dependencies are missing, prints the install command, and marks the check incomplete.

    Slide text

    A checkout without node_modules now says dependencies are missing

    Before REGEN_STALE
    Now, with the install command to run REGEN_DEPS_MISSING
    The check reports incomplete until dependencies are installed.
    Python Deps Remote gate Fixes Your repo
    garrytan/gstack · CHANGELOG.md 1.91.131.0
  3. In the gstack repo, a machine under eight cores now clears the test tier on one Ubicloud VM, in about seven minutes for six cents. Locally, a smaller set took about an hour. Without a key, it shards the run locally.

    Slide text

    In the gstack repo, a small machine clears the test tier on one Ubicloud VM

    7 min
    all 1,280 free test files on one VM, for $0.06
    59 min
    798 files run locally on 4 cores
    Without an API key it runs the same files locally in parallel shards.
    Python Deps Remote gate Fixes Your repo
    garrytan/gstack · CHANGELOG.md 1.91.132.0
  4. Picking the next version now reads open pull requests in parallel, about half a second for eight. A claim it can't read marks the pick provisional, so rerun before stamping. And the Python scanner stays fast on hostile input.

    Slide text

    Version picks run faster and flag a claim they couldn't read

    gstack-next-version fetches open PRs' claims in parallel: 8 PRs in about 0.5 s, down from 4.2 s1.91.132.0
    An unreadable claim marks the pick provisional with complete: false, and gstack-restamp reports claims: incomplete 1.91.132.0
    The Python scanner stays linear on hostile input and keeps the imports after an escaped triple quote1.91.131.0
    Python Deps Remote gate Fixes Your repo
    garrytan/gstack · CHANGELOG.md 1.91.132.0 · 1.91.131.0
  5. Some Python setups still need declarations: conftest.py files, src layouts and importlib calls. So, does your Python repo use a src layout, or packages at the root?

    Slide text

    Does your Python repo use a src layout, or packages at the root?

    conftest.py, src/ layouts and importlib calls still need dependencies declarations in .gstack/pregate.json.
    CHANGELOG.md "If you…" notes for both releases
    docs/pregate.md remote gate and its refusal codes
    Python Deps Remote gate Fixes Your repo
    garrytan/gstack · CHANGELOG.md 1.91.131.0 · 1.91.132.0

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York