Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
| ErrorProne | 1 high |
| Security | 8 high |
🟢 Metrics 5 complexity · 0 duplication
Metric Results Complexity 5 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Devuan distribution by adding release data, a fetching module, and corresponding tests. It also updates the _debian_like_downloader to handle optional extended support names. Reviewers suggested updating type hints to accurately reflect that distribution fields can be null and recommended more robust handling of empty strings in CSV data to prevent runtime errors.
| "end_support": row["eol"], | ||
| "begin_dev": row["created"], | ||
| "end_extended_support": row[f"eol-{esm_name}"], | ||
| "end_extended_support": row.get(f"eol-{esm_name}") if esm_name else None, |
There was a problem hiding this comment.
CSV data often contains empty strings for missing values. If the eol-esm (or equivalent) column is present in the CSV but empty for a specific row, row.get() will return "". This will cause a ValueError in datetime.date.fromisoformat when the data is later processed by the SupportRange class. Using (row.get(...) or None) ensures that empty strings are correctly converted to None.
| "end_extended_support": row.get(f"eol-{esm_name}") if esm_name else None, | |
| "end_extended_support": (row.get(f"eol-{esm_name}") or None) if esm_name else None, |
There was a problem hiding this comment.
Can you write an example test case for this?
There was a problem hiding this comment.
@copilot please write a test case that shows the issue Gemini found.
Some distros (e.g. Devuan) use the same CSV format but do not provide an ESM/ELTS column. Making esm_name optional allows the downloader to be reused for those distributions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add support for Devuan using the distro-info-data CSV from Salsa (same source and format as Debian). Devuan does not have an ESM/ELTS programme so end_extended_support is always null. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
get_distro_info() in _debian_like_downloader, ubuntu, debian, and devuan all return dicts where end_extended_support can be None. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per Gemini's review feedback on PR #9: row.get() returns "" for an empty CSV cell, which passes the 'is None' guard in SupportRange.from_json and causes datetime.date.fromisoformat("") to raise ValueError. Fix: use (row.get(...) or None) so empty strings are coerced to None. Also: - Update SupportRange.from_json to accept dict[str, str | None] and use local variables for proper type narrowing - Add tests/test_debian_like_downloader.py demonstrating the bug and covering normal and edge-case behaviour Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds support for Devuan using the same distro-info-data CSV format as Debian, sourced from Salsa.
Changes
esm_nameoptional in_debian_like_downloaderso it can be reused for distros without an ESM/ELTS programmedevuan.pyand bundleddevuan.json(Devuan 1–8)