Skip to content

Conversation

@tehsis
Copy link
Contributor

@tehsis tehsis commented Jan 29, 2026

Proposed changes

Adds new fn::conform built-in function documentation

Unreleased product version (optional)

This might be available in a future esc release.

@claude
Copy link
Contributor

claude bot commented Jan 29, 2026

Documentation Review

Thank you for adding documentation for the fn::conform built-in function. This is a solid addition with clear examples. I found several issues that should be addressed:


Issues Found

1. Missing trailing newline (fn-conform.md:232)

The new file fn-conform.md must end with a trailing newline. According to AGENTS.md, all Markdown files must end with a newline.

Fix: Add a blank line at the end of the file.


2. Inconsistent meta_desc (fn-conform.md:5)

The meta description is generic and identical to other built-in functions. It should be specific to fn::conform.

Current:

meta_desc: Pulumi ESC allows you to compose and manage hierarchical collections of configuration and secrets and consume them in various ways.

Suggested:

meta_desc: The fn::conform function validates values against JSON Schema in Pulumi ESC environments.

3. Table formatting inconsistency (fn-conform.md:27)

The parameters table has an inconsistent final column where the description doesn't end with a period, while line 28 does. For consistency with other built-in function docs (like fn-concat.md and fn-fromJSON.md), table descriptions should not end with periods.

Current:

| `schema` | object | A JSON Schema definition to validate the value against.
| `value`  | any    | The value to validate.

Suggested:

| `schema` | object | A JSON Schema definition to validate the value against
| `value`  | any    | The value to validate

4. Repetitive phrasing (fn-conform.md:199, 211, 231)

The phrase "The environment cannot be saved" appears three times in the Validation errors section. This becomes repetitive. Consider consolidating or varying the language.

Suggested improvement for line 199-200:

When a value does not conform to its schema, `fn::conform` raises an error preventing the environment from being saved. This ensures configuration issues are caught before deployment.

Then remove "The environment cannot be saved" from lines 211 and 231, as the point has already been established.

Line 211 suggestion:

This raises an error: `expected string, got number`.

Line 231 suggestion:

This raises an error indicating that the required field `name` is missing.

Positive Aspects

  • Clear structure with progressive examples from simple to complex
  • Good use of "Definition" and "Evaluated result" sections for consistency
  • The "Reusing schemas from imported environments" example is particularly valuable
  • Validation error examples help users understand failure modes

Please address these issues and mention me (@claude) if you'd like another review after making changes.

@pulumi-bot
Copy link
Collaborator

values:
user:
fn::conform:
schema: ${user-schema}
Copy link
Contributor

@nyobe nyobe Jan 29, 2026

Choose a reason for hiding this comment

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

fwiw, I think using an implicit import is more ergonomic, because it won't merge the schema itself into the current esc environment:

values:
  user:
    fn::conform:
      schema: ${environments.myproj.schemas.user-schema}

@pulumi-bot
Copy link
Collaborator

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.

4 participants