-
Notifications
You must be signed in to change notification settings - Fork 249
Add Connect to Gitea button #3121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <!-- | ||
| Gitea has no icon in @appwrite.io/pink-icons-svelte yet, so this is a | ||
| hand-drawn stand-in (simplified teapot silhouette, matching Gitea's | ||
| mascot) kept local to the git-connect UI until a proper brand icon | ||
| lands in the shared icon package. Mirrors the monochrome, | ||
| currentcolor-fill convention of the other Icon* components (e.g. | ||
| IconGithub) so it drops into <Icon icon={IconGitea} /> unchanged. | ||
| --> | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"> | ||
| <path | ||
| fill="currentcolor" | ||
| fill-rule="evenodd" | ||
| d="M6 3.75A1.25 1.25 0 0 1 7.25 2.5h5.5A1.25 1.25 0 0 1 14 3.75V5h1.25A2.75 2.75 0 0 1 18 7.75v1.5A2.75 2.75 0 0 1 15.25 12H14v.114a3.886 3.886 0 0 1-3.886 3.886H9.886A3.886 3.886 0 0 1 6 12.114V3.75Zm7 5.75V3.75a.25.25 0 0 0-.25-.25h-5.5a.25.25 0 0 0-.25.25v8.364A2.886 2.886 0 0 0 9.886 15h.228A2.886 2.886 0 0 0 13 12.114V9.5ZM14 6v5h1.25c.966 0 1.75-.784 1.75-1.75v-1.5c0-.966-.784-1.75-1.75-1.75H14Z" | ||
| clip-rule="evenodd" /> | ||
| <path | ||
| fill="currentcolor" | ||
| d="M4 16.5a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75a.75.75 0 0 1-.75-.75Z" /> | ||
| </svg> |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_APP_VCS_PROVIDERSruntime type assumption — The cast to{ _APP_VCS_PROVIDERS?: string[] }is erased at runtime, sovcsProviders.includes('gitea')dispatches to whatever prototype the server actually returns. If the server sends a comma-separated string ("github,gitea"),String.prototype.includeswill do a substring check instead of an exact-element check — which happens to work for'gitea'but would produce false positives for values like"notgiteahere"or future provider names that are substrings of one another. Could you confirm the API response shape is alreadystring[], or add a defensive runtime check?Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greptile Confirmed against the actual server code _APP_VCS_PROVIDERS is declared with 'array' => true in ConsoleVariables.php, and Appwrite's response serialization (Response.php:562) explicitly throws if that field isn't a real PHP array before encoding. So it's guaranteed to be a JSON array on the wire, never a comma-joined string — .includes('gitea') correctly dispatches to Array.prototype.includes. No substring-match risk here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into that — the
'array' => truedeclaration and the serialization guard inResponse.phpare exactly the kind of server-side guarantees that make the type cast safe. The concern is fully resolved; no changes needed here.