Add enterprise welcome message - #2784
Conversation
Shown once per process whenever giskard.core is imported (which every Giskard package pulls in), pointing new OSS users at the enterprise offering.
Stacked on #2784 — replaces the import-time print with the gated maybe_show_welcome() path on Suite.run(). Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
…-3721) Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
Stacked on #2784 — replaces the import-time print with the gated maybe_show_welcome() path on Suite.run(). Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
* docs(plans): add requirements plan for gated enterprise welcome message Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * feat(core): add gated enterprise welcome on suite run Show a one-shot Enterprise message on stderr when Suite.run starts, only in interactive environments. Suppress in CI, pytest, non-TTY (non-notebook), or when GISKARD_HIDE_WELCOME is set. Scan entrypoints inherit the hook via suite.run(). Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * refactor(core): share environment detection and use settings for welcome Extract CI, pytest, notebook, and truthy-env helpers into giskard.core.environment for reuse by telemetry and welcome. Add GiskardCoreSettings (GISKARD_HIDE_WELCOME) matching the checks settings pattern. Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * refactor(core): simplify welcome gates and tests Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * refactor(core): remove import-time welcome in favor of gated suite hook Stacked on #2784 — replaces the import-time print with the gated maybe_show_welcome() path on Suite.run(). Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * chore: drop requirements plan from stacked PR scope Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> * fix(core): use ModuleType stubs in welcome environment tests basedpyright rejects assigning object() into sys.modules; tests now register types.ModuleType placeholders instead. Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
Parse GISKARD_HIDE_WELCOME with telemetry truthy rules so empty or invalid values cannot ValidationError-abort Suite.run, swallow banner failures, spy-test the suite hook, and isolate giskard-core tests from ambient GISKARD_* / cwd .env. Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
|
I saw the more advanced logic in [95b7219](95b7219) for deciding where the welcome message is displayed. My preference would be to keep this simple:
I appreciate that you've extended the message to test runs, beyond the original scope I had in mind. I understand that showing it everywhere may feel much, but the goal is to help the 40K+ monthly active OSS users discover the Enterprise version. So it's OK to me, I actually appreciate this extension, thank you! What do you think? |
| @@ -0,0 +1,34 @@ | |||
| """One-time enterprise welcome message for giskard-checks imports.""" | |||
There was a problem hiding this comment.
| """One-time enterprise welcome message for giskard-checks imports.""" |
| import sys | ||
| from os import getenv | ||
|
|
||
| _TRUTHY_ENV_VALUES = frozenset({"1", "true", "yes", "on", "t", "y"}) |
There was a problem hiding this comment.
should be imported from libs/giskard-core/src/giskard/core/telemetry/telemetry.py instead of defined
|
|
||
|
|
||
| def _should_show_welcome() -> bool: | ||
| value = getenv("GISKARD_HIDE_WELCOME") |
There was a problem hiding this comment.
we can generalize that for other messages in the future:
| value = getenv("GISKARD_HIDE_WELCOME") | |
| value = getenv("GISKARD_QUIET") |
| _shown = True | ||
| print(_WELCOME_MESSAGE, file=sys.stderr) | ||
| except Exception: | ||
| # Best-effort UX: never abort a suite or scan because the banner failed. |
There was a problem hiding this comment.
| # Best-effort UX: never abort a suite or scan because the banner failed. |
There was a problem hiding this comment.
update vars to be GISKARD_QUIET instead of GISKARD_HIDE_WELCOME
Description
Adds a one-time Giskard Enterprise welcome message when suites or scans run interactively. It is suppressed in CI, pytest, and non-interactive environments, and users can disable it with
GISKARD_HIDE_WELCOME.Shared environment helpers now centralize this detection and telemetry environment classification.
Related Issue
N/A
Type of Change
Coding agents
Autonomous agents with no human in the loop must read AUTONOMOUS.md before opening a PR.
PR title: agent-opened PRs must end the title with
🤖🤖🤖🤖(exactly four robot emojis). Do not omit — that suffix is how the expedited agent PR workflow picks up the PR.Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.uv.lockrunninguv lock(only applicable whenpyproject.tomlhas been modified)