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

Support MRs generated by LocalRegistry.jl

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
gitlab, python
Ambito
devops

Direzione di ricerca

Inizia in tagbotgitlab/tagbot.py, con la regex intorno alla riga 15, poi segui il percorso della versione catturata fino a gitlabchangelog/changelog.py. Aggiorna le regex per gestire sia i body di Registrator.jl separati da newline sia i body di LocalRegistry.jl che usano
e •, e verifica che entrambi i formati producano una versione valida per il parsing del changelog.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A few months ago, LocalRegistry.jl added the option of generating GitLab Merge Requests (MRs) to a PackageRegistry (https://github.com/GunnarFarneback/LocalRegistry.jl/pull/49).

However the generated MRs have a body/description with the following format:

• Registering package: Example<br>• Repository: gitlab.foo.com/foo/bar<br>• Version: v0.1.2<br>• Commit: abcdef<br>• Triggered by: @john.doe<br>

We can see the fields are not separated by newline characters, but instead by <br> HTML elements. This is to workaround the fact that the MR is created via git push options and newlines are not supported there (there is a mention of this in that LocalRegistry MR https://github.com/GunnarFarneback/LocalRegistry.jl/pull/49).

TagBotGitLab fails to parse such MR body, with the following error:

Traceback (most recent call last):
File "/var/task/tagbotgitlab/tagbot.py", line 32, in handler
status, msg = 200, handle_event(json.loads(evt.get("body", "
{}
")))
File "/var/task/tagbotgitlab/tagbot.py", line 56, in handle_event
return handle_merge(payload)
File "/var/task/tagbotgitlab/tagbot.py", line 124, in handle_merge
release_notes = changelog.get(version, commit)
File "/var/task/gitlabchangelog/changelog.py", line 238, in get
data = self._collect_data(version, sha)
File "/var/task/gitlabchangelog/changelog.py", line 183, in _collect_data
previous = self._previous_release(version)
File "/var/task/gitlabchangelog/changelog.py", line 74, in _previous_release
cur_ver = semver.VersionInfo.parse(_strip_starting_v(version))
File "/var/task/semver.py", line 726, in parse
raise ValueError("%s is not valid SemVer string" % version)
ValueError: 0.1.2<br>• Commit: abcdef<br>• Triggered by: @john.doe<br> is not valid SemVer string

i.e. it believes the version string is 0.1.2<br>• Commit: abcdef<br>• Triggered by: @john.doe<br>, since the regex matches all characters until the end of line. Passing that string to semver.VersionInfo.parse rightfully produces an error.

We should change the regexes to support MRs generated both by Registrator.jl (containing newlines) and LocalRegistry.jl (containing <br> and •).

I'll submit a PR for this soon.

Lingua principale
Python
Stelle
6
Fork
3
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 invenia/TagBotGitLab

Tutte le issue di invenia/TagBotGitLab

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.