Skip to content

gitignore: ignore Python bytecode from the tooling tests - #54

Merged
next-devin merged 1 commit into
mainfrom
gitignore-pycache
Sep 2, 2026
Merged

gitignore: ignore Python bytecode from the tooling tests#54
next-devin merged 1 commit into
mainfrom
gitignore-pycache

Conversation

@next-devin

Copy link
Copy Markdown
Contributor

What

make test and make verify-theme run the Python tooling suites, which leave tests/__pycache__/ and scripts/__pycache__/ behind. Neither was ignored, so every verification run left two untracked directories sitting in git status.

That's not just cosmetic: the habit of seeing two expected untracked entries is exactly what makes a third, unexpected one easy to skim past before a commit.

# Python bytecode from the tooling tests (`make test`, `make verify-theme`)
__pycache__/
*.pyc

One file, four lines.

Checks

Nothing already tracked becomes invisible. git ls-files | git check-ignore --stdin returns no matches, so the new patterns don't shadow anything in the index.

The directories are still created, just no longer reported. After make test, both tests/__pycache__ and scripts/__pycache__ exist on disk and git status --short shows only the .gitignore edit itself.

No CSS drift. Worth stating explicitly because it isn't obvious: Tailwind v4's content scan honours .gitignore, so editing that file can in principle change what compiles into assets/main.css. It doesn't here — bytecode was contributing nothing — and make css-drift passes unchanged at 49208 bytes. make verify-theme is green (55 tests).

🤖 Generated with Claude Code

`make test` and `make verify-theme` run the Python suites, which leave
tests/__pycache__/ and scripts/__pycache__/ behind. Neither was ignored, so
every verification run left two untracked directories in `git status` — noise
that makes a real stray file easy to miss before a commit.

No tracked file matches either pattern, so nothing already in the index becomes
invisible. Verified the CSS drift gate still passes at 49208 bytes: .gitignore
feeds Tailwind's content scan, and bytecode was contributing nothing to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@next-devin
next-devin marked this pull request as ready for review September 2, 2026 04:52
@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The change is a minimal, scoped .gitignore addition (.gitignore:20-23) covering __pycache__/ and *.pyc. The PR description's pre-merge checks are convincing: git ls-files | git check-ignore --stdin shows no tracked file matches the new patterns, and the CSS drift gate (make css-drift) still passes at 49208 bytes, confirming Tailwind's content scan behaviour was not affected. Patterns and placement follow existing file conventions.

Files Reviewed (1 file)
  • .gitignore - 0 issues

Reviewed by minimax-m3 · Input: 18.5K · Output: 1.5K · Cached: 143.1K

@next-devin
next-devin merged commit 6d84c98 into main Sep 2, 2026
2 checks passed
@next-devin
next-devin deleted the gitignore-pycache branch September 2, 2026 05:16
next-devin added a commit that referenced this pull request Sep 3, 2026
Bump the version markers in manifest.json, README.md, and CLAUDE.md, and
promote the Unreleased changelog section to a dated 1.3.0 heading. Adds
entries for the merged-but-unlogged changes since 1.2.0: the filter-argument
escape check (#52), the scoped Tailwind content scan (#53), and the
__pycache__ ignore (#54).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
next-devin added a commit that referenced this pull request Sep 3, 2026
)

* Render {% pixels %} in the base layout so app event trackers load

The platform injects every app's storefront event tracker (GA4, GTM,
Klaviyo, Taboola) as hidden iframes through the builtin {% pixels %} tag.
Intro Bootstrap reaches it indirectly through {% core_js %}; Spark replaced
core_js with spark-platform.js and never re-added pixels, so no tracker
iframe rendered, window.customerEventManager never existed, and no app
received any storefront event on Spark-based stores.

Add a `pixels` block before the theme script stack so the tag's fetch hook
is installed before spark-cart and friends make requests. Document the
block in the load-order contract, CLAUDE.md, and the changelog.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Release 1.3.0

Bump the version markers in manifest.json, README.md, and CLAUDE.md, and
promote the Unreleased changelog section to a dated 1.3.0 heading. Adds
entries for the merged-but-unlogged changes since 1.2.0: the filter-argument
escape check (#52), the scoped Tailwind content scan (#53), and the
__pycache__ ignore (#54).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* spark-cart: recover when the stored cart was consumed by checkout

Reproduced on aptest.29next.store on 2026-09-03 right after an order
completed: every addCartLines afterwards returned HTTP 200 with

  {"addCartLines":{"success":false,"errors":{"nonFieldErrors":
    [[{"message":"Cart not found.","code":"cart_not_found"}]]},"cart":null}}

and the shopper could not add anything until browser storage was cleared.

Two things combined. The consumed cart id stays in sessionStorage and the
storefront_cart_id cookie because the order-confirmation page is rendered by
the platform, not the theme, so nothing on the theme side ever ran to forget
it. And addToCart only recovered when the request *rejected* and the message
matched isCartExpiredError; this payload resolves, so the .then branch handed
back success:false and the create-and-retry path never ran.

- isCartNotFoundResult() recognises the resolved shape (code cart_not_found,
  or a message matching the existing expired-cart heuristic, at any depth of
  the errors object).
- addToCart settles the request into an outcome first, then recovers exactly
  once for either a rejection or a resolved cart_not_found: clear the stored
  id, createCart, retry with recover=false. A failure inside the retry cannot
  re-enter the recovery branch.
- getCart clears the stored id when the platform returns cart:null or a
  not-found error. Badge hydration calls this on the first storefront page
  after confirmation, so the stale id is gone before the shopper's next add.
- updateCartLines, removeCartLines, addVoucher, removeVoucher clear the id on
  cart_not_found without recreating (the caller is editing a cart it believes
  exists), so a stale id cannot leak into the next add.
- clearCartId() removes the sessionStorage key and expires the cookie.

Tests: the exact aptest payload on the first add asserts createCart and a
second addCartLines follow with the new id stored; a second miss returns the
platform answer without looping; getCart null/reject and each explicit-id
mutation clear the stored id and dispatch nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* spark-cart: only a cart_not_found code or "cart … not found" marks a resolved result

Review finding on #55: isCartNotFoundResult fell back to isCartExpiredError,
whose substring match on "invalid" would have flagged ordinary resolved
validation errors ("Invalid quantity", "Invalid voucher code") as a missing
cart and wiped a live cart id. Resolved results now count only the
cart_not_found code or a message naming the cart as not found; the broad
matcher stays on the rejection path where it started. Regression test covers
an add, a voucher, and a line update that each fail validation with "invalid"
in the message and assert no recreate and the id kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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