feat: add raw repository format support#5
Conversation
Add CreateRawHostedRepository / CreateRawProxyRepository / CreateRawGroupRepository methods to the Nexus client, and wire them into the apply.go format switch. This lets nexus-cli provision raw hosted/proxy/group repositories declared in the config file, matching the pattern of existing maven2/docker/npm/pypi formats. Motivation: tektoncd-operator e2e for the catalog nexus-upload Task needs a raw hosted repository to upload artifacts into, and prepare-nexus-data should provision it automatically alongside the existing maven hosted repository.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| return nil | ||
| } | ||
|
|
||
| // CreateRawHostedRepository 创建 Raw hosted 仓库 |
There was a problem hiding this comment.
Suggestion (docs/enhancement): Consider updating the CLAUDE.md documentation to mention that raw format is now a supported repository format. This helps future developers understand the tool's capabilities.
🤖 AI Code Review
SummaryThis PR adds support for raw repository format (hosted, proxy, group) to nexus-cli, following the existing pattern for maven2, docker, npm, pypi, and go formats. The implementation also refactors the repository creation logic into a separate function to reduce cyclomatic complexity. The changes are clean, well-structured, and follow project conventions. Review Statistics
Critical Issues
None. Warnings
None. Suggestions
Positive Feedback
ℹ️ About this reviewThis review was automatically generated using the
|
Move the format/type dispatch switch out of createRepository into a new dispatchRepositoryCreate helper. createRepository becomes a pure request builder + single delegation, satisfying gocyclo's min-complexity=30 threshold (was 34 after adding raw support, now 11 / 26 for the two functions).
alaudabot
left a comment
There was a problem hiding this comment.
Review Summary
This PR adds raw repository format support following the existing patterns. The implementation is clean and builds successfully.
Findings:
- 0 Critical Issues
- 0 Warnings
- 1 Suggestion (documentation update for CLAUDE.md - already noted in inline comment)
The code is ready to merge.
What
Add raw repository format support (hosted / proxy / group) to nexus-cli,
mirroring the existing maven2 / docker / npm / pypi pattern.
Why
tektoncd-operator's catalog
nexus-uploadTask e2e needs a raw hostedrepository for artifact uploads. With this change,
make prepare-nexus-datacan declaratively provision both maven and raw repositories from a single
nexus-users.yaml, matching the existing toolchain provisioning flow.How
pkg/nexus/repository.go: addCreateRawHostedRepository/CreateRawProxyRepository/CreateRawGroupRepository, each posting to/service/rest/v1/repositories/raw/{hosted|proxy|group}— same 4-lineshape as the maven / docker / npm methods.
pkg/service/apply.go: add acase "raw":arm to the format switchin
createRepository, dispatching to the three new client methods.Tests
go test ./...passes (no new tests added — same coverage approachas the other format wrappers in this file).
Nexus instance via
nexus-cli create -c nexus-users.yamland confirmingthe repo appears in the Nexus REST API.
Notes
No format-specific fields exist on the raw
RepositoryRequest(unlikemaven.versionPolicy), so no struct changes are needed.