-
Notifications
You must be signed in to change notification settings - Fork 2
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
Gitlab presentation task #95
base: master
Are you sure you want to change the base?
Conversation
- creates issues in a private test repository of gitlab.lrz.de - file upload, issue creation, and issue modification work as with Redmine - modified create_anchor() to work with Gitlab - added new dependency for python-gitlab
use image_link as dict-key for the ![]() string
for item in presentation_list: | ||
if item["presentation_type"] == "image": | ||
file_name = Path(item["path"]).name | ||
upload = project.upload(file_name, filepath=f"{dst_folder}/{file_name}") |
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.
In Gitlab, we can only upload new files... As far as I can see, the API does not allow to update an existing file. I have tried to do this with the "update project files" functionality described here, but this only works for actual repository files, i.e., you have to specify a branch/commit etc.
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.
This might become an issue, as it could fill the project space with quite many images. Without having looked into the API in detail, is there call to delete files? So we can mimic an update by delete+upload?
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.
update and delete only work for project files, so files actually lying in the repository. Actually, it's the same on Gitlab in the browser: It is not possible to manually delete an uploaded attachment to an issue/issue comment, either. I wonder if Gitlab does some cleanup automatically if an uploaded issue attachment is not referenced anywhere?
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.
Found this but it doesn't help much. Searching the Gitlab Project REST API I didn't find anything to delete uploaded files. So it may not be a limitation just of python-gitlab.
See also this proposal.
Great, thanks a lot for getting practical! Looking forward to test and discuss! |
- similar to Redmine, had to adapt some function calls/Mock objects. - fix: A connection error actually throws request.exceptions.ConnectionError, not a gitlab.GitlabConnectionError!
will resolve #89 eventually.