Skip to content

Show public beta notice on every aio plugin command#55

Draft
krystiannowak wants to merge 2 commits into
adobe:mainfrom
krystiannowak:public-beta-notice-on-every-command
Draft

Show public beta notice on every aio plugin command#55
krystiannowak wants to merge 2 commits into
adobe:mainfrom
krystiannowak:public-beta-notice-on-every-command

Conversation

@krystiannowak

Copy link
Copy Markdown
Collaborator

Show public beta notice on every aio plugin command

Context

With Edge Functions entering public beta (soft launch), every invocation of the aio plugin should display a beta notice informing users that the feature is for development/experimentation only, and production use requires prior discussion with Adobe. The notice must be acknowledged before proceeding.

Behavior

  1. Every command displays the beta notice — build, deploy, serve, setup, list, info, tail-logs, purge-cache, help, version.
  2. The notice is always printed — even after the user has agreed, even with --accept-beta, even with --batch. This ensures it appears in CI/CD logs for retroactive review.
  3. First run: the user is prompted to acknowledge the notice. Declining exits with an error.
  4. After agreeing: the agreement is stored locally in .aio (edgefunctions_beta_agreed=true). Subsequent runs display the notice but skip the prompt.
  5. --accept-beta flag: acknowledges the notice non-interactively, for CI/CD pipelines and automation (like --accept-license in Oracle JDK installers). The notice is still displayed.
  6. --batch flag (on commands that have it, e.g. info): also skips the interactive prompt, since batch mode already implies non-interactive usage.

Changes

src/libs/base-command.js

  • Added BETA_NOTICE constant with the placeholder notice text (final text to be provided by PM).
  • Added static baseFlags with --accept-beta boolean flag — inherited by all commands via oclif's base flag mechanism.
  • Added CONFIG_BETA_AGREED = 'edgefunctions_beta_agreed' config key, registered in BOOLEAN_CONFIGS.
  • Added showBetaNotice() method called from init():
    • Always prints the notice via console.log(chalk.yellow(BETA_NOTICE)).
    • Skips the interactive prompt if any of: already agreed (config), --accept-beta flag, --batch flag.
    • On first interactive run: prompts with @inquirer/prompts confirm(). Stores agreement in local .aio on accept; exits on decline.
  • Added const { confirm } = require('@inquirer/prompts') import (@inquirer/prompts is already a dependency, used by setup.js).

src/commands/aem/edge-functions/help.js

  • Added "GLOBAL FLAGS" section listing --accept-beta so CI/CD users can discover it.

How agreement is stored

The agreement is stored in the local .aio config file (project-level, not global) via Config.set(key, true, true). This is the same mechanism used by setup.js for storing environment configuration. The true second argument to Config.set means "store locally" (in the project's .aio file rather than the global ~/.aio).

Removing the beta notice for GA

When Edge Functions exits public beta and reaches official GA, remove:

  1. The BETA_NOTICE constant and showBetaNotice() method from base-command.js
  2. The await this.showBetaNotice() call from init()
  3. The --accept-beta base flag
  4. The CONFIG_BETA_AGREED config key and its BOOLEAN_CONFIGS entry
  5. The "GLOBAL FLAGS" section from help.js
  6. Release a new version of the plugin

Changed files

File Change
src/libs/base-command.js Beta notice constant, --accept-beta base flag, showBetaNotice() method, CONFIG_BETA_AGREED config key
src/commands/aem/edge-functions/help.js Added "GLOBAL FLAGS" section with --accept-beta

@krystiannowak krystiannowak requested review from mpetria and phornig June 12, 2026 12:00
@krystiannowak krystiannowak force-pushed the public-beta-notice-on-every-command branch from 1be00b1 to 1a672ea Compare June 12, 2026 15:55
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