Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support MRs generated by LocalRegistry.jl

オープン
#35 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
gitlab, python
領域
devops

調査の方向性

tagbotgitlab/tagbot.py の 15 行目付近にある regex から始め、キャプチャされたバージョンがどのように gitlabchangelog/changelog.py に到達するかを追跡します。改行で区切られた Registrator.jl の body と、
および • を使用する LocalRegistry.jl の body の両方を処理できるように regex を更新し、どちらの形式でも changelog の解析に有効なバージョンが生成されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
6
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

invenia/TagBotGitLab のほかの issue

invenia/TagBotGitLab の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。