Skip to content

chore: use NODE_ENV to setup env#5

Merged
ianaya89 merged 1 commit intomainfrom
node-env
Jul 20, 2021
Merged

chore: use NODE_ENV to setup env#5
ianaya89 merged 1 commit intomainfrom
node-env

Conversation

@ianaya89
Copy link
Copy Markdown
Contributor

@ianaya89 ianaya89 commented Jul 19, 2021

I hereby confirm that I followed the code guidelines found at engineering guidelines

⚙️ Affected Components

  • Commands
  • Modules
  • Services
  • SDK

📝 Notes for the Reviewer

Resolves 378cbe2#comments

Beyond this fix, I do not expect this ENV configuration is used by customers. This should be focused on us and development purposes

@ianaya89 ianaya89 requested a review from ndom91 July 19, 2021 13:42
Copy link
Copy Markdown
Contributor

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

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

Yeah I see it the same way, mostly for us for dev purposes to blend stuff out, etc. but yeah good stuff!

LGTM 👍

@ianaya89 ianaya89 merged commit c1a4b13 into main Jul 20, 2021
@ianaya89 ianaya89 deleted the node-env branch July 20, 2021 14:11
ianaya89 pushed a commit that referenced this pull request Aug 26, 2021
ianaya89 pushed a commit that referenced this pull request Aug 26, 2021
ianaya89 pushed a commit that referenced this pull request Aug 26, 2021
thebiglabasky added a commit that referenced this pull request Apr 6, 2026
Wires AgenticCheck into the \`checkly import\` code generation flow so
users can import an existing agentic check from the backend and get a
construct file that matches the locked-down props type added earlier on
this branch.

Implementation:
- New \`AgenticCheckCodegen\` in \`agentic-check-codegen.ts\` mirroring the
  Heartbeat/Browser codegen pattern. Places generated files under
  \`resources/agentic-checks/{name}\`, imports \`AgenticCheck\` from
  \`checkly/constructs\`, and emits a \`new AgenticCheck(...)\` expression.
- The resource shape (\`AgenticCheckResource\`) carries \`prompt\` and the
  backend's \`agenticCheckData\` storage blob. A small helper reverse-
  translates that blob into the CLI construct's public shape:
    * \`agenticCheckData.skills\` → \`agentRuntime.skills\`
    * \`agenticCheckData.selectedEnvironmentVariables\` → \`agentRuntime.environmentVariables\`
      — mapping \`key\` back to \`name\` for object-form entries
    * \`agenticCheckData.assertionRules\` → deliberately not emitted
      (agent-generated, preserved server-side via the backend's merge
      logic, the construct intentionally does not expose them)
  An imported check with no skills and no selected env vars produces no
  \`agentRuntime\` block at all, to avoid noise in the generated code.
- Registers the new codegen in \`CheckCodegen.constructor\` and wires
  \`AGENTIC\` into the dispatch switches in \`describe()\` and \`gencode()\`
  alongside the existing check types.

\`buildCheckProps\` gains a narrow \`BuildCheckPropsOptions\` parameter —
currently a single \`skipRetryStrategy\` flag — because \`retryStrategy\`
is the only field that \`buildCheckProps\` emits unconditionally (null is
rendered as \`RetryStrategyBuilder.noRetries()\`). The AgenticCheck
construct's props type omits \`retryStrategy\` entirely, so emitting it
would produce a generated file that does not type-check. The
AgenticCheckCodegen passes \`skipRetryStrategy: true\` and clears
\`locations\` from a resource copy before calling \`buildCheckProps\` — the
two fixes together make the generated output round-trip cleanly through
the construct's props type.

Verified end-to-end by extending \`ai-context/context.fixtures.json\` with
an example agentic check (prompt, skills, mixed-form env vars, sample
assertionRules) and running \`npm run prepare:ai-context\`. The generated
\`gen/resources/agentic-checks/example-agentic-check.check.ts\` contains
only fields the construct accepts, reverse-translates env vars from
\`key\` to \`name\`, omits \`assertionRules\`, and type-checks against the
construct. Full CLI suite remains green (829 passing / 2 skipped /
60 files). No regressions in any other check type's codegen from the
new optional options parameter.

Covers item #3 on Simo's new-construct checklist. Items #5 (examples),
#6 (E2E tests), and #8 (AI context reference doc) still pending on this
branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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