Skip to content

fix(hcl): remove zod dependency and use jsonobject#88

Merged
bbckr merged 11 commits into
mainfrom
fix/hcl-zod-v4-compat
Jun 22, 2026
Merged

fix(hcl): remove zod dependency and use jsonobject#88
bbckr merged 11 commits into
mainfrom
fix/hcl-zod-v4-compat

Conversation

@bbckr

@bbckr bbckr commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Related to issue #87.

Rather than fixing zod version incompatibility, we should just remove the zod dependency entirely because we were actually validating the schema twice - once with zod and once with Backstage's built in schema validation. So instead we will just use a plain json schema object.

@bbckr bbckr self-assigned this Jun 17, 2026
Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes the zod dependency from scaffolder-backend-module-hcl by switching the Scaffolder action schemas to plain JSON Schema objects, avoiding runtime failures when a consuming Backstage app resolves Zod v4 (per issue #87).

Changes:

  • Replaced Zod-based action schemas with JSON Schema objects and removed in-handler Zod parsing.
  • Added lightweight schema validation tests using jsonschema.validate.
  • Dropped zod from the plugin package dependencies (and corresponding lock entry).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
yarn.lock Removes the unused zod@^3.23.8 lock entry after dependency removal.
plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.ts Replaces Zod schemas with JSON Schema and normalizes options via defaultOptions.
plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.test.ts Adds JSON Schema validation tests for the action input schema.
plugins/scaffolder-backend-module-hcl/package.json Removes zod dependency from the plugin package.

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

Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.ts
Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.ts
Comment thread plugins/scaffolder-backend-module-hcl/package.json
bbckr and others added 4 commits June 17, 2026 21:04
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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.ts
Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.test.ts Outdated
Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.test.ts
Comment thread plugins/scaffolder-backend-module-hcl/src/actions/hcl/hcl.test.ts
bbckr and others added 4 commits June 18, 2026 17:18
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>
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>
@bbckr bbckr merged commit 74f1ff0 into main Jun 22, 2026
6 checks passed
@bbckr bbckr deleted the fix/hcl-zod-v4-compat branch June 22, 2026 08:40
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.

3 participants