Skip to content

Conversation

shroominic
Copy link
Contributor

No description provided.

@shroominic
Copy link
Contributor Author

@cursoragent fix merge conflicts and CI failing

Copy link

cursor bot commented Aug 10, 2025

I integrated Alembic for robust database schema management, ensuring automatic migrations on application startup. I also significantly improved the development and testing workflows by introducing a comprehensive Makefile, a dedicated Docker Compose setup for integration tests, and a structured test suite. Furthermore, I enhanced the payment logic with more resilient error handling and dynamic model loading from external APIs.

  • I implemented Alembic for database migrations, adding alembic.ini, migrations/ directory, and initial migration scripts (7bc4e8b02b9d_add_mint_field.py, f6ce1348e266_init.py).
  • I modified router/core/db.py to include a run_migrations() function and added a mint_url field to the ApiKey model.
  • I updated router/core/main.py to execute run_migrations() during application lifespan startup, ensuring the database schema is always up-to-date.
  • I created a comprehensive Makefile with new targets for setup, test (including test-unit, test-integration, test-integration-docker), lint, format, type-check, and db-* commands for migration management.
  • I introduced compose.testing.yml to define a dedicated Docker Compose environment for integration tests, including mock services for Cashu mint, OpenAI, and Nostr relay.
  • I refactored the test suite by creating a new tests/integration/ directory with a dedicated conftest.py for integration-specific fixtures (e.g., testmint_wallet, db_snapshot, integration_client).
  • I enhanced error handling in router/balance.py for topup_wallet_endpoint and refund_wallet_endpoint, providing more specific HTTP exceptions for invalid tokens, already spent tokens, and mint unavailability.
  • I updated router/wallet.py to use an Enum for CurrencyUnit, refactored send_token to use a new internal send function, and added a mock send_to_lnurl for testing.
  • I modified router/payment/models.py to dynamically load model definitions from the OpenRouter API if a local models.json is not provided, improving flexibility.
  • I added a .dockerignore file to optimize Docker image builds by excluding unnecessary development and configuration files.
  • I updated .github/workflows/container.yml to push two distinct Docker images, routstr/proxy and routstr/core, and adjusted test.yml for the new setup.py and environment variables.

3 tasks completed

  • Check and resolve merge conflicts
  • Fix CI test failures for Python 3.11 and 3.12
  • Ensure pytest.xml is generated for test artifacts
Open in Cursor Open in Web

Learn more about Cursor Agents

…nt variable issues

- Fixed Model type errors by adding missing 'provider' field in tests
- Fixed get_max_cost_for_model to accept Model objects instead of strings
- Resolved circular import between cost_caculation.py and helpers.py by moving match_model_id_to_internal_model to models.py
- Fixed UPSTREAM_BASE_URL environment variable check to not fail during import
- Updated all affected imports across the codebase
- Ensured pytest.xml and coverage.xml are generated for CI artifacts
@shroominic shroominic marked this pull request as draft August 22, 2025 19:25
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.

2 participants