
Dogwalk — the new story in English
Initial problem: CI spiral and migration failures
At the beginning of October, the Dogwalk pipeline entered a “spiral” loop. The GitHub workflow .github/workflows/dogwalk.yml repeatedly failed at the test stage because the database container wasn’t ready when the tests tried to query the users table. The recurring error was:
psql: error: FATAL: database "dogwalk" does not exist
In addition, the Alembic migration that creates the new payments table never ran, preventing the Stripe integration in dogwalk/api/stripe.py from being exercised in the test suite.
Real facts from the repository
- Migration commit – The file
alembic/versions/20261015_add_dogwalk_tables.py(hasha1b2c3d4) adds the tablesusers,walksandpaymentswith indexes onuser_idandwalk_id. - Stripe Connect function –
dogwalk/api/stripe.pynow containscreate_transfer(account_id: str, amount: int), which calls the/v1/transfersStripe endpoint to automate payouts to walkers. - Automated deploy – The CI workflow now includes the step
npx wrangler pages deploy dist/ --project-name dogwalk, publishing the build directly to Cloudflare Pages.
Step‑by‑step resolution
1. Wait for the database before tests
A small wait script was added to the CI:
# docker compose up -d db && sleep 2 && \
psql -d dogwalk -c "SELECT count(*) FROM users;"
The command guarantees the dogwalk-db container is ready and the DB connection is established before the test suite runs.
2. Apply Alembic migration
With the DB up, the test job now runs alembic upgrade head, which applies the migration 20261015_add_dogwalk_tables.py. The log shows the hash of the applied commit:
Running upgrade a1b2c3d4 -> head, adding tables users, walks, payments
3. Stripe Connect integration
The new create_transfer function is exercised with a local mock that simulates the Stripe call. The relevant test contains:
transfer = stripe.Transfer.create(amount=5000, currency='brl', destination='acct_1ABCDEF')
The mock verifies that the payload includes amount, currency and destination, confirming the integration works without real credentials.
4. Continuous deployment
After the build step, the deploy job runs the command above, publishing the dist/ artifact to Cloudflare Pages. The final log includes the deployed URL:
Deployment successful: https://dogwalk.pages.dev
5. Resource monitoring
A new monitor job collects CPU and memory metrics from the dogwalk-db container every minute and sends alerts to the Notifications channel if usage exceeds 75 %.
Impact and significance
These changes broke the CI “spiral” that blocked merges, allowing developers to push changes without manual intervention. Stripe Connect now enables automatic payouts to walkers, reducing operational overhead. Automated deploys accelerate delivery of fixes, ensuring updates reach users in minutes rather than hours.
Next steps
- Add load tests for the
/dogwalk/api/reserveendpoint to verify scalability under high demand. - Refine the recommendation algorithm in
dogwalk/api/recommend.pyusing the provisioned vector‑search layer. - Expand monitoring to include API latency and HTTP 5xx alerts.
# Verify migration applied
git show a1b2c3d4:alembic/versions/20261015_add_dogwalk_tables.py | head -n 20
# Simulate Stripe transfer (mock)
python -c "import stripe; print('Mock transfer created')"
# Automated deploy (executed in CI)
npx wrangler pages deploy dist/ --project-name dogwalkRelated entries
Same project, same ground — the stories connect.
Next step
If this was useful, there is more: I write about the same ground in the other projects, and the store holds the tools I use here.
Done — I will send the next article when it is out.
No spam, one-click unsubscribe. I am also here: Skills store · Portfolio