Skip to content

v0.9.0 compliance: full upgrade against core/go reference#3

Open
Snider wants to merge 1 commit intomainfrom
dev
Open

v0.9.0 compliance: full upgrade against core/go reference#3
Snider wants to merge 1 commit intomainfrom
dev

Conversation

@Snider
Copy link
Copy Markdown
Contributor

@Snider Snider commented Apr 28, 2026

Brings this repo to verdict: COMPLIANT against the v0.9.0 audit.

🤖 Generated with Claude Code + Codex
Co-Authored-By: Codex noreply@openai.com
Co-Authored-By: Virgil virgil@lethean.io

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling in resource cleanup operations to ensure closure failures are properly reported to callers rather than being silently ignored

bash /tmp/v090/audit.sh . → verdict: COMPLIANT (all 7 dimensions zero).
go test -count=1 ./... → all green.

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Virgil <virgil@lethean.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

Multiple files update the core package import path from dappco.re/go/core to dappco.re/go. Additionally, error handling is enhanced in cdp.go and webview.go to capture and propagate cleanup errors rather than discarding them. The go.mod file is updated with new dependency requirements and a replace directive.

Changes

Cohort / File(s) Summary
Core import path updates
actions.go, angular.go, audit_issue2_test.go, console.go
Core package import path changed from dappco.re/go/core to dappco.re/go with all existing usages remaining unchanged.
Import path and error handling improvements
cdp.go
Core import path updated. CloseTab now uses named return error and propagates c.Close() failures to caller if closeTarget succeeded. doDebugRequest uses named return values to capture and return errors from resp.Body.Close().
Import path and cleanup error propagation
webview.go
Core import path updated. cleanupOnError now returns wv.client.Close() error instead of discarding it. Cleanup errors are joined with original failures in returned error.
Dependency manifest
go.mod
dappco.re/go/core requirement replaced with dappco.re/go at version v0.9.0. New replace directive for dappco.re/go/log pointing to github.com/dappcore/go-log at v0.8.0-alpha.1.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'v0.9.0 compliance: full upgrade against core/go reference' accurately reflects the main change: upgrading package imports from dappco.re/go/core to dappco.re/go across multiple files to achieve v0.9.0 compliance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cdp.go`:
- Around line 389-390: Replace the plain assignment of the deferred close error
with a wrapped coreerr.E call in the CDPClient.CloseTab deferred block: when
closeErr := c.Close(); closeErr != nil && err == nil, set err =
coreerr.E("CDPClient.CloseTab", "failed to close tab connection", closeErr)
(referencing the CDPClient.CloseTab scope and the c.Close() call) so the
returned error preserves scope/context per logging guidelines.
- Around line 642-643: When handling a non-nil closeErr from resp.Body.Close()
inside CDPClient.doDebugRequest, do not assign closeErr directly to err; instead
wrap it with coreerr.E using the scope "CDPClient.doDebugRequest" and a short
description (e.g., "closing response body") and assign that wrapped error to err
so traceability is preserved; ensure you import/use coreerr.E exactly as
required by go-log and only wrap closeErr when err == nil to avoid losing the
original error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af27d81a-f205-4e37-a305-7e41393cd305

📥 Commits

Reviewing files that changed from the base of the PR and between cebeee0 and 419ce9a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • actions.go
  • angular.go
  • audit_issue2_test.go
  • ax7_triplets_test.go
  • cdp.go
  • console.go
  • go.mod
  • webview.go

Comment thread cdp.go
Comment on lines +389 to +390
if closeErr := c.Close(); closeErr != nil && err == nil {
err = closeErr
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Wrap deferred close errors with CDPClient.CloseTab scope.

The defer currently returns closeErr directly, which drops local scope context on this return path.

Proposed fix
 	defer func() {
 		if closeErr := c.Close(); closeErr != nil && err == nil {
-			err = closeErr
+			err = coreerr.E("CDPClient.CloseTab", "failed to close client after closing target", closeErr)
 		}
 	}()

As per coding guidelines "Wrap errors with coreerr.E("Scope.Method", "description", err) from go-log, never use fmt.Errorf".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if closeErr := c.Close(); closeErr != nil && err == nil {
err = closeErr
defer func() {
if closeErr := c.Close(); closeErr != nil && err == nil {
err = coreerr.E("CDPClient.CloseTab", "failed to close client after closing target", closeErr)
}
}()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cdp.go` around lines 389 - 390, Replace the plain assignment of the deferred
close error with a wrapped coreerr.E call in the CDPClient.CloseTab deferred
block: when closeErr := c.Close(); closeErr != nil && err == nil, set err =
coreerr.E("CDPClient.CloseTab", "failed to close tab connection", closeErr)
(referencing the CDPClient.CloseTab scope and the c.Close() call) so the
returned error preserves scope/context per logging guidelines.

Comment thread cdp.go
Comment on lines +642 to +643
if closeErr := resp.Body.Close(); closeErr != nil && err == nil {
err = closeErr
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Wrap resp.Body.Close failures with CDPClient.doDebugRequest scope.

Assigning err = closeErr directly returns an unscoped error and weakens traceability from this function boundary.

Proposed fix
 	defer func() {
 		if closeErr := resp.Body.Close(); closeErr != nil && err == nil {
-			err = closeErr
+			err = coreerr.E("CDPClient.doDebugRequest", "failed to close debug endpoint response body", closeErr)
 		}
 	}()

As per coding guidelines "Wrap errors with coreerr.E("Scope.Method", "description", err) from go-log, never use fmt.Errorf".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if closeErr := resp.Body.Close(); closeErr != nil && err == nil {
err = closeErr
if closeErr := resp.Body.Close(); closeErr != nil && err == nil {
err = coreerr.E("CDPClient.doDebugRequest", "failed to close debug endpoint response body", closeErr)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cdp.go` around lines 642 - 643, When handling a non-nil closeErr from
resp.Body.Close() inside CDPClient.doDebugRequest, do not assign closeErr
directly to err; instead wrap it with coreerr.E using the scope
"CDPClient.doDebugRequest" and a short description (e.g., "closing response
body") and assign that wrapped error to err so traceability is preserved; ensure
you import/use coreerr.E exactly as required by go-log and only wrap closeErr
when err == nil to avoid losing the original error.

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.

1 participant