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

Gitlab presentation task #95

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

valentinaschueller
Copy link
Collaborator

will resolve #89 eventually.

- 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}")
Copy link
Collaborator Author

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.

Copy link
Owner

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?

Copy link
Collaborator Author

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?

Copy link
Owner

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.

@uwefladrich
Copy link
Owner

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!
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.

Gitlab Presentation Task
2 participants