Skip to content

refac: Update harbor package and health check - #616

Open
vg006 wants to merge 4 commits into
container-registry:mainfrom
vg006:refac/health
Open

refac: Update harbor package and health check#616
vg006 wants to merge 4 commits into
container-registry:mainfrom
vg006:refac/health

Conversation

@vg006

@vg006 vg006 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR removes the harborhealth package under Ground Control and merges it into the existing harbor package. This gives us to reuse the existing go-client SDK for communicating with Harbor. So the same client could be used for health check operations.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a Harbor health check during startup.
    • Reports unavailable or unhealthy required Harbor components, including component-level errors.
    • Health checks can be skipped through configuration and use a five-second timeout.
  • Bug Fixes

    • Improved startup validation by using the Harbor health endpoint and handling unsuccessful or malformed responses.

Signed-off-by: vg006 <devvg006@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@vg006, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b9c9f713-fbad-4dd1-bcb9-e55da5ed474b

📥 Commits

Reviewing files that changed from the base of the PR and between fd58092 and 09e9513.

📒 Files selected for processing (1)
  • internal/groundcontrol/harbor/health.go
📝 Walkthrough

Walkthrough

The Harbor health check moved from harborhealth into harbor. The implementation preserves skip configuration, timeout handling, optional-component filtering, and unhealthy-component reporting. The Ground Control server now calls harbor.CheckHealth().

Changes

Harbor health integration

Layer / File(s) Summary
Harbor health-check implementation
internal/groundcontrol/harbor/health.go
Adds CheckHealth with configurable skipping, a five-second timeout, Harbor health API requests, optional-component filtering, and error reporting for unhealthy required components.
Startup health-check wiring
cmd/groundcontrol/server/main.go
Replaces the harborhealth import and updates the startup call to harbor.CheckHealth().

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR moves the health check and preserves startup policies, but the required focused tests are not present in the changeset. Add focused tests for healthy responses, failures, ignored components, request errors, timeouts, and skipped health checks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Harbor package and health-check update, which matches the primary change.
Description check ✅ Passed The description includes the required issue reference and explains the package merge and SDK reuse; only the optional context section is absent.
Out of Scope Changes check ✅ Passed The changes are limited to moving Harbor health-check functionality, updating its caller, and removing the obsolete harborhealth package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gitar-bot

gitar-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

@codacy-production

codacy-production Bot commented Aug 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 16 complexity · 0 duplication

Metric Results
Complexity 16
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@341cb42). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/groundcontrol/harbor/health.go 0.00% 38 Missing ⚠️
cmd/groundcontrol/server/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #616   +/-   ##
=======================================
  Coverage        ?   20.21%           
=======================================
  Files           ?      130           
  Lines           ?    14084           
  Branches        ?        0           
=======================================
  Hits            ?     2847           
  Misses          ?    10959           
  Partials        ?      278           
Flag Coverage Δ
unittests 20.21% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/groundcontrol/harbor/health.go Outdated
Comment thread internal/groundcontrol/harbor/health.go Outdated
Signed-off-by: vg006 <devvg006@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/groundcontrol/harbor/health.go Outdated
Signed-off-by: vg006 <devvg006@gmail.com>

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
internal/groundcontrol/harbor/health.go (1)

24-75: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add health-check tests for healthy, unhealthy, ignored, request-error, five-second timeout, and SKIP_HARBOR_HEALTH_CHECK cases.

🤖 Prompt for 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.

In `@internal/groundcontrol/harbor/health.go` around lines 24 - 75, Add focused
tests for CheckHealth and checkHealth covering healthy components, unhealthy
components, ignored components, request errors, the default five-second timeout,
and SKIP_HARBOR_HEALTH_CHECK=true. Use the existing Harbor health client/API
seams and environment configuration symbols to verify each outcome without
changing production behavior.
🤖 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.

Nitpick comments:
In `@internal/groundcontrol/harbor/health.go`:
- Around line 24-75: Add focused tests for CheckHealth and checkHealth covering
healthy components, unhealthy components, ignored components, request errors,
the default five-second timeout, and SKIP_HARBOR_HEALTH_CHECK=true. Use the
existing Harbor health client/API seams and environment configuration symbols to
verify each outcome without changing production behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b41f353-995a-4535-8233-316039fe7335

📥 Commits

Reviewing files that changed from the base of the PR and between 341cb42 and fd58092.

📒 Files selected for processing (4)
  • cmd/groundcontrol/server/main.go
  • internal/groundcontrol/harbor/health.go
  • internal/groundcontrol/harborhealth/check.go
  • internal/groundcontrol/harborhealth/types.go
💤 Files with no reviewable changes (2)
  • internal/groundcontrol/harborhealth/check.go
  • internal/groundcontrol/harborhealth/types.go

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/groundcontrol/harbor/health.go">

<violation number="1" location="internal/groundcontrol/harbor/health.go:31">
P2: This change silently disables TLS certificate verification for the Harbor health check. NewClientSet with Insecure unset leaves the transport nil, and go-client's ToV2Config falls back to InsecureTransport (InsecureSkipVerify: true), whereas the previous v2client.New call used go-openapi's default secure transport. Set ClientSetConfig.Insecure explicitly to preserve the earlier verifying behavior.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread internal/groundcontrol/harbor/health.go Outdated
Signed-off-by: vg006 <devvg006@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread internal/groundcontrol/harbor/health.go
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.

Merge Harbor health into the Harbor package

1 participant