-
Notifications
You must be signed in to change notification settings - Fork 0
feat: CORS probe #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: CORS probe #359
Conversation
e195013 to
204fa6f
Compare
Pierlou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean and concise 👏 just a couple of NIT notes
Pierlou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
maudetes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always unsure about the proper way to get the needed CORS values.
| ) | ||
|
|
||
| if cors_probe := await probe_cors(session, url): | ||
| cors_payload = build_cors_payload(cors_probe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we store this cors_payload in the checks table directly? I think everytime we want to debug something, it's useful to get the state at check time (the same way we store headers)
Co-authored-by: Pierlou Ramade <48205215+Pierlou@users.noreply.github.com>
8428872 to
055ff56
Compare
c58cc50 to
ccd3c88
Compare
commit 866d1d7 Author: Adrien Carpentier <adrien.carpentier@numerique.gouv.fr> Date: Fri Nov 21 10:36:44 2025 +0100 fix: resolve async/await compatibility issues with Typer CLI (#361) This PR fixes CLI commands that were broken after migrating from minicli to Typer, which doesn't handle async functions directly. All async CLI commands are now wrapped with synchronous functions that use `_make_async_wrapper()` to detect the execution context and run async code appropriately. The wrapper automatically detects if an event loop is already running (for tests) or creates one using `asyncio.run()` (for CLI execution), ensuring compatibility with both direct CLI usage and async test environments. The unused `cleanup()` function has been removed, and redundant exception handling (`except Exception as e: raise e`) has been cleaned up. All CLI commands now work correctly without RuntimeWarnings about unawaited coroutines. ... ...but it's VERY ugly and verbose.
commit a43d2d4 Author: Adrien Carpentier <adrien.carpentier@numerique.gouv.fr> Date: Fri Nov 21 15:44:14 2025 +0100 feat: optimize cleanup of stuck status resources (#363) Replaces the iterative cleanup approach with a single SQL UPDATE query that processes all stuck resources at once, improving performance in `load_catalog`. **Performance improvement:** - Before: 1 SELECT query + N UPDATE queries (one per stuck resource) - After: 1 single UPDATE query with subquery - Reduces database round-trips and allows PostgreSQL to optimize the operation atomically commit 80eb0fd Author: Adrien Carpentier <adrien.carpentier@numerique.gouv.fr> Date: Fri Nov 21 15:25:54 2025 +0100 feat: add total resources and deleted resources in crawler status health check (#362) - Add total resources and deleted resources in crawler status health check (to be later used in Munin dashboards) - Reorganize crawler health check output to be more explicit
Closes #360 (sub-issue of described issue here datagouv/data.gouv.fr#1810)
Send a preflight OPTIONS request to collect the CORS headers of the distant ressource, and send them to udata to be stored in the extras.