Skip to content

Conversation

1yam
Copy link
Member

@1yam 1yam commented Sep 12, 2025

While testing we might need to use specific crn (exemple staging / local server) who is not in the crn list.

This Pr allow us to run a fake crn_list api locally.

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • [] All new code is covered by relevant tests.

Documentation

not updated yet

Changes

This pull request introduces a local mock CRN List API for development and testing, allowing the Aleph client SDK to use a locally served CRN list instead of the production endpoint. The changes add a FastAPI application, sample CRN list data, documentation, and update the Python dependencies to support this new API. Additionally, the Aleph SDK dependency is updated to a specific development branch.

New Local CRN List API:

  • Added a FastAPI application (crn_list.py) that serves the CRN list from a local crn_list.json file, including CORS support and endpoints for the root and /crns.json.
  • Created a sample crn_list.json file with a mocked CRN entry for local testing.
  • Added a requirements.txt specifying fastapi and uvicorn as dependencies for running the API.
  • Added a README.md with setup, usage instructions, and guidance on configuring the Aleph client SDK to use the local API.

Dependency Updates:

  • Updated the aleph-sdk-python dependency in pyproject.toml to use a specific development branch from GitHub (1yam-fake-crn-list).

How to test

export CRN_LIST_URL=http://localhost:8000/crns.json

python scripts/api/crn_list/crn_list.py

and then create instance

Notes

Only ovh staging is in here for now, more can be added in the json if needed

@1yam 1yam requested a review from aliel September 12, 2025 13:55
@1yam 1yam force-pushed the 1yam-fake-crn-list branch from 9192c92 to cad01b2 Compare September 12, 2025 13:56
@1yam 1yam changed the title Feature: Mock crn list Feature: script fake crn list for testing Sep 12, 2025
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.81%. Comparing base (30375f1) to head (cad01b2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #403   +/-   ##
=======================================
  Coverage   60.81%   60.81%           
=======================================
  Files          20       20           
  Lines        3718     3718           
  Branches      524      524           
=======================================
  Hits         2261     2261           
  Misses       1192     1192           
  Partials      265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@1yam
Copy link
Member Author

1yam commented Sep 18, 2025

The issue on unit has been fix in :

https://github.com/aleph-im/aleph-client/pull/396/files#diff-
aac630005781ed12616832342df2a5318e70ff5a3de26f43ae3fb69d19169641

@aleph-im aleph-im deleted a comment from github-actions bot Sep 18, 2025
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