feat(config): update n8n webhook handling #366
Reference in New Issue
Block a user
No description provided.
Delete Branch "bugfix/post-get-urls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Okay, I will explain the code changes presented in the diff. The primary focus of this pull request appears to be refactoring the N8N webhook URL configuration to use separate URLs for GET and POST requests. Additionally, several files in the
.github
directory have been moved to an.archive/.github
directory.1. Directory Changes:
.github
directory to.archive/.github
. This suggests that these configurations are no longer actively used or are being superseded by other configurations.2. Environment Variable Changes (.env.default):
.env.default
file, which provides default values for environment variables, has been modified.N8N_WEBHOOK_URL
environment variable has been removed.N8N_GET_WEBHOOK_URL
andN8N_POST_WEBHOOK_URL
, have been added. This indicates the application now requires separate webhook URLs for GET and POST requests to the N8N service.3. Configuration Class Changes (app/utils/config.py):
Config
class inapp/utils/config.py
has been updated to reflect the environment variable changes.n8n_webhook_url
property has been removed.n8n_get_webhook_url
andn8n_post_webhook_url
, have been added. These properties retrieve the corresponding environment variables and provide access to the individual webhook URLs.4. N8N Utility Changes (app/utils/n8n.py):
app/utils/n8n.py
file has been modified to use the new configuration properties.__n8n_post
function, theurl
parameter in therequests.post
call now usesconfig.n8n_post_webhook_url
instead of the oldconfig.n8n_webhook_url
.get_tasks
function, theurl
parameter in therequests.get
call now usesconfig.n8n_get_webhook_url
.5. Test Changes (tests/test_config_1.py and tests/test_config_2.py):
N8N_WEBHOOK_URL
is removed andN8N_GET_WEBHOOK_URL
andN8N_POST_WEBHOOK_URL
are added and asserted.Summary:
This pull request introduces a separation of N8N webhook URLs for GET and POST requests. This likely allows for more specific control and potentially different workflows depending on the HTTP method used to interact with the N8N service. The
.github
directory changes suggest cleaning up the repository by archiving old or unused configuration files. The tests are updated to align with the new configuration structure.Decision: Accept
Change Score: 9/10
The changes refactor the N8N webhook URL configuration to use separate URLs for GET and POST requests, improving flexibility. The old github files are being archived.
However, ensure that the N8N workflows are correctly configured to handle requests on both GET and POST endpoints. Also ensure there are no other areas in the code that still use the old
N8N_WEBHOOK_URL
parameter. If there are, these need to be migrated.No changes necessary.
feat: update n8n webhook handlingto feat(config): update n8n webhook handling