Skip to content

Conversation

@adrianosela
Copy link

@adrianosela adrianosela commented May 12, 2025

[ME-4536] Improve Proxy Code Quality

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to improve proxy code quality by refactoring logging and debugging implementations and cleaning up legacy debug flags. Key changes include:

  • Removal and replacement of raw fmt debug statements with structured logger calls.
  • Refactoring of the ServerSession structure to encapsulate logger, tdsSession, and a dedicated debug flag.
  • Simplification of buffer read functionality by removing the fallback options from BeginRead.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
token.go Removed redundant debug logging calls using fmt statements in token parsing.
tds.go Eliminated the border0DebugLogs field to streamline session configuration.
proxy.go Refactored ServerSession to include dedicated logger/debug, updated logging usage, and shifted session-related methods to ServerSession.
buf.go Simplified the BeginRead function by removing legacy options and commented code.

// FIXME: REMOVE
if s.border0DebugLogs {
fmt.Printf("Start ReadCommand: %s rpos=%d, rsize=%d\n", s.id, s.buf.rpos, s.buf.rsize)
// FIXME: remove
Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

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

[nitpick] Remove leftover 'FIXME: remove' comments to ensure production code is clean and free of debugging artifacts.

Suggested change
// FIXME: remove

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

nope, until we are done with mssql dev-ing we will have FIXMEs and debug logs.

@adrianosela adrianosela merged commit 321d48e into main May 12, 2025
1 of 5 checks passed
Copy link

@th3wingman th3wingman left a comment

Choose a reason for hiding this comment

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

🚢

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