Skip to content

feat(devuan): add Devuan distribution support#9

Merged
lengau merged 5 commits intomainfrom
work/add-devuan
Apr 22, 2026
Merged

feat(devuan): add Devuan distribution support#9
lengau merged 5 commits intomainfrom
work/add-devuan

Conversation

@lengau
Copy link
Copy Markdown
Owner

@lengau lengau commented Apr 21, 2026

Adds support for Devuan using the same distro-info-data CSV format as Debian, sourced from Salsa.

Changes

  • refactor: made esm_name optional in _debian_like_downloader so it can be reused for distros without an ESM/ELTS programme
  • feat: added devuan.py and bundled devuan.json (Devuan 1–8)
  • test: added test cases for Devuan support

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 21, 2026

Not up to standards ⛔

🔴 Issues 9 high · 1 minor

Alerts:
⚠ 10 issues (≤ 0 issues of at least minor severity)

Results:
10 new issues

Category Results
Documentation 1 minor
ErrorProne 1 high
Security 8 high

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

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

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
"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,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write an example test case for this?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please write a test case that shows the issue Gemini found.

Comment thread src/distro_support/_debian_like_downloader.py Outdated
Comment thread src/distro_support/devuan.py Outdated
lengau and others added 3 commits April 21, 2026 21:51
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>
lengau and others added 2 commits April 21, 2026 22:03
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>
@lengau lengau merged commit 0aa1915 into main Apr 22, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant