Align Harbor Publication Probes with Helm OCI Chart Tag Encoding
I updated the Harbor publication logic to correctly encode Helm chart version tags and expanded the test suite to cover the full range of version formats, ensuring probes can reliably detect valid tags.
What the Harbor OCI tag encoding fix does
The commit replaces the + character with _ when forming OCI tags, so a version like 1.2.3-rc.1+build.4 becomes 1.2.3-rc.1_build.4. New constants MAX_OCI_TAG_LENGTH and a regex for prerelease identifiers enforce the allowed length and character set. The validation step now checks that each numeric component fits within 64‑bit, and the reference construction normalizes + to _ before creating the OCI reference, matching Helm’s actual tag encoding.
What the test suite now validates
The test file adds a version argument to fixture_package and expands the version loop to include many realistic formats: plain versions, versions with prerelease identifiers, versions with build metadata, and a very long tag that exceeds the allowed length. Each case supplies the expected SHA‑256 checksum, letting the validator confirm that only correctly encoded tags pass and that invalid formats are rejected.
What remains to be verified
I still need to run the updated CI pipeline to ensure the new probes succeed against a real Harbor instance, and to confirm that existing pipelines are not broken by the stricter tag validation. Additionally, I should verify that the tag normalization does not affect any downstream consumers that rely on the original + syntax.
Where this pattern applies to other Helm‑based OCI workflows
Any project that publishes Helm charts as OCI images can reuse this approach: normalize + to _ in tags, enforce length and component limits, and add comprehensive test cases that cover plain, prerelease, and build‑metadata versions. By making the validation logic explicit and well‑tested, downstream consumers can rely on consistent tag handling without manual inspection.