Repository navigation
fix(import): preserve GitHub blob URL path components - #44280
Merged
Merged
Conversation
Winoren
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
October 18, 2026 02:57
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44280 +/- ##
==========================================
+ Coverage 88.56% 88.87% +0.30%
==========================================
Files 5510 5568 +58
Lines 328616 334983 +6367
Branches 65246 66136 +890
==========================================
+ Hits 291037 297713 +6676
+ Misses 32385 32024 -361
- Partials 5194 5246 +52
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
crazywoola
approved these changes
Oct 30, 2026
1 task done
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.
Summary
Fixes #44279.
GitHub YAML imports can fetch the wrong URL when the owner or file path contains
blob. Three import services replace every/blob/, corrupting real directories and query values; the App source downloader removes the first occurrence, which may be the owner. RAG pipeline import also rewrites non-repository GitHub attachments.Add a shared URL helper in the existing
libs.url_utilsowner that recognizes/owner/repo/blob/<ref-and-file-path>and removes only the structural file-view marker. Preserve the owner, repository, remaining path, query, and fragment; leave other URLs unchanged. Reuse it in App source, App YAML, RAG pipeline YAML, and OpenAPI DSL import so this one rewrite rule is fixed together. Existing download transports, size bounds, parsing, and transaction ownership remain in their current services.Example:
Related merged #30003 protected App YAML imports of GitHub attachments. Explicit controls retain that behavior and cover the RAG path too.
Validation
DslImportService.preparethrough fetching, YAML parsing, and graph preparation, with an HTTP boundary returning 404 for an incorrect URL. App source cases check download selection, binary content, and cleanup. Legacy App/RAG boundary tests deliberately return an empty successful body to stop before resource creation, checking the requested URL and that no transaction starts.git diff --cached --checkis clean.Test command (existing backend environment active):
uv run --project api --active --no-sync --with pytest-env --with pytest-mock python -m pytest \ api/tests/unit_tests/services/test_github_import_urls.py \ api/tests/unit_tests/services/test_app_import_source.py \ api/tests/unit_tests/services/workflow/test_dsl_import.py \ api/tests/unit_tests/services/test_app_dsl_service.py \ api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline_dsl_service.py \ -q -o addopts=''CI follow-up
Added extensionless download URL controls at all three YAML import boundaries after Codecov reported partial coverage on their extension checks. The five related test files now pass 180 tests; local branch coverage confirms both outcomes of each changed extension check execute. Targeted Ruff lint/format and whitespace checks pass. No production code changed in this follow-up.
Screenshots
Not applicable (import URL selection).
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsAI assistance: Codex investigated, implemented, and ran the checks above. No independent human review is claimed.
From Codex