Skip to content

test(etl): stub Groups::Connector in sync_all rake test#139

Open
billie-clawford-stacksbot[bot] wants to merge 1 commit into
mainfrom
stacksbot/auto-fix-groups-etl-embedding-attr
Open

test(etl): stub Groups::Connector in sync_all rake test#139
billie-clawford-stacksbot[bot] wants to merge 1 commit into
mainfrom
stacksbot/auto-fix-groups-etl-embedding-attr

Conversation

@billie-clawford-stacksbot

Copy link
Copy Markdown

Root cause

Flagged in Twist thread stacks.garden3d.net:

ActiveModel::UnknownAttributeError: unknown attribute 'embedding' for Embedding.
/app/lib/stacks/etl/connector.rb:54:in `block in index_chunks!'
...
/app/test/lib/tasks/etl_rake_test.rb:37:in `block in <class:EtlRakeTest>'

The backtrace bottoms out in test/lib/tasks/etl_rake_test.rb:37 — this is Heroku CI's own test run, not a live prod ETL failure.

When stacks:etl:sync_google_groups got wired into stacks:etl:sync_all (50bd261), the sync_all rake test wasn't updated to stub Stacks::Etl::Groups::Connector. So CI's test for sync_all actually invoked the real connector, which hit real Google Group threads and tried to chunk+index them — creating an Embedding row with the embedding vector column. That column is intentionally added outside db/schema.rb (see the pgvector note at the top of the file) so schema:load works on Postgres without pgvector — which is exactly what Heroku CI's in-dyno Postgres is. Hence the raw-column write blew up.

(Every other connector test in the suite already knows about this and calls skip_without_pgvector — e.g. test/lib/stacks/etl/groups/connector_test.rb:5, test/lib/stacks/etl/connector_test.rb:24 — but the sync_all rake test never exercises a real connector for Meet, only for Groups, since Meet is invoked via the already-stubbed Stacks::Etl::Meet.sweep_all_users! helper.)

Fix

Stub Stacks::Etl::Groups::Connector#new / #run in the sync_all test, mirroring how the Meet sweeps are already stubbed via Stacks::Etl::Meet.expects(:sweep_all_users!) in the same test. The test now asserts sync_all's three-source invocation order (Meet API → Gemini notes → Google Groups) without touching Google or Embedding.

No production code changed — this is a test-only fix for a CI-only failure mode.

Testing

Could not run the Rails/Minitest suite directly from this sandbox (no persistent Ruby 3.1.7 + Postgres toolchain here — same limitation noted on PR #122). Requesting Heroku CI run on this PR to confirm green; will monitor and squash-merge on green per standing instruction.

… CI failure)

sync_all's sync_all test didn't stub Stacks::Etl::Groups::Connector when
stacks:etl:sync_google_groups was wired into sync_all (50bd261). CI's own
test run for stacks:etl:sync_all was therefore invoking the REAL connector,
which fetched real Google Group threads and tried to index chunks —
creating an Embedding record with the 'embedding' vector column. That
column is added outside db/schema.rb specifically so schema:load works on
Postgres without pgvector (Heroku CI's in-dyno Postgres), so the raw
column write raised:

  ActiveModel::UnknownAttributeError: unknown attribute 'embedding' for Embedding.

(surfaced in the ops thread via /app/lib/stacks/etl/connector.rb:54 →
etl.rake:38 → test/lib/tasks/etl_rake_test.rb:37).

Fix: stub Stacks::Etl::Groups::Connector#new/#run in the sync_all test,
mirroring how the Meet sweeps are already stubbed via
Stacks::Etl::Meet.expects(:sweep_all_users!) in the same test — so the
test asserts sync_all's three-source wiring/order without touching Google
or Embedding at all.
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