Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

GitLab inventory stops at the first page of projects on python-gitlab >= 4.0.0, and the documented `orgs` key is never read

Aperta
#89 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, cli

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 single GET /api/v4/projects?as_list=False. The log says Number 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 alongside repos, orgs adds nothing.
  • Controls: repos and exclude each narrow the result to 1 project. Changing line 43 to all=True gives 25 of 25 on all three versions. A patched copy that reads orgs through 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di llnl/scraper

Tutte le issue di llnl/scraper

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.