feat(config): update n8n webhook handling #366
Reference in New Issue
Block a user
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
.githubdirectory have been moved to an.archive/.githubdirectory.1. Directory Changes:
.githubdirectory 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.defaultfile, which provides default values for environment variables, has been modified.N8N_WEBHOOK_URLenvironment variable has been removed.N8N_GET_WEBHOOK_URLandN8N_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):
Configclass inapp/utils/config.pyhas been updated to reflect the environment variable changes.n8n_webhook_urlproperty has been removed.n8n_get_webhook_urlandn8n_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.pyfile has been modified to use the new configuration properties.__n8n_postfunction, theurlparameter in therequests.postcall now usesconfig.n8n_post_webhook_urlinstead of the oldconfig.n8n_webhook_url.get_tasksfunction, theurlparameter in therequests.getcall now usesconfig.n8n_get_webhook_url.5. Test Changes (tests/test_config_1.py and tests/test_config_2.py):
N8N_WEBHOOK_URLis removed andN8N_GET_WEBHOOK_URLandN8N_POST_WEBHOOK_URLare 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
.githubdirectory 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_URLparameter. If there are, these need to be migrated.No changes necessary.
feat: update n8n webhook handlingto feat(config): update n8n webhook handling