Closed alexander-haller closed 2 months ago
In GitLab by @mhxion on Mar 5, 2024, 17:58
requested review from @alexander-haller
I love how you create merge requests. They are succinct, contain examples and give context.
approved this merge request
In GitLab by @mhxion on Mar 6, 2024, 24:12
I'm glad you liked it! They also serve as documentations for me. In fact, I meant to use PR details and our discussions here as the basis of documentation (proper documentation) which we currently don't have yet.
In GitLab by @mhxion on Mar 6, 2024, 24:13
Thanks for approving!
In GitLab by @mhxion on Mar 6, 2024, 24:20
Looks like I made a terrible mistake with this branch. I ran a git-filter-repo
command from SO without realizing it affects all past commits, and it essentially rewrote every commit. Which is why this branch has 516 commits! It should have less than 10.
Edit: Fixed! At least the remote repo. That was close!
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 6, 2024, 24:40
added 516 commits
dev
In GitLab by @mhxion on Mar 6, 2024, 03:01
resolved all threads
Tell me how you fixed it so that I learn this! And also sorry that I did not pay notice to the large # of commits when looking over it.
In GitLab by @mhxion on Mar 6, 2024, 16:16
And also sorry that I did not pay notice to the large # of commits when looking over it.
That's totally fine. I myself only noticed it right before when I was trying to merge it and GitLab was showing a merge conflict. And I was like "what conflict?!..." 🤦🏼♂️
Tell me how you fixed it so that I learn this!
You're probably going to enjoy my naive process:
git-filter-repo
corrupted my entire local repository in directory ~/Workshop/elapi
including all local branches and the git stash.~/Workshop/elapi-tmp/
. The remote repo's main
and dev
branches remained unaffected ofc. cd
ed to elapi-temp/
.improve-url-class
(the same name that was on the corrupted branch) from branch dev
. This branch was uncorrupted but it didn't have the new commits from the corrupted branch improve-url-class
from the corrupted repo.improve-url-class
branch now remained uncorrupted, without any change in commit history that git-filter-repo
rewrote with just the commits I needed. I force pushed this branch. Because the name of the branch was same, GitLab just updated the corrupted improve-url-class
branch. The PR showed the correct number of commits. Everything was back to normal..git
folder from ~/Workshop/elapi-tmp/
to ~/Workshop/elapi
, so I could keep working on my old local repository where all the virtual envs were.~/Workshop/elapi
and started fresh I'd have lost this local history from PyCharm. I found another way to get deleted stash back from Git itself, but I never tried it.In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 7, 2024, 03:00
added 12 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 7, 2024, 03:02
added 12 commits
In GitLab by @project_994_bot_1f89ebd5af89f5e987c71c650dd64895 on Mar 7, 2024, 03:03
added 12 commits
In GitLab by @mhxion on Mar 22, 2024, 14:14
resolved all threads
In GitLab by @mhxion on Mar 22, 2024, 14:15
This PR had already been merged to https://gitlab.urz.uni-heidelberg.de/urz-elabftw/elapi/-/merge_requests/32. But I guess I never merged the PRs systematically. My bad! This PR can be safely closed now, though the branch is outdated and shouldn't be used.
In GitLab by @mhxion on Mar 5, 2024, 17:58
Merges improve-url-class -> dev
This PR adds proper URL support for making all kinds of API requests via elAPI. Previously, elAPI only supported the following URL pattern:
https://elabftw-dev.uni-heidelberg.de/api/v2/<endpoint name>/<endpoint id>
.This PR adds a
ElabFTWURL
class that supports a more complete URL. We also introduce the following terms to identify certain parts of a URL.endpoint_id
,sub_endpoint_name
,sub_endpoint_id
,query
are optional. We can pass these parts as arguments toElabFTWURL
, and itsget()
method will simply convert them to a full URL for us. E.g.,This prepares elAPI for more advanced plugins like the upcoming
experiments
plugin that uses thesub_endpoint_name
andquery
to download attachments. We can also usequery
to perform advanced tasks like using the search functionality within eLabFTW.ElabFTWURL
also does a weak validation for the endpoint and sub-endpoint names that are passed.