Repository navigation
Conversation
…code-org#2206 The single webhook_url field of the project API was saved as the target URL without any check, so a relative path only showed up as a delivery error once the pipeline had run. The project is now created without that webhook and gets a warning message instead. Signed-off-by: ivasilev <ivasgo@gmail.com>
Khan-Tzar
force-pushed
the
fix/2206-relative-webhook-url
branch
from
November 23, 2026 22:31
ad0f877 to
43a71e8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
Changes
The delivery error in #2206 ("No connection adapters were found for '/notifications/send_scan_notification/...'") comes from a relative target URL. DejaCode builds the URL as
settings.SITE_URL + reverse(...), and with an emptySITE_URLonly the path is sent. The signed key in the path contains:, which is whyrequestsraisesInvalidSchemarather thanMissingSchema.On the ScanCode.io side, the single
webhook_urlfield of the project API is a plainCharField, so any string was stored as the subscriptiontarget_urland the problem only appeared as a delivery error after the pipeline had run.With this change, a
webhook_urlthat is not an absolutehttp(s)URL is not subscribed. The project is still created and gets a warning message that names the value.Two choices worth explaining:
400on project creation. DejaCode does not look at the response of its submit call (dje/tasks.py), so rejecting the request would make the scan silently never run, which is worse than a missing notification.urlparse(scheme + host) instead of Django'sURLValidator. The validator rejects single-label hosts such ashttp://dejacode:8000/, the usual address in a compose network, andhttp://server/...used by the existing purldb tests.The
webhookslist and theadd-webhookaction are not touched.Tests: three new tests in
scanpipe/tests/test_api.py(valid single URL, relative path, the helper).scanpipe.tests.test_apipasses (56 tests) in thev38.3.1-fullimage with this branch mounted; without the fix the relative-path test fails.ruff checkandruff format --checkare clean on both files.AI usage: I used Claude to read the two code bases, draft the change and the tests, and run them. I reviewed every line and can explain it.
Checklist