M
M
mkmister2018-07-28 19:32:40
Python
mkmister, 2018-07-28 19:32:40

Upload/update files to GITLAB repository, best way?

Good day to all, I'm a novice web developer, so please don't throw your slippers :) I want to note that the task is solved on the python & & django stack, but if you had experience solving a similar task on another stack (, AP) it is also very interesting to me.
To the point, there is the following task: It is
necessary to implement a service (application / web interface) that will help to make commits with the corresponding files. I get access to user's account via API, via access_token, commit message, branch and archive with files and !directories (via interface I've already developed).
Next, I unpack the archive into a temporary directory, and here the question arises:
How is it better to solve the problem of sending files and commit-a.
At the moment, based on the API documentation, I see only 2 ways:

  1. Clone a repository, which can be quite large, which can take an unknown amount of time, and then do all further manipulation directly through git. There are 3 nuances (I'm sure even more): the duration of the entire process, problems with error handling, and the most important thing is authorization, since in my application the password and login from the user account on gitlab are not stored and will not be stored, and the user authorized in my application until it removes the conditional sessionId from the cookie.
  2. Build the nth request list, or use the python-gitlab package (which doesn't make things much easier), and encode each file to base64 before sending it, which can also take an indefinite time. It is worth noting that files can be of various types psd, exe, txt, py, js, etc.
  3. Can you suggest something? :)

So which way is better and why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question