Skip to content

Conversation

@jem-davies
Copy link
Collaborator

@jem-davies jem-davies commented Oct 15, 2025

Bento components have an associated 'Status', that can take the value of "stable", "beta", "experimental" & "deprecated". Currently the only way a user of Bento would understand they were using a "beta" / "experimental" component is if they have seen the warning on the component's doc page.

This PR will add an additional type of Lint Warning such that when a "beta" or "experimental" component is parsed, we will emit a Warning log, users will be able to silence these warnings with additional options --allow-beta & --allow-experimental.

In a future major update to Bento, we could alter this behaviour so that Bento will not execute a stream with "experimental" or "beta" components, unless explicitly allowed by the user.

This PR will add warning logs when a stream is created via:

  • bento 'normal mode' bento -c config.yaml
  • bento components loaded via a resource file
  • creation of streams via REST API
  • bento 'streams mode' bento streams ./*.yaml
  • watching config files
  • bento lint ...

In a follow up PR I will alter the StreamBuilder API to allow modifying if we will log warnings for experimental / beta components.

@jem-davies jem-davies changed the title add warning logs for experimental & beta components; add cli options … add warning logs for experimental & beta components Oct 15, 2025
@jem-davies jem-davies force-pushed the add-flags-allow-experimental-beta branch 2 times, most recently from c8cee1d to 8f369ec Compare October 23, 2025 08:36
@jem-davies jem-davies marked this pull request as ready for review October 23, 2025 08:36
@jem-davies jem-davies force-pushed the add-flags-allow-experimental-beta branch from 8f369ec to 57d659d Compare October 23, 2025 08:51
@jem-davies
Copy link
Collaborator Author

Expecting the test github action to fail - but it would be fixed by: #508

Signed-off-by: Jem Davies <jemsot@gmail.com>
@jem-davies jem-davies force-pushed the add-flags-allow-experimental-beta branch from 57d659d to 3b92545 Compare October 28, 2025 14:23
@jem-davies
Copy link
Collaborator Author

@gregfurman - this is ready for review 🙏

Comment on lines +359 to +361
if code := common.RunService(c, opts, true); code != 0 {
os.Exit(code)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the change here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

iirc - I added a new test - but that test would always fail because it would call os.Exit - now providing that the code returned isn't 0 we just let the go program terminate without calling os.Exit allowing the test to run

Comment on lines +275 to +282
err := service.RegisterInput(
"deprecated",
service.NewConfigSpec().Deprecated(),
func(conf *service.ParsedConfig, mgr *service.Resources) (service.Input, error) {
return deprecatedInputComponent{}, nil
},
)
require.NoError(t, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rather do this against a local version of the environment? Unsure we should be testing against the global one.

Usage: "Whether HTTP endpoints registered by stream configs should be prefixed with the stream ID",
},
},
Flags: streamModeFlags(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

How come we moved this out to its own function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just thought it would be more tidy then the mixed approach we have with the flags at the moment.

docs: $(APPS) $(TOOLS)
@$(PATHINSTTOOLS)/bento_docs_gen $(DOCS_FLAGS)
@$(PATHINSTBIN)/bento lint --deprecated "./config/examples/*.yaml" \
@$(PATHINSTBIN)/bento lint --deprecated --allow-experimental --allow-beta "./config/examples/*.yaml" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about making these opt-in instead of opt-out? Like, --disable-experimental and --disable-beta to trigger these warnings.

Given how many users are likely using experimental or beta components, I'm concerned this is going to give the wrong impression of our plugin stability 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would have liked it such that we make it so you have to --allow-experimental to even run the stream with an experimental component. So instead of the warning we fatally terminate the program. That is rather heavy-handed though so went with the LintWarn approach. (Maybe we do that in a Major version update instead).

The way the component statuses work at the moment, i.e. experimental, beta & stable - other than the doc page warning text - we don't have much else in terms of protection. And to a user I suppose there is nothing else that differentiates them.

Because of that I feel we are reluctant to make breaking changes to experimental components. I feel that with these changes as-is - we might get more feedback from the community regarding if they are using an experimental component - and also we can be more assured to accept PRs with experimental components too.

I'm concerned this is going to give the wrong impression of our plugin stability

I agree - but I think that the fix to that is to do more 'promotion' of our existing components.

We can hold this PR off for now until we are happy with the current state of component statuses.

(Also would consider removing Beta entirely as a status).

Experimental - should be for new components - that might get changed further in the near future - and also might not have as many int. tests attached to them etc.

Stable - The majority of components should just be considered stable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you think about making these opt-in instead of opt-out? Like, --disable-experimental and --disable-beta to trigger these warnings.

Feel like that approach might just bury the --disable-experimental CLI flag in the CLI help page and just won't get used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could also just add a pre-run check that retrieves the ConfigView and checks if the component in question is stable or not. Would need to add a:

// IsStable returns true if the component is marked as stable.
func (c *ConfigView) IsStable() bool {
	return c.component.Status == docs.StatusStable
}

And then we can check:

isStable := GlobalEnvironment().GetProcessorConfig(name).IsStable() // or GetInputConfig etc.
if !isStable {
   return fmt.Errorf("cannot create a processor of type %s: component is marked as unstable")
} 

Perhaps similar to what we do with our bundle approach and walk all processors before creating the manager:

var err error
GlobalEnvironment().WalkProcessors(func(name string, config *service.ConfigView) {
   if !config.IsStable() {
         err = fmt.Errorf("cannot create a processor of type %s: component is marked as unstable", name)
   }
})

return err

Copy link
Collaborator

Choose a reason for hiding this comment

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

What are your thoughts on adding a grouped warning log instead of 1 per component? Perhaps that will make this change less scary to use.

For example:

[Warning] the following components are unstable and subject to changes outside of major versions: [ ... ]

Thoughts?

Co-authored-by: Greg Furman <31275503+gregfurman@users.noreply.github.com>
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.

2 participants