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

Add flag to select the kibana version in elastic-package status #590

Merged
merged 3 commits into from
Nov 18, 2021

Conversation

jsoriano
Copy link
Member

With this flag elastic-package status can be used to check the versions
available of a package for a given version of the stack.

For example:

$ elastic-package status apache --version 8.0.0
Package: apache
Package Versions:
+-------------+---------+---------+--------------------+--------------------------------+
| ENVIRONMENT | VERSION | RELEASE |       TITLE        |          DESCRIPTION           |
+-------------+---------+---------+--------------------+--------------------------------+
| Snapshot    | 1.3.0   | ga      | Apache HTTP Server | Collect logs and metrics from  |
|             |         |         |                    | Apache servers with Elastic    |
|             |         |         |                    | Agent.                         |
+-------------+---------+---------+--------------------+--------------------------------+
| Staging     | -       | -       | -                  | -                              |
+-------------+---------+---------+--------------------+--------------------------------+
| Production  | -       | -       | -                  | -                              |
+-------------+---------+---------+--------------------+--------------------------------+

@jsoriano jsoriano added the Team:Ecosystem Label for the Packages Ecosystem team label Nov 17, 2021
@jsoriano jsoriano requested a review from a team November 17, 2021 13:33
@jsoriano jsoriano self-assigned this Nov 17, 2021
@ruflin
Copy link
Contributor

ruflin commented Nov 17, 2021

Nice. Later this could also be expanded that elastic-package status apache --info=kibana.version and it adds a column with the kibana.version value. This could be used for other fields too which might be interesting.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 17, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-17T18:06:16.274+0000

  • Duration: 31 min 33 sec

  • Commit: 1e9f413

Test stats 🧪

Test Results
Failed 0
Passed 452
Skipped 4
Total 456

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

cmd/status.go Outdated
@@ -37,6 +37,7 @@ func setupStatusCommand() *cobraext.Command {
RunE: statusCommandAction,
}
cmd.Flags().BoolP(cobraext.ShowAllFlagName, "a", false, cobraext.ShowAllFlagDescription)
cmd.Flags().String(cobraext.StackVersionFlagName, "", cobraext.StackVersionFlagDescription)
Copy link
Contributor

Choose a reason for hiding this comment

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

This flag might be misleading here. In elastic-package status apache --version 8.0.0 the version flag may suggest that this is Apache 8.0.0, not Kibana.

What do you think about replacing it with --kibana-version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or kibana.version? Thinking of it as the filters you can apply on epr, for example https://epr.elastic.co/search?experimental=true&kibana.version=8.0.0 It would become a more generic feature ...

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that --kibana-version will look more like a command option. I haven't seen options with dots, I guess it's a standard?

But calling for a query is also an option: --query="kibana.version=8.0.0".

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW do we really need the experimental flag? It's always enabled...

Copy link
Member Author

Choose a reason for hiding this comment

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

I used --version because it is the flag used to specify the stack version in the stack subcomand, but I see how it can be confusing here.

I have opted for --kibana-version, I also prefer it to the version with the dot. How the kibana version is finally encoded in the query is an implementation detail.

But calling for a query is also an option: --query="kibana.version=8.0.0".

--kibana-version covers a very specific use case, so I prefer to have a specific flag for that. Also, package developers don't need to know the registry API to use this command, so I don't think we need generic options by now.

Humans needing to write url query parameters is a call for problems.

I haven't seen options with dots, I guess it's a standard?

This is not very common, but I am pretty sure it is possible to have options with dots, take a look to metricbeat --help 🙂

BTW do we really need the experimental flag? It's always enabled...

I hope we can get rid of this soon elastic/package-spec#225 🔥

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adjusting this!

@mtojek mtojek self-requested a review November 18, 2021 08:08
@jsoriano jsoriano merged commit 5780966 into elastic:master Nov 18, 2021
@jsoriano jsoriano deleted the status-kibana-version branch November 18, 2021 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants