Skip to content

chore: make format golines swagger#183

Merged
wolf31o2 merged 1 commit into
mainfrom
chore/format-golines-swagger
Oct 27, 2025
Merged

chore: make format golines swagger#183
wolf31o2 merged 1 commit into
mainfrom
chore/format-golines-swagger

Conversation

@wolf31o2

@wolf31o2 wolf31o2 commented Oct 26, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced transaction reference handling by adding proper decoding and assignment of transaction IDs from UTXO data in reference lookups
  • Refactor

    • Improved code formatting and readability consistency across API, transaction building, and CLI modules for better maintainability

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@wolf31o2
wolf31o2 requested a review from a team as a code owner October 26, 2025 18:02
@coderabbitai

coderabbitai Bot commented Oct 26, 2025

Copy link
Copy Markdown

Walkthrough

The changes add transaction ID (txid) decoding to a reference loading function while reformatting error handling constructs and flag registrations across multiple files. No control flow modifications or behavioral changes occur beyond the txid field population in the reference structure.

Changes

Cohort / File(s) Summary
Reference loading functions
cmd/vpn-cli/datum_ref.go, cmd/vpn-cli/kupo_ref.go
Adds txid extraction from UTXO and assigns to database.Reference.TxId field in kupo_ref.go. Both files reformat error returns to multi-line style for readability.
CLI flag registration
cmd/vpn-cli/signup.go
Reflowed Cobra flag registration chains from single-line to multi-line format with trailing commas. No change to flag definitions, defaults, or behavior.
API error handling
internal/api/tx.go
Reformatted three fmt.Fprintf invalid request error constructs (in handleTxSignup, handleTxRenew, handleTxTransfer) to multi-line formatting without changing content or control flow.
Transaction builder error handling
internal/txbuilder/renew.go, internal/txbuilder/signup.go
Multi-line reformatting of error return statements across validation checks (region, payment address, owner address, reference data, plan selection). Error messages and semantics unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Extra attention required: cmd/vpn-cli/kupo_ref.go — verify that txid is correctly extracted from the first matching UTXO and properly assigned to the Reference structure; confirm the integration with existing datum decoding logic.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title "chore: make format golines swagger" is only partially aligned with the actual changes. The "golines" aspect is accurate—the bulk of the changes involve reformatting code across multiple files to use multi-line formatting styles. However, the "swagger" reference does not appear in any of the file summaries and seems irrelevant or off-topic. Additionally, the "chore: format" framing overlooks a meaningful functional change: the addition of transaction ID (txid) decoding in cmd/vpn-cli/kupo_ref.go, which is behavioral work beyond pure formatting. This makes the title somewhat misleading about the actual scope and nature of the changes. Consider revising the title to more accurately capture the scope. A more precise title could be "chore: reformat code with golines style" if the changes are purely formatting, or "feat: add txid decoding and reformat code" if the txid addition is considered a notable feature. Additionally, clarify or remove the "swagger" reference unless it pertains to changes not detailed in the summary. A clearer title helps future readers understand the PR's intent at a glance.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/format-golines-swagger

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a45045d and 48c5908.

📒 Files selected for processing (6)
  • cmd/vpn-cli/datum_ref.go (1 hunks)
  • cmd/vpn-cli/kupo_ref.go (3 hunks)
  • cmd/vpn-cli/signup.go (1 hunks)
  • internal/api/tx.go (3 hunks)
  • internal/txbuilder/renew.go (2 hunks)
  • internal/txbuilder/signup.go (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
internal/txbuilder/renew.go (1)
internal/txbuilder/txbuilder.go (1)
  • NewInputValidationError (175-179)
internal/txbuilder/signup.go (1)
internal/txbuilder/txbuilder.go (1)
  • NewInputValidationError (175-179)
🔇 Additional comments (8)
cmd/vpn-cli/datum_ref.go (1)

30-32: LGTM! Formatting improvement.

The multi-line error construction improves readability without changing behavior.

internal/txbuilder/renew.go (2)

72-74: LGTM! Formatting improvement.

Multi-line error construction improves readability without changing behavior.


138-140: LGTM! Formatting improvement.

Multi-line error construction improves readability without changing behavior.

internal/api/tx.go (1)

86-90: LGTM! Consistent formatting improvement.

The multi-line fmt.Fprintf calls improve readability across all three handlers without changing behavior.

Also applies to: 163-167, 237-241

cmd/vpn-cli/signup.go (1)

34-56: LGTM! Formatting improvement.

The multi-line flag registrations improve readability without changing flag definitions or behavior.

internal/txbuilder/signup.go (1)

53-55: LGTM! Formatting improvement.

The multi-line error constructions improve readability without changing behavior.

Also applies to: 65-67, 74-76, 101-103, 142-144

cmd/vpn-cli/kupo_ref.go (2)

27-29: LGTM! Formatting improvement.

The multi-line function signatures and error constructions improve readability without changing behavior.

Also applies to: 48-50, 53-57, 64-67, 83-86, 93-95


72-75: LGTM! Transaction ID decoding added correctly.

The txid is now properly decoded from the first matching UTXO and populated in the Reference struct. Error handling is appropriate.

Also applies to: 118-118


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

@wolf31o2
wolf31o2 merged commit 39dd4ee into main Oct 27, 2025
10 checks passed
@wolf31o2
wolf31o2 deleted the chore/format-golines-swagger branch October 27, 2025 15:05
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.

2 participants