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

feat(flink): Describe command for Flink Jobs #758

Merged
merged 4 commits into from
Jun 1, 2023

Conversation

janelletavares
Copy link
Contributor

@janelletavares janelletavares commented May 31, 2023

Description of change

Fixes https://github.com/meroxa/turbine-project/issues/289

Type of change

  • New feature
  • Bug fix
  • Refactor
  • Documentation

How was this tested?

  • Unit Tests
  • Tested in staging
  • Tested in minikube

Demo

Screenshot from 2023-05-31 16-34-50

Additional references

Documentation updated

Copy link
Contributor

@samirketema samirketema left a comment

Choose a reason for hiding this comment

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

looks great!

Copy link
Contributor

@jayjayjpg jayjayjpg left a comment

Choose a reason for hiding this comment

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

This reads great! I only left a few more questions to understand the feature better, but otherwise this is already good to go -- thank you for the super quick iteration! ✨

_ builder.CommandWithSubCommands = (*Job)(nil)
_ builder.CommandWithFeatureFlag = (*Job)(nil)
_ builder.CommandWithHidden = (*Job)(nil)
)

func (*Job) Usage() string {
return "flink"
return "jobs"
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the quick rename here as well!

},
{
{Align: simpletable.AlignRight, Text: "Input Streams:"},
{Text: strings.Join(flinkJob.InputStreams, ", ")},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this how you can parse a list into a comma-separated string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is the standard way to combine a slice of strings. Ilike spew.Sdump formatting for complicated structs, but this slice is simple

})
}

if flinkJob.Status.ReconciliationState != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

These guard checks are helpful for filtering out empty values, I'll keep this in mind for future CLI work as well

@@ -85,8 +85,8 @@ func verifyPrintFlinkJobsOutput(t *testing.T, out string, flinkJob *meroxa.Flink
if !strings.Contains(out, flinkJob.UUID) {
t.Errorf("%s, not found", flinkJob.UUID)
}
if !strings.Contains(out, string(flinkJob.Status.State)) {
t.Errorf("state %s, not found", flinkJob.Status.State)
if !strings.Contains(out, string(flinkJob.Status.LifecycleState)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand it correctly, that for this phase of the work LifecycleState is the best representation of a flink job's state? Is it, because State will not be populated for now since the state computation will be implemented in a later stage of the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's our best guess for the time being, and it may change soon. I am looking forward to having one calculated state value, but we just don't know enough to do that yet.

@janelletavares janelletavares merged commit 265a14c into master Jun 1, 2023
@janelletavares janelletavares deleted the flink-jobs-describe branch June 1, 2023 17:09
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