Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KC: Make it possible to validate KC config #682

Open
2 tasks done
yeikel opened this issue Nov 27, 2024 · 8 comments
Open
2 tasks done

KC: Make it possible to validate KC config #682

yeikel opened this issue Nov 27, 2024 · 8 comments
Labels
area/connect Kafka Connect, its connectors scope/backend Related to backend changes scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature

Comments

@yeikel
Copy link
Contributor

yeikel commented Nov 27, 2024

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

While creating of changing the configuration for connectors, it is often valuable to validate the configuration first before attempting to submit it. The current UI does not expose that feature

Describe the feature you're interested in

We should add a "Validate" button next to the "Submit button" that calls the /validate/ endpoint of Kafka Connect

Describe alternatives you've considered

Option 1 : Call the API manually
Option 2: Create the connector and pause it afterwards (not ideal)

Version you're running

c8a8759

Additional context

No response

@yeikel yeikel added status/triage Issues pending maintainers triage type/feature A brand new feature labels Nov 27, 2024
@kapybro kapybro bot added status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Nov 27, 2024
@DimaVilda
Copy link
Contributor

In that case we need to have 'validate' button for each case we send something custom to kafka on ui.
I.e. before click on 'Produce message' we should also validate our json message?

@yeikel
Copy link
Contributor Author

yeikel commented Dec 22, 2024

In that case we need to have 'validate' button for each case we send something custom to kafka on ui. I.e. before click on 'Produce message' we should also validate our json message?

I think that is a different use case that I cannot comment on. The original issue refers to Kafka Connect specifically where that is highly advised by the REST API validation error messages themselves

See https://github.com/apache/kafka/blob/b4be1785998d382843002ffd8685d67fe8d9c97d/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java#L1062-L1067

@DimaVilda
Copy link
Contributor

for sure this is a different use case from backend point but we are talking about UI first so imho this is not good practice from UX perspective:
You have a design system, right? Then in this system you use components (submit/send buttons under a text frame). In case you add a new button just in connector component this component becomes not repeatable for other places (sumbit/send button under a text frame).
As a user I can have a question: why do we have a 'Validate' button in connectors and we don't have similar button in another places ?
Hope you understand my point.

Also if you still ok to implement such approach I can do it

@yeikel
Copy link
Contributor Author

yeikel commented Dec 23, 2024

As a user I can have a question: why do we have a 'Validate' button in connectors and we don't have similar button in another places ? Hope you understand my point.

I see your point about wanting to provide a consistent submission experience across all pages. However, the reason for this discrepancy is that the Kafka Connect REST API already supports validation out of the box, whereas other Kafka configuration endpoints may not (to be fair, I’m not entirely sure if it does). Because of this, the work required on our end to integrate with an existing validate endpoint for Connect is minimal while for Kafka as a platform sounds like a much bigger ask.

How do you propose we implement a validate endpoint for the other pages? Are you suggesting creating a manual set of validation methods? If so, that could become a long-term maintenance challenge. On the other hand, if the Kafka SDK offers a built-in way to validate configurations before submission, leveraging that would make more sense.

@DimaVilda
Copy link
Contributor

thank you for explanation @yeikel ! It's important for me because I just started to figure out with this project. In that case we have to:

  1. Add 'Validate' button and I propose make 'Sumbit' unclickable (grey) until user clicks on 'Validate'
  2. After clicking on 'Validate' in case validation is successful 'Submit' button becomes available.

Question: do we keep same error messages on UI like now in case validation is not correct? I.e. now in case of incorrect validation we get '400 validation incorrect'

@yeikel
Copy link
Contributor Author

yeikel commented Dec 31, 2024

I propose make 'Submit' unclickable (grey) until user clicks on 'Validate'

While I understand your intentions, this may not be needed because it would add unnecessary steps for users that know for "a fact" that their configuration is correct.

In my opinion, the validate button should behave independently to the submit button and serve as an aid for users that are still experimenting with configurations before submitting.

Ultimately, the "Submit" button will validate invalid configurations

Question: do we keep same error messages on UI like now in case validation is not correct? I.e. now in case of incorrect validation we get '400 validation incorrect'

This is no longer true, we are passing more context after #705

The newly introduced "Validate" button should do something similar and expose the message that the validate endpoint returns

@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/frontend Related to frontend changes scope/backend Related to backend changes area/connect Kafka Connect, its connectors and removed type/feature A brand new feature status/triage/manual Manual triage in progress labels Dec 31, 2024
@Haarolean
Copy link
Member

I don't quite get the point of having a validate button present if one can just click submit and in case of an invalid config, get an error :) But anyway I don't mind this enhancement

@Haarolean Haarolean changed the title Expose "Validate" endpoint in Kafka Connect UI KC: Make it possible to validate KC config Dec 31, 2024
@Haarolean Haarolean moved this to Todo in Up for grabs Dec 31, 2024
@yeikel
Copy link
Contributor Author

yeikel commented Dec 31, 2024

I don't quite get the point of having a validate button present if one can just click submit and in case of an invalid config, get an error :) But anyway I don't mind this enhancement

The point of the validate button is to validate a configuration but don't submit it yet. This is very useful to make sure that a connector configuration is valid before actually putting the connector in place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connect Kafka Connect, its connectors scope/backend Related to backend changes scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
Status: Todo
Development

No branches or pull requests

3 participants