Skip to content

feat: add raw repository format support#5

Merged
yhuan123 merged 2 commits into
AlaudaDevops:mainfrom
yhuan123:feat/add-raw-repository-support
May 11, 2026
Merged

feat: add raw repository format support#5
yhuan123 merged 2 commits into
AlaudaDevops:mainfrom
yhuan123:feat/add-raw-repository-support

Conversation

@yhuan123

Copy link
Copy Markdown
Collaborator

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-upload Task e2e needs a raw hosted
repository for artifact uploads. With this change, make prepare-nexus-data
can declaratively provision both maven and raw repositories from a single
nexus-users.yaml, matching the existing toolchain provisioning flow.

How

  • pkg/nexus/repository.go: add CreateRawHostedRepository /
    CreateRawProxyRepository / CreateRawGroupRepository, each posting to
    /service/rest/v1/repositories/raw/{hosted|proxy|group} — same 4-line
    shape as the maven / docker / npm methods.
  • pkg/service/apply.go: add a case "raw": arm to the format switch
    in createRepository, dispatching to the three new client methods.

Tests

  • go test ./... passes (no new tests added — same coverage approach
    as the other format wrappers in this file).
  • Verified end-to-end by provisioning a raw hosted repository on a real
    Nexus instance via nexus-cli create -c nexus-users.yaml and confirming
    the repo appears in the Nexus REST API.

Notes

No format-specific fields exist on the raw RepositoryRequest (unlike
maven.versionPolicy), so no struct changes are needed.

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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/nexus/repository.go 0.00% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread pkg/nexus/repository.go
return nil
}

// CreateRawHostedRepository 创建 Raw hosted 仓库

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@alaudabot

alaudabot commented May 11, 2026

Copy link
Copy Markdown

🤖 AI Code Review

Property Value
Model opencode/minimax-m2.5-free
Style strict
Issues Found 0
Config Source centralized
Profile ❌ Not Found
Personalized Prompt ❌ No
Prompt Path .github/review/profiles/alaudadevops/nexus-cli/pr-review.md
Alauda Skills ✅ base-acp-operator-list, base-acp-operator-release, base-authoring, base-m365, base-ocp-operator-list, base-skill-setup, builders-alauda-pipeline, builders-component-knowledge, builders-confluence, builders-jira, builders-notify-wecom, builders-prd-to-testcase, builders-publish-errata, builders-roadmap-studio, builders-story-split, cross-repo-add-mirror, cross-repo-publish, devops-autodns, devops-candidate-version-supervisor, devops-connectors-acceptance-test, devops-connectors-explore, devops-connectors-poc-case, devops-connectors-review, devops-connectors-unit-test, devops-connectors-upgrade-test, devops-connectors-write-user-docs, devops-creating-tekton-pipelines, devops-fix-go-vulns, devops-fork-alauda-binary-release, devops-gen-advanced-form-descriptors, devops-jira-rfd-acceptance, devops-knowledge-adoption, devops-refresh-containerfile-digests, devops-refresh-containerfile-tags, devops-replace-strings, devops-scan-docker-keywords, devops-sync-alauda-github-releases, devops-tekton-dynamic-form-optimizer, devops-tekton-operator-task-e2e, devops-tekton-pipeline-delivery, devops-tekton-task-delivery, devops-tekton-task-overview-template, devops-tekton-task-version-upgrade, devops-tekton-upgrade-notes, devops-tool-report-troubleshoot, devops-ui-e2e-code-audit, devops-ui-e2e-fix-base-on-report, devops-ui-e2e-regression-and-fix, devops-ui-generate-e2e-from-feature, devops-ui-pre-setup, devops-upgrade-go, devops-upstream-backport-cve, devops-upstream-upgrade
Reviewed at 2026-05-11 07:26:43 UTC

Summary

This 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

Category Count
Critical Issues 0
Warnings 0
Suggestions 1
Files Reviewed 2

Critical Issues

Issues that MUST be addressed before merging (security, bugs, breaking changes)

None.

Warnings

Issues that SHOULD be addressed but are not blocking

None.

Suggestions

Recommendations for improvement (nice to have)

  • pkg/nexus/repository.go:166 - 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.

Positive Feedback

  • The new repository methods (CreateRawHostedRepository, CreateRawProxyRepository, CreateRawGroupRepository) follow the exact same pattern as existing methods for other formats - consistent and maintainable.
  • The refactoring of createRepository into dispatchRepositoryCreate is a good improvement that reduces function complexity and improves readability.
  • The code builds successfully and all tests pass.
  • Error handling is consistent with existing patterns using fmt.Errorf with %w for error wrapping.

ℹ️ About this review

This review was automatically generated using the run-actions workflow.

  • Shared prompt: .github/prompts/code-review.md
  • Config source: centralized
  • Profile path: Not Found
  • Profile ref: a5ba7c9bfeb72d3920971664d476ed377fcc5b94
  • No repository-specific prompt configured
  • Alauda skills: base-acp-operator-list, base-acp-operator-release, base-authoring, base-m365, base-ocp-operator-list, base-skill-setup, builders-alauda-pipeline, builders-component-knowledge, builders-confluence, builders-jira, builders-notify-wecom, builders-prd-to-testcase, builders-publish-errata, builders-roadmap-studio, builders-story-split, cross-repo-add-mirror, cross-repo-publish, devops-autodns, devops-candidate-version-supervisor, devops-connectors-acceptance-test, devops-connectors-explore, devops-connectors-poc-case, devops-connectors-review, devops-connectors-unit-test, devops-connectors-upgrade-test, devops-connectors-write-user-docs, devops-creating-tekton-pipelines, devops-fix-go-vulns, devops-fork-alauda-binary-release, devops-gen-advanced-form-descriptors, devops-jira-rfd-acceptance, devops-knowledge-adoption, devops-refresh-containerfile-digests, devops-refresh-containerfile-tags, devops-replace-strings, devops-scan-docker-keywords, devops-sync-alauda-github-releases, devops-tekton-dynamic-form-optimizer, devops-tekton-operator-task-e2e, devops-tekton-pipeline-delivery, devops-tekton-task-delivery, devops-tekton-task-overview-template, devops-tekton-task-version-upgrade, devops-tekton-upgrade-notes, devops-tool-report-troubleshoot, devops-ui-e2e-code-audit, devops-ui-e2e-fix-base-on-report, devops-ui-e2e-regression-and-fix, devops-ui-generate-e2e-from-feature, devops-ui-pre-setup, devops-upgrade-go, devops-upstream-backport-cve, devops-upstream-upgrade

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 alaudabot 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.

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.

@yhuan123 yhuan123 merged commit b92d366 into AlaudaDevops:main May 11, 2026
9 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.

4 participants