Skip to content

Fix/pve9 storage api version#8

Merged
roiyz-lb merged 3 commits into
mainfrom
fix/pve9-storage-api-version
Jun 11, 2026
Merged

Fix/pve9 storage api version#8
roiyz-lb merged 3 commits into
mainfrom
fix/pve9-storage-api-version

Conversation

@roiyz-lb

@roiyz-lb roiyz-lb commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

What does this change do and why?

Type of change

  • Bug fix
  • New feature
  • Documentation
  • CI / tooling

Testing

  • perl -c LightbitsPlugin.pm passes
  • shellcheck scripts/install.sh scripts/uninstall.sh passes
  • Tested on a real Proxmox VE node (describe below, or explain why not applicable)

Test notes:

DCO

By submitting this pull request I certify that my contribution is made under the terms of the Developer Certificate of Origin and that each commit includes a Signed-off-by line (git commit -s).

Summary by CodeRabbit

  • New Features

    • Dynamic API version negotiation for automatic compatibility with different Proxmox releases
    • Stable backend identity support for consistent backend recognition across cluster nodes
  • Documentation

    • Updated Proxmox VE compatibility to 9.x
    • Expanded changelog with detailed feature coverage
  • Tests

    • Added tests validating API version negotiation and identity formatting
  • Chores

    • Updated local development ignore settings

roiyz-lb added 2 commits June 11, 2026 05:40
Replace the fixed api() => 11 with dynamic negotiation: report the
running host's PVE::Storage::APIVER, clamped to the highest version we
have validated ($TESTED_APIVER = 14). This loads cleanly without the
"older storage API" warning across PVE 9.x point releases, whose APIVER
differs. Falls back to the tested version if PVE::Storage is absent.

Add get_identity() (storage API 14) returning a stable
lightbits://<host>/<project> identifier so PVE recognises the same
LightOS backend across nodes.

Add t/api_version.t covering api() negotiation branches and
get_identity(). Bump README compatibility to PVE 9.x (tested on 9.2).
Prevents accidentally committing .claude/settings.local.json, which may
contain internal hostnames/IPs, in a public repo. Previously only shielded
by a machine-local global ignore.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a8170063-a74e-43a9-859e-fd1b1ea81732

📥 Commits

Reviewing files that changed from the base of the PR and between 26caea9 and de34d69.

📒 Files selected for processing (2)
  • LightbitsPlugin.pm
  • t/api_version.t

📝 Walkthrough

Walkthrough

The Lightbits Storage Plugin is upgraded to support Proxmox VE 9.x by implementing dynamic storage API version negotiation that detects and reports compatible APIVER values, adding a stable backend identity function for cross-node storage matching, and including comprehensive test validation. Documentation is updated to reflect the new Proxmox 9.x baseline.

Changes

Proxmox VE 9.x API Version Negotiation and Backend Identity

Layer / File(s) Summary
API version negotiation and backend identity
LightbitsPlugin.pm
The api() function replaces a constant return value with dynamic APIVER computation: it reads the host's PVE::Storage::APIVER() and PVE::Storage::APIAGE() via eval, returns the host version when it is at or below the tested maximum (14), caps the reported version to 14 when the host is newer, and falls back to 14 on exception. New get_identity() function constructs and returns a stable lightbits://<host>/<project> identifier from the configured API host and resolved Lightbits project.
API version negotiation and identity test coverage
t/api_version.t
New test file stubs PVE::Storage::APIVER and APIAGE via mutable lexicals, validating that api() returns the host version verbatim when compatible, clamps to tested max when host exceeds it, and falls back to tested max on lookup failure. Also verifies get_identity() constructs the expected identity format and handles default project fallback when lb_project is not provided.
Documentation and compatibility updates
CHANGELOG.md, README.md
CHANGELOG documents the Lightbits Storage Plugin initial release for Proxmox VE 9.x with expanded details on third-party namespace auto-loading, dynamic APIVER negotiation, and get_identity() support. README prerequisites and compatibility table are updated from Proxmox VE 8.4 (tested) to Proxmox VE 9.x (tested on 9.2).
Project configuration update
.gitignore
Added Claude Code local settings exclusion (.claude/ directory) with descriptive comment.

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix/pve9 storage api version' is directly related to the main changes: updating the storage plugin's dynamic API version negotiation to support Proxmox VE 9.x and implementing intelligent APIVER clamping.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@LightbitsPlugin.pm`:
- Around line 139-149: The api() function contains a dead APIAGE branch and a
misleading comment: remove the APIAGE-based condition (the "return
$TESTED_APIVER if $apiver - $apiage <= $TESTED_APIVER;" branch) so the function
simply returns $apiver when $apiver <= $TESTED_APIVER and otherwise returns
$TESTED_APIVER, and update the surrounding comment to correctly state that an
APIVER far ahead of TESTED_APIVER will be rejected by the loader (per the loader
rule) rather than "loads, warns"; also update the test t/api_version.t to
reflect the loader behavior (adjust the expectation for APIVER=99/APIAGE=2 to
match rejection or the new documented outcome).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 29fe342b-7e3e-4e96-8dcd-9aff114be42a

📥 Commits

Reviewing files that changed from the base of the PR and between cd6aa72 and 26caea9.

📒 Files selected for processing (5)
  • .gitignore
  • CHANGELOG.md
  • LightbitsPlugin.pm
  • README.md
  • t/api_version.t

Comment thread LightbitsPlugin.pm
The api() APIAGE branch returned the same value as the fallthrough, so it
was dead code. Remove it (and the now-unused APIAGE read) so api() simply
returns the host APIVER when within our tested range, else the tested max.

Correct the comment: a returned value below the loader's
[APIVER - APIAGE, APIVER] window is rejected outright, not loaded with a
warning. Update t/api_version.t labels to document loader accept/reject
per case.
@roiyz-lb roiyz-lb merged commit f9a342d into main Jun 11, 2026
2 checks passed
@roiyz-lb roiyz-lb deleted the fix/pve9-storage-api-version branch June 11, 2026 06:56
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