-
Notifications
You must be signed in to change notification settings - Fork 212
Add gitlab repositories information retrieval #1249
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
Conversation
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.
Did a high level review of the PR. I agree with you that we should generalize, and move to a single database table, a single updater struct and a RepositoryHost
trait implementing GitHub or GitLab specific parts.
3326538
to
0348b9f
Compare
0348b9f
to
686fe63
Compare
I made a |
I think it may make sense to have two levels here, a general |
Yes, I have something similar in mind. |
d8a76f8
to
79449f2
Compare
8290d6a
to
d5a3d57
Compare
I think there is still too much code duplication here. The trait should only contain code specific to the forge in question, so checking if a URL belongs to the forge, loading a single repository by its URL and loading multiple repositories by their IDs. Everything else, including every database interaction, should go into the main updater. Also, it's probably time to move the whole thing out of |
On it!
Any suggestion for the naming of the new module? |
I guess just |
df571f6
to
e9bf807
Compare
Moved the repositories files into a |
I think it's now ready for review. :) |
e9bf807
to
6536e00
Compare
Fixed conflict. |
6536e00
to
4317797
Compare
I also added a test to ensure the regex update is working as expected. |
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.
rpa
,dockertest
(repo is a sub-repo, I forgot how they were called in gitlab)It works fine once the regex is fixed. :)
I tested it again, it works now.
Also I did another check on some random not found repos, and these were either really wrong, or moved.
phaser
(repo url ends with.git
, github integration seems to support this)The repository doesn't exist: https://gitlab.com/bloom42/phaser (maybe it's private?).
Not sure how that failed, I just tried again and it's fine.
with_tempdir
,biorustlings
(repo was moved, I don't know the how github integration behaves here)It simply doesn't work I guess? So until they update the repository URL, I don't think there is much we can do about...
let's keep it like that, agreed.
Anyway, I fixed the backward migration and the regex so now things are working as expected. :)
The backwards migration is still broken, I added a fixed sql statement that. (it works in a local test)
e9a60de
to
63b3a8a
Compare
63b3a8a
to
f3a3740
Compare
I just realized I was testing the backward migration with a gitlab crate... Thanks a lot! |
c3c56a1
to
8fa4772
Compare
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.
so,
from looking at the code I don't see anything else we can test to be sure here. Also I guess the code itself had many iterations with @pietroalbini
Everything I tested works as it should, with gitlab- and github repos
- migrations forward and backwards are fine now
- the crate-detail page is fine with both github and gitlab repos
- backfill and normal update work fine and put in data
of course I might be missing details I don't know about (yet), but IMHO this is good enough to go live. The risk of breaking something major is low, and the revert is easy and tested.
I don't know (yet) how the deploy-process works (order of server-restart and the migrations being executed), depending on that there will be a time where we will have server errors.
Building this in a non-destructive way (without server errors while deploying/migrating) is possible of course, but would add quite some work.
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.
Could you update the PR description?
I left a lot of comments, but they're mostly nits, no major changes.
Updated the description as well. |
It would be nice to squash the history a bit when you get a chance, things have changed quite a lot since the initial PR. If it's a pain to use logical commits I'm fine with one giant commit. |
For the history rewrite, I was waiting for the PR to get approved so I can squash everything in one commit and we're done for. Gonna do that in the next push. |
* Create RepositoryStatsUpdater type to use as interface over updaters * Add RepositoryStatsUpdater instance to global contexts so they can be used in CrateDetails * Add Pool field into RepositoryStatsUpdater * Return a default icon * Add mock tests for github and gitlab updaters
e023ccc
to
e499069
Compare
Part of #35
This PR refactors how we retrieve repositories information by creating a general
Updater
running specific ones and add the information retrieval for gitlab repositories.