Skip to content
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

Feat/fastapi plugin #3

Merged
merged 18 commits into from
Jul 28, 2024
Merged

Conversation

thiarthur
Copy link
Owner

Creates Integration and FastAPIIntegration

Description

Creates an interface that allows Eolic to receive remote events easily.
The first version implements FastAPI, but it also allows Eolic to integrate with other frameworks in the future.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  1. Unit Tests:

    • Added unit tests for the base integration class tests/integrations/test_base.py.
    • Added unit tests for the FastAPI integration class tests/integrations/test_fastapi.py.
    • Verified that the internal methods are properly called.
    • Verified that the routes of the FastAPI integration are well defined.
    • Ran the tests using pytest to ensure all tests pass.
  2. Manual Testing:

    • Ran the example services to ensure that the notification service event handler would be triggered.

      python examples/integrations/fastapi_plugin/notification_service.py
      python examples/integrations/fastapi_plugin/user_service.py
      curl -X POST "http://localhost:8000/users" -H "Content-Type: application/json" -d '{"id": 1, "name": "John Doe", "email": "john@example.com"}'

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sorry, something went wrong.

thiarthur added 18 commits July 23, 2024 00:56
…asses

Added a .coveragerc file to exclude coverage reporting for methods in abstract classes that are not yet implemented. This helps in getting accurate coverage reports for the implemented code.

The new configuration ensures that coverage metrics reflect the actual tested code and do not get skewed by unimplemented abstract methods.
Added `.idea/`, `mypy_cache`, and `pytest_cache` to `.gitignore` to exclude IDE settings and cache files from mypy and pytest tools. This helps keep the repository clean and prevents unnecessary files from being tracked.

Ensuring that these files are ignored helps to avoid committing personal IDE settings and temporary cache files that are not relevant to the project's source code.
…tion

Added docstrings to the methods in the latest integration implementation to improve code documentation and readability. Each method now has a clear description of its purpose, parameters, and return values.
Added detailed usage documentation for the FastAPI integration plugin. The new documentation includes:

- Installation instructions for the required dependencies.
- Initialization steps for setting up FastAPI and Eolic.
- Setup method to integrate Eolic with FastAPI.
Corrected a typo in the documentation where "::" was replaced with ":" for better readability and accuracy.
Updated the example to clarify that any event with the name `my-event` emitted from another app with an Eolic instance containing a `url` remote target and address `http://host/my-custom-event-route` will trigger the `my_event_handler` handler.
@thiarthur thiarthur merged commit 95db31b into thiarthur:master Jul 28, 2024
1 check passed
@thiarthur thiarthur deleted the feat/fastapi-plugin branch July 30, 2024 03:01
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.

None yet

1 participant