Skip to content
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

Lack of validation when creating local VCS via API #7390

Closed
2 tasks done
nijel opened this issue Mar 15, 2022 · 3 comments
Closed
2 tasks done

Lack of validation when creating local VCS via API #7390

nijel opened this issue Mar 15, 2022 · 3 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@nijel
Copy link
Member

nijel commented Mar 15, 2022

Describe the issue

Using repo=local: vcs=local and providing no zipfile/docfile via API results in HTTP error 400: Bad Request {'repo': ["Could not update repository: fatal: 'origin/main' is not a commit and a branch 'main' cannot be created from it\n (128)"]}

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Trigger API request with repo=local:, vcs=local
  2. See the request fails

Expected behavior

It should behave similarly as in the UI - for some formats it is possible to start with a blank files, for some initial data is required.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

4.11

Weblate deploy checks

No response

Additional context

No response

@nijel nijel added this to the 4.12 milestone Mar 15, 2022
@nijel nijel self-assigned this Mar 15, 2022
@nijel nijel added the bug Something is broken. label Mar 15, 2022
@nijel
Copy link
Member Author

nijel commented Mar 15, 2022

Similarly, using just repo=local: fails with:

wlc.WeblateException: HTTP error 400: Bad Request {'repo': ['Could not fetch the repository: ssh: Could not resolve hostname local: Name or service not known\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n (128)']}

@sentry-io
Copy link

sentry-io bot commented Mar 15, 2022

Sentry issue: WEBLATE-611

nijel added a commit that referenced this issue Mar 16, 2022
@nijel nijel closed this as completed in d2ab507 Mar 16, 2022
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

1 participant