aboutcode-org / aboutcode-org/purldb

Preserve version ordering in packagedb VersionResponse

オープン 初心者向け
#857 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
HTML
スター
67
フォーク
69
平均マージ
8日 8時間
マージ済み PR(30日)
1

説明

While looking at `packagedb/package_managers.py`, I noticed that `VersionAPI.get_until()` builds `VersionResponse.valid_versions` and `newer_versions` using sets.

That means duplicates are removed, but the original version order from `fetch()` is also lost.

There is already a related note in the file:

`# FIXME: DO NOT use set() for storing version lists: they lose the original ordering`

I think this should preserve fetch order while still deduplicating values.

A possible fix would be:
- change `valid_versions` and `newer_versions` to ordered lists
- keep a small `seen` set internally in `get_until()` for deduplication
- add/update tests in `packagedb/tests/test_package_managers.py`

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start in packagedb/package_managers.py at VersionAPI.get_until() and inspect how VersionResponse.valid_versions and newer_versions are built from fetch(). Then review packagedb/tests/test_package_managers.py and add or update coverage for preserving fetch order while removing duplicates; done means the response lists retain first-seen ordering and the tests pass.

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

評価

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

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

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