Skip to content

feat(api): add download-rpc package endpoints - #1279

Merged
madhavilosetty-intel merged 4 commits into
mainfrom
feat/download-rpc
Sep 23, 2026
Merged

madhavilosetty-intel merged 4 commits into
mainfrom
feat/download-rpc

Conversation

@rsdmike

@rsdmike rsdmike commented Sep 21, 2026

Copy link
Copy Markdown
Member

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical release filtering and three moderate correctness issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds authenticated RPC package download endpoints with GitHub/local release resolution, configuration generation, token packaging, ZIP creation, API routes, and tests.

Changes:

  • Adds packaging, archive, token, GitHub, and configuration logic.
  • Adds DTOs, HTTP/OpenAPI routes, validation, and Postman coverage.
  • Adds package configuration and semantic-version support.

Review findings:

  • Critical: Release filtering excludes the currently published rpc-go major version.
  • Moderate: Merged releases can exceed the five-release limit.
  • Moderate: Token-mode packages fail under OIDC authentication.
  • Moderate: Missing local versions return 500 instead of 404.
File Description
internal/​usecase/​packaging/​token.go Token generation
internal/​usecase/​packaging/​token_test.go Token tests
internal/​usecase/​packaging/​scheme_test.go Scheme tests
internal/​usecase/​packaging/​packaging.go Packaging workflow
internal/​usecase/​packaging/​packaging_test.go Packaging tests
internal/​usecase/​packaging/​interface.go Packaging interfaces
internal/​usecase/​packaging/​github.go GitHub release resolution
internal/​usecase/​packaging/​github_test.go GitHub tests
internal/​usecase/​packaging/​config.go Generated configuration
internal/​usecase/​packaging/​config_test.go Configuration tests
internal/​usecase/​packaging/​archive.go ZIP archive creation
internal/​usecase/​packaging/​archive_test.go Archive tests
internal/​entity/​github/​release.go GitHub download URL
internal/​entity/​dto/​v1/​package.go Package DTOs
internal/​entity/​dto/​v1/​package_test.go DTO validation tests
internal/​controller/​openapi/​package.go OpenAPI declarations
internal/​controller/​openapi/​adapter.go OpenAPI route registration
internal/​controller/​httpapi/​v1/​package.go Package HTTP handlers
internal/​controller/​httpapi/​v1/​package_test.go Handler tests
internal/​controller/​httpapi/​v1/​error.go Packaging error mappings
internal/​controller/​httpapi/​router.go Package route registration
integration-test/​collections/​console_rps_apis.postman_collection.json Package API requests
go.mod Semantic-version dependency
config/​config.yml Package defaults
config/​config.go Package settings and validation
config/​config_test.go Configuration validation tests
.env.example Package environment documentation

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/usecase/packaging/github.go
Comment thread internal/usecase/packaging/packaging.go
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.21283% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.48%. Comparing base (6ab185c) to head (b52dc17).

Files with missing lines Patch % Lines
internal/usecase/packaging/packaging.go 86.95% 15 Missing ⚠️
internal/usecase/packaging/archive.go 80.00% 12 Missing ⚠️
internal/usecase/packaging/github.go 91.66% 6 Missing ⚠️
internal/controller/openapi/package.go 86.66% 2 Missing ⚠️
internal/controller/httpapi/router.go 0.00% 1 Missing ⚠️
internal/usecase/packaging/config.go 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1279      +/-   ##
==========================================
+ Coverage   60.73%   61.48%   +0.75%     
==========================================
  Files         151      158       +7     
  Lines       12632    12975     +343     
==========================================
+ Hits         7672     7978     +306     
- Misses       4959     4996      +37     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Groundwork for Download RPC; nothing calls it yet.

- List v3+ rpc-go releases from GitHub (newest five) or from a local
  <dir>/<version>/ cache, sorted newest first
- Match rpc-go's published builds, rpc_linux_<arch>.tar.gz and
  rpc_windows_<arch>.exe
- Take the binary from the bare .exe or the tarball's single entry,
  capped at 200 MiB
- Assemble the download zip holding the binaries and config.yaml
- Add the package request/release DTOs and the asset download URL
Builds the Download RPC zip; not yet exposed over HTTP.

- Resolve the requested build from GitHub, falling back to
  package.local_dir
- package.disable_fetch serves builds from local_dir only; with fetching
  on, GitHub releases list first, then local-only versions
- Render rpc-go's config.yaml for activate or deactivate with token,
  userpass, or no embedded credentials, scoped to the caller's tenant
- Mint the auth token with a requested lifetime capped by
  package.max_token_ttl; no token is minted when auth is disabled
- Point rpc-go at the request's serverUrl or the listener address, and
  skip cert checks when the listener serves a generated certificate
- Package the Windows and Linux builds together for os "both"
- GET /api/package/rpc-versions lists the rpc-go releases available to
  package
- POST /api/package returns a zip with the rpc-go binary and a
  config.yaml pointing at this Console
- Map missing assets to 404 and unsafe versions and out-of-range token
  lifetimes to 400
- Declare both routes in OpenAPI and add Postman requests
@madhavilosetty-intel
madhavilosetty-intel merged commit dd4709f into main Sep 23, 2026
22 checks passed
@madhavilosetty-intel
madhavilosetty-intel deleted the feat/download-rpc branch September 23, 2026 22:44
@RosieAMT

Copy link
Copy Markdown

🎉 This PR is included in version 1.43.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants