Skip to content

fix(kafka create): run interactive if no name provided and fix typos#705

Merged
rkpattnaik780 merged 4 commits intomainfrom
kafka_create_interactive
Jun 11, 2021
Merged

fix(kafka create): run interactive if no name provided and fix typos#705
rkpattnaik780 merged 4 commits intomainfrom
kafka_create_interactive

Conversation

@rkpattnaik780
Copy link
Contributor

  • Open interactive mode when rhoas kafka create is run with flags but no name.
  • Fix faulty error message while filtering consumergroups by topic.

Closes #703, #704

Verification Steps

  1. Run rhoas kafka create --provider aws, it should open the interactive mode.
  2. Run rhoas kafka consumergroup list --topic <topic-name> where the topic has no associated consumergroup, it should display the message Kafka instance "<instance name>" has no consumer groups for topic "<topic-name>"

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@craicoverflow
Copy link
Contributor

image

It looks like the Closing keyword does not link multiple issues automatically. In this case you can manually link them in the side bar.

@craicoverflow craicoverflow self-requested a review June 8, 2021 08:09
Copy link
Contributor

@craicoverflow craicoverflow left a comment

Choose a reason for hiding this comment

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

When I pass the --provider flag, it will re-prompt me to enter the provider value in the interactive prompt:

❯ ./rhoas kafka create --provider aws
? Name: my-kafka
? Cloud Provider:  [Use arrows to move, type to filter]
> aws

The way it was (supposed to be) working before now was as follows:

If no name argument is passed, and any value flag is passed, such as provider, then throw an error as the user is trying to mix interactive with non-interactive Kafka creation.

I think that this is more maintainable in the long run, and I believe it is consistent with the other create commands (not sure though).

@rkpattnaik780
Copy link
Contributor Author

I think that this is more maintainable in the long run, and I believe it is consistent with the other create commands (not sure though).

Had used topic create as a reference. We should update that one later as well.
Screenshot from 2021-06-09 16-06-18

one = 'name is required. Run "rhoas kafka create <name>"'

[kafka.create.flags.notAllowedWhenInteractive]
one = 'region and provider flags not allowed for interactive Kafka instance creation'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggestion for a better error message @craicoverflow ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Swap it round like something like this: "name" argument is required when creating a Kafka instance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to 'name is required. Run "rhoas kafka create <name>"'

@rkpattnaik780 rkpattnaik780 force-pushed the kafka_create_interactive branch from fc3b6a9 to 1f41972 Compare June 10, 2021 06:35
@rkpattnaik780 rkpattnaik780 merged commit a969d86 into main Jun 11, 2021
@rkpattnaik780 rkpattnaik780 deleted the kafka_create_interactive branch June 11, 2021 06:56
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.

Erroneous message shown when no consumergroups are available for a topic rhoas kafka create should prompt for name if not provided

2 participants