Skip to content

docs(cli): add env vars reference and clarify Playwright include scope#1318

Open
stefanjudis wants to merge 6 commits into
mainfrom
ai-context/platform-env-and-playwright-include
Open

docs(cli): add env vars reference and clarify Playwright include scope#1318
stefanjudis wants to merge 6 commits into
mainfrom
ai-context/platform-env-and-playwright-include

Conversation

@stefanjudis
Copy link
Copy Markdown
Collaborator

@stefanjudis stefanjudis commented May 22, 2026

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

Three AI-context updates so the generated checkly skill teaches agents the right things:

  • New configure-environment reference. Covers built-in env vars Checkly injects at runtime (CHECK_ID, CHECK_NAME, REGION, RUNTIME_VERSION, the CHECKLY_* family on Playwright Check Suites, etc.), user-defined variables/secrets at global/group/check scope, the process.env vs {{handlebars}} reference syntax, and the checkly env CLI for managing global vars. Cross-links added from the API, browser, multistep, and Playwright reference docs.
  • Tightened PlaywrightCheck.include docs. The JSDoc, reference doc, and example all previously suggested include was for test files and utilities. In practice imports and Playwright project discovery already bundle those — include is only useful for non-code assets read via fs at runtime (JSON fixtures, markdown, snapshots). Globs resolve relative to the directory of playwrightConfigPath, which the docs now spell out.
  • CheckGroupV2 alert-channels gotcha. A custom alertChannels array on a CheckGroupV2 is silently ignored unless alertEscalationPolicy is also set — individual check settings take over instead. The check-groups reference now spells this out, with alertEscalationPolicy: 'global' and AlertEscalationBuilder as the two ways to satisfy it. See https://www.checklyhq.com/docs/constructs/check-group-v2/#param-alert-escalation-policy.

No new dependencies. No behavior change in the CLI itself — only JSDoc and AI-context source.

Add a `configure-environment` reference covering built-in vars Checkly
injects at runtime, user-defined variable scopes, reference syntax, and
the `checkly env` CLI, with cross-links from API/browser/multistep/
Playwright reference docs.

Rewrite the `PlaywrightCheck.include` JSDoc and reference to call out
that it's only for non-code assets read via `fs` — test files and
imports are bundled automatically — and that globs resolve relative to
the Playwright config directory.
…licy

A custom `alertChannels` array on a `CheckGroupV2` is silently ignored
unless `alertEscalationPolicy` is also set — individual check settings
take over instead. Spell this out in the check-groups reference so
agents don't write groups with non-functioning alert channels.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds/updates AI-context and JSDoc documentation to better explain (1) runtime environment variables and variable/secret scoping, and (2) the intended usage of Playwright include (non-code assets only), plus a CheckGroupV2 alert-channel gotcha.

Changes:

  • Added a new configure-environment reference covering built-in env vars, user-defined vars/secrets, reference syntax, and checkly env CLI usage.
  • Clarified PlaywrightCheck.include scope (non-code assets read via fs) across JSDoc, AI reference docs, and the embedded example config.
  • Updated multiple configure references to cross-link the new environment documentation and documented the CheckGroupV2 alertChannels + alertEscalationPolicy interaction.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/cli/src/constructs/playwright-check.ts Updates include JSDoc guidance and example usage for Playwright check suites.
packages/cli/src/ai-context/references/configure-playwright-checks.md Adds explicit guidance on include scope and links to the env-var reference.
packages/cli/src/ai-context/references/configure-multistep-checks.md Links to the env-var reference.
packages/cli/src/ai-context/references/configure-environment.md New reference documenting built-in/runtime and user-defined environment variables.
packages/cli/src/ai-context/references/configure-check-groups.md Documents CheckGroupV2 alert channel behavior requiring alertEscalationPolicy.
packages/cli/src/ai-context/references/configure-browser-checks.md Links to the env-var reference.
packages/cli/src/ai-context/references/configure-api-checks.md Links to the env-var reference and clarifies Handlebars vs JS env-var usage.
packages/cli/src/ai-context/context.ts Registers the new configure-environment reference and updates the Playwright example snippet.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli/src/constructs/playwright-check.ts
Comment thread packages/cli/src/constructs/playwright-check.ts
stefanjudis and others added 2 commits May 22, 2026 19:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

⚠️ AI context is out of date

The skills/ directory doesn't match the generated output from packages/cli.

Please run the following locally and commit the changes:

pnpm run sync:skills

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ AI context is out of date

The skills/ directory doesn't match the generated output from packages/cli.

Please run the following locally and commit the changes:

pnpm run sync:skills

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