GitLab inventory stops at the first page of projects on python-gitlab >= 4.0.0, and the documented `orgs` key is never read
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start with scraper/gitlab/init.py:43, scraper/code_gov/init.py:73-82, README.md:98, and the python-gitlab requirement in pyproject.toml:34. Reproduce the paged fake-server case, then verify that inventories include all projects and that an orgs-only configuration filters through the groups API without breaking repos or exclude behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On python-gitlab 4.0.0 and later, scraper inventories only the first page of projects (20 at GitLab's default page size) of a GitLab instance configured without repos, and exits 0.
scraper/gitlab/__init__.py:43 calls gl_session.projects.list(as_list=False). python-gitlab removed as_list in 4.0.0 (changelog: "as_list support is removed"), so it goes to the server as a query parameter and list() returns one page. pyproject.toml:34 only requires python-gitlab>=1.6.0, and a fresh install today resolves 8.5.0.
Related: README.md:98 documents "orgs" for GitLab, but the read at scraper/code_gov/__init__.py:73 has been commented out since f9de592 (2018), and :82 never passes it to query_repos. An orgs-only config gets the same unfiltered list as an empty one.
I ran the scraper CLI at b1bfe6e (0.16.0, same as the PyPI release) against a local fake GitLab v4 server that pages 20 at a time:
- 25 projects, no
repos: 20 releases on python-gitlab 8.5.0 and 4.0.0, from a singleGET /api/v4/projects?as_list=False. The log saysNumber of Projects: 20, and the only sign is python-gitlab's UserWarning on stderr ("returned 20 of 25 items"). On 3.15.0 it requests page 2 and gets 25. - Three projects in three groups,
orgs: ["public-group"]: all three come back, with the same requests as an empty config. Set alongsiderepos,orgsadds nothing. - Controls:
reposandexcludeeach narrow the result to 1 project. Changing line 43 toall=Truegives 25 of 25 on all three versions. A patched copy that readsorgsthrough the groups API returns only that group's 9 of 25.
Fixing the pagination alone would make an orgs config inventory every project /projects returns (25 of 25 in the same harness), so I'd fix the two together. I haven't run this against a real GitLab server, or tried python-gitlab older than 3.15.0.
Happy to open a PR that switches line 43 to all=True and reads orgs via groups.get(org).projects.list(all=True, include_subgroups=True), about 20 lines across the two files, or to just drop orgs from the README if you'd rather not support group filtering.
- Lingua principale
- Python
- Stelle
- 59
- Fork
- 28
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di llnl/scraper
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
code.gov enhancement help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di llnl/scraper
Issue simili
-
fix formatting of the sample database page of the docsForse già presa @Aaqibhafeezkhan l’ha presa oggi. Apertadocumentation good first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
chaoss/CollectOSS#544 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kestra-io/plugin-soda#137 ·
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
ibm-granite/granite.build#504 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno