Skip to content

feat: Enhance GitHub repository name handling#1600

Open
EwanTauran wants to merge 2 commits intomainfrom
feat/github-accept-full-url
Open

feat: Enhance GitHub repository name handling#1600
EwanTauran wants to merge 2 commits intomainfrom
feat/github-accept-full-url

Conversation

@EwanTauran
Copy link
Contributor

@EwanTauran EwanTauran commented Mar 12, 2026

Enhance GitHub repository name handling: update validation to accept full GitHub URLs and normalize input by stripping URL prefixes. Update related validation messages for clarity.


Summary by cubic

Accept full GitHub repository URLs in the repo field and normalize them to owner/repo. This reduces input errors and keeps configs consistent.

  • New Features
    • Accepts https://github.com/... and http://github.com/...; strips prefix and trailing slash to store owner/repo.
    • Updated frontend hints and backend validation to reflect both formats and validate after normalization.

Written for commit a83b362. Summary will update on new commits.

…full GitHub URLs and normalize input by stripping URL prefixes. Update related validation messages for clarity.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/airweave/platform/configs/config.py">

<violation number="1" location="backend/airweave/platform/configs/config.py:186">
P2: Normalize repo_name should strip query/fragment parts from full URLs; otherwise `owner/repo?tab=readme` passes validation and becomes an invalid repo identifier.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if v.lower().startswith(prefix):
v = v[len(prefix) :]
break
return v
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Normalize repo_name should strip query/fragment parts from full URLs; otherwise owner/repo?tab=readme passes validation and becomes an invalid repo identifier.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/airweave/platform/configs/config.py, line 186:

<comment>Normalize repo_name should strip query/fragment parts from full URLs; otherwise `owner/repo?tab=readme` passes validation and becomes an invalid repo identifier.</comment>

<file context>
@@ -171,6 +173,18 @@ class GitHubConfig(SourceConfig):
+                if v.lower().startswith(prefix):
+                    v = v[len(prefix) :]
+                    break
+        return v
+
     @field_validator("repo_name")
</file context>
Suggested change
return v
return v.split("?", 1)[0].split("#", 1)[0] if isinstance(v, str) else v
Fix with Cubic

…e type hints for better clarity and maintainability. Ensure consistent return types across validators. Addresses mypy issues.
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.

1 participant