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

Feature command #12014

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

danish9039
Copy link

Description

  • add features command

Link to tracking issue

Testing

  • test with make
  • test with make test

Documentation

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
@danish9039 danish9039 requested review from djaglowski and a team as code owners January 4, 2025 22:02
Copy link

linux-foundation-easycla bot commented Jan 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

service/display_feature.go Outdated Show resolved Hide resolved
service/display_feature.go Outdated Show resolved Hide resolved
service/display_feature.go Outdated Show resolved Hide resolved
otelcol/command.go Outdated Show resolved Hide resolved
otelcol/command.go Outdated Show resolved Hide resolved
danish9039 and others added 2 commits January 7, 2025 02:35
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>

func newFeaturesCommand() *cobra.Command {
return &cobra.Command{
Use: "features [feature-id]",
Copy link
Member

Choose a reason for hiding this comment

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

@open-telemetry/collector-approvers do you prefer features? gates? featuregates?

Copy link
Member

Choose a reason for hiding this comment

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

features sounds better to me

Copy link
Member

Choose a reason for hiding this comment

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

I'd vote for featuregates or feature-gates since that is the full name of the thing being presented by the command. The term features could apply to something than feature gates (like the capabilities of the collector).

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

I think this needs a changelog

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.68%. Comparing base (3132112) to head (da098dc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12014      +/-   ##
==========================================
+ Coverage   91.67%   91.68%   +0.01%     
==========================================
  Files         455      455              
  Lines       24038    24072      +34     
==========================================
+ Hits        22037    22071      +34     
  Misses       1629     1629              
  Partials      372      372              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

danish9039 and others added 4 commits January 9, 2025 13:18
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Comment on lines +79 to +91
featuregate.GlobalRegistry().VisitAll(func(g *featuregate.Gate) {
if g.ID() == args[0] {
found = true
fmt.Printf("Feature: %s\n", g.ID())
fmt.Printf("Enabled: %v\n", g.IsEnabled())
fmt.Printf("Stage: %s\n", g.Stage())
fmt.Printf("Description: %s\n", g.Description())
fmt.Printf("From Version: %s\n", g.FromVersion())
if g.ToVersion() != "" {
fmt.Printf("To Version: %s\n", g.ToVersion())
}
}
})
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't block this PR, but this feature is a great use case for #7625

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.

4 participants