Skip to content

#296 Status should be colored for kcctl get connectors#301

Merged
C0urante merged 1 commit into
kcctl:mainfrom
harveyyue:kcctl-296
Jun 7, 2023
Merged

#296 Status should be colored for kcctl get connectors#301
C0urante merged 1 commit into
kcctl:mainfrom
harveyyue:kcctl-296

Conversation

@harveyyue

Copy link
Copy Markdown
Contributor

Refer #296

@harveyyue harveyyue force-pushed the kcctl-296 branch 3 times, most recently from 01fb21e to b829fa9 Compare December 28, 2022 05:56
}))
.map(String::trim)
.containsExactly(
"NAME TYPE STATE TASKS",

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.

It looks like we're falling prey to freva/ascii-table#21 here, where ANSI escape codes are being treated as visible non-zero-width characters by the ASCII table library when determining how to space out its headers.

Could we use the Styler interface introduced in freva/ascii-table@0cd4887 to add color to state strings after the table's dimensions have already been determined?

I was initially tempted to suggest sticking with the current String::replace approach, but that fails when connectors' names match state names.

@C0urante C0urante 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.

Thanks @harveyyue! Tested this out locally and it works pretty nicely. One thought about the implications w/r/t ASCII table dimensions but apart from that this is good to go.

@gunnarmorling

Copy link
Copy Markdown
Collaborator

Hey @harveyyue, any thoughts on Chris' comments above?

@harveyyue harveyyue force-pushed the kcctl-296 branch 5 times, most recently from c742184 to afd844d Compare May 29, 2023 03:22
@harveyyue

harveyyue commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

@gunnarmorling @C0urante
Done with following improves:

  1. Implement Styler interface to get connectors command
  2. Fix unit test case fairure with missing property admin.bootstrap.servers for source connector MirrorHeartbeatConnector

@C0urante C0urante 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.

Thanks @harveyyue, this looks great! Two small questions about the integration tests but apart from that everything LGTM.

Comment thread src/main/java/org/kcctl/command/GetConnectorsCommand.java
Comment thread src/main/java/org/kcctl/command/PatchConnectorCommand.java
Comment thread src/test/java/org/kcctl/command/ApplyCommandTest.java Outdated

@C0urante C0urante 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.

LGTM, thanks @harveyyue!

@C0urante C0urante merged commit c389627 into kcctl:main Jun 7, 2023
@gunnarmorling

gunnarmorling commented Jun 7, 2023 via email

Copy link
Copy Markdown
Collaborator

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.

3 participants