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

fix(metrics): make sure to return bento during build for telemetry #3897

Merged
merged 3 commits into from Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/bentoml_cli/bentos.py
Expand Up @@ -308,7 +308,7 @@ def build( # type: ignore (not accessed)
version: str,
output: t.Literal["tag", "default"],
_bento_store: BentoStore = Provide[BentoMLContainer.bento_store],
) -> None:
):
"""Build a new Bento from current directory."""
try:
bentofile = resolve_user_filepath(bentofile, build_ctx)
Expand All @@ -326,9 +326,11 @@ def build( # type: ignore (not accessed)
build_ctx=build_ctx,
).save(_bento_store)

# NOTE: Don't remove the return statement here, since we will need this
# for usage stats collection if users are opt-in.
if output == "tag":
click.echo(bento.tag)
return
return bento

if not get_quiet_mode():
click.echo(BENTOML_FIGLET)
Expand All @@ -342,3 +344,4 @@ def build( # type: ignore (not accessed)
f"\n * Push to BentoCloud with `bentoml push`:\n $ bentoml push {bento.tag}",
fg="blue",
)
return bento