-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
VCS Integration not possible with slash in URL #9544
Comments
The API URL currently cannot be customized: Line 1154 in cecf191
|
This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented. In case you need this feature soon, please consider helping or push it by funding the development. |
Line 1154 in cecf191
Tried overriding it, but still couldn't get it to work. Also take a look at what's happening with the URL. weblate insists on inserting a /git/ after repos and before the {owner} even though that makes the API url invalid./api/v1/repos/git/<user>/<repo>/forks It seem that {owner} somehow resolves to /git/repownername I tried patching it out with this horrific workaround and adding my needed slash git: class GiteaRepository(GitMergeRequestBase):
name = gettext_lazy("Gitea pull request")
identifier = "gitea"
_version = None
API_TEMPLATE = "{scheme}://{host}/git/api/v1/repos/{owner}/{slug}"
push_label = gettext_lazy("This will push changes and create a Gitea pull request.")
def create_fork(self, credentials: Dict):
fork_url = "{}/forks".format(credentials["url"])
print(fork_url)
if fork_url.count("/git/") == 2:
fork_url = fork_url[::-1].replace("/git/"[::-1], "/"[::-1], 1)[::-1]
print(fork_url) The URL was generated correctly in the end and I could see the result from the API Json response straight in the browser, when copypasting the url manually. However, Weblate still failed with: |
Yes, Weblate parses the repository URL and assumes that /git/ is part of the repository URL: Lines 746 to 772 in b1a55c7
This looks like a permission issue with the installed SSL cert. |
Describe the issue
I believe the VCS platform integration doesn't work, when the target API has a slash in the name.
I have successfully configured the pushing via standard git and basic auth to a push URL of my Gitea repo. Now I want to configure Weblate to use the Gitea API to create Pull requests as per https://docs.weblate.org/en/weblate-4.18.2/vcs.html#vcs-gitea. Gitea is hosted at
subdomain.domain.net/git
as configured with NGINX. In my weblate settings I have:This results in the error:
An auth error, which I presume happens because it tries to Auth against a wrong URL. The url should be
/git/api/v1/repos/git/<user>/<repo>/forks
instead. The push URL is not considered when usingGitea Pull Request
asVersion control system
in the settings tab.The logical step would be to change
GITEA_CREDENTIALS
to say:but that doesn't work, as Weblate stops to recognize that config for Gitea with the message:
Is my deduction correct? How to solve this or debug further?
I already tried
Steps to reproduce the behavior
Try to configure the Gitea Pull request integration, when Gitea is hosted not on the root path of the URL, but a slash sub-path.
Expected behavior
No response
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
weblate.org service
Weblate versions
Weblate deploy checks
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: