Skip to content

feat(config): add config struct json schemas#381

Merged
kke merged 3 commits into
mainfrom
jsonschema-rigv2
Jun 9, 2026
Merged

feat(config): add config struct json schemas#381
kke merged 3 commits into
mainfrom
jsonschema-rigv2

Conversation

@kke

@kke kke commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

forwardport #267

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR forward-ports the work to generate and ship JSON Schema definitions for rig’s protocol configuration structs (SSH, OpenSSH, WinRM, Localhost), along with tooling and CI checks to keep the schemas valid.

Changes:

  • Added generated JSON/YAML schema artifacts under schemas/ for SSH, OpenSSH, WinRM, and Localhost configs.
  • Added an internal/jsonschema generator module plus schema validation tests and a CI job to compile/validate the schemas.
  • Annotated protocol config structs with json and jsonschema tags to drive schema generation.

Reviewed changes

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

Show a summary per file
File Description
schemas/winrm.yaml Adds generated YAML schema for WinRM (including embedded SSH bastion).
schemas/winrm.json Adds generated JSON schema for WinRM (including embedded SSH bastion).
schemas/ssh.yaml Adds generated YAML schema for SSH config.
schemas/ssh.json Adds generated JSON schema for SSH config.
schemas/openssh.yaml Adds generated YAML schema for OpenSSH config.
schemas/openssh.json Adds generated JSON schema for OpenSSH config.
schemas/localhost.yaml Adds generated YAML schema for localhost config (bool + legacy object form).
schemas/localhost.json Adds generated JSON schema for localhost config (bool + legacy object form).
protocol/winrm/config.go Adds json + jsonschema tags to WinRM config struct fields.
protocol/ssh/config.go Adds json + jsonschema tags to SSH config struct fields.
protocol/openssh/config.go Adds json + jsonschema tags to OpenSSH config struct fields.
Makefile Adds schemas target to build schemas via the generator.
internal/jsonschema/schema_validation_test.go Adds tests that compile schemas and validate sample JSON documents.
internal/jsonschema/Makefile Adds generator build targets for JSON/YAML outputs into schemas/.
internal/jsonschema/go.mod Introduces a nested Go module for the schema generator and tests.
internal/jsonschema/go.sum Adds dependency lockfile for the generator module.
internal/jsonschema/gen_schema.go Implements schema generation and post-processing (e.g., address format anyOf).
.github/workflows/go.yml Adds a CI job to run the schema validation tests.

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

Comment thread internal/jsonschema/gen_schema.go
Comment thread internal/jsonschema/schema_validation_test.go
@kke kke force-pushed the jsonschema-rigv2 branch from 40c7101 to a650f2f Compare June 8, 2026 13:48
@kke kke requested a review from Copilot June 8, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread internal/jsonschema/Makefile Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 2 comments.

Comment thread internal/jsonschema/Makefile Outdated
Comment thread internal/jsonschema/gen_schema.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread internal/jsonschema/gen_schema.go Outdated
@kke kke force-pushed the jsonschema-rigv2 branch from bd18479 to 0384310 Compare June 8, 2026 17:51
@kke kke requested a review from Copilot June 8, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread protocol/winrm/config.go
@kke kke force-pushed the jsonschema-rigv2 branch from 0384310 to e5bf828 Compare June 8, 2026 18:03
@kke kke requested a review from Copilot June 8, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 3 comments.

Comment thread protocol/winrm/config.go Outdated
Comment thread protocol/winrm/config.go Outdated
Comment thread protocol/winrm/config.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread protocol/winrm/config.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 4 comments.

Comment thread schemas/winrm.json
Comment thread schemas/winrm.yaml
Comment thread internal/jsonschema/schema_validation_test.go Outdated
Comment thread internal/jsonschema/gen_schema.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 6 comments.

Comment thread internal/jsonschema/gen_schema.go
Comment thread schemas/winrm.json Outdated
Comment thread schemas/winrm.json Outdated
Comment thread schemas/winrm.yaml Outdated
Comment thread schemas/winrm.yaml Outdated
Comment thread internal/jsonschema/schema_validation_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 2 comments.

Comment thread protocol/winrm/config.go Outdated
Comment thread internal/jsonschema/gen_schema.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 2 comments.

Comment thread internal/jsonschema/gen_schema.go
Comment thread protocol/winrm/config.go Outdated
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
@kke kke force-pushed the jsonschema-rigv2 branch from 54b2d35 to 8fc1f46 Compare June 9, 2026 06:51
@kke kke requested a review from Copilot June 9, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread protocol/winrm/config.go
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated 2 comments.

Comment thread protocol/ssh/config.go Outdated
Comment thread .github/workflows/go.yml
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 17 out of 18 changed files in this pull request and generated no new comments.

@kke kke marked this pull request as ready for review June 9, 2026 07:53
@kke kke merged commit 07bb7ea into main Jun 9, 2026
14 checks passed
@kke kke deleted the jsonschema-rigv2 branch June 9, 2026 07:53
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