Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple validation file schema compilation from yaml parsing #2268

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tstirrat15
Copy link
Contributor

Description

Part of making it possible to run zed validate on files that use composable schema syntax. In order to have different compilation behaviors in different cases, we need to not run the compilation as a part of yaml parsing. This implements that.

Changes

Will annotate.

Testing

Review. See that things are green.

@github-actions github-actions bot added area/CLI Affects the command line area/api v1 Affects the v1 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Mar 10, 2025
@tstirrat15 tstirrat15 force-pushed the OSS-214/decouple-validation-parsing-from-schema-parsing branch from 32c1035 to fb0590d Compare March 10, 2025 22:39
@github-actions github-actions bot removed the area/api v1 Affects the v1 API label Mar 10, 2025
@tstirrat15 tstirrat15 force-pushed the OSS-214/decouple-validation-parsing-from-schema-parsing branch 3 times, most recently from 5bb9cc2 to 6426b2f Compare March 10, 2025 22:42
@tstirrat15 tstirrat15 force-pushed the OSS-214/decouple-validation-parsing-from-schema-parsing branch from 6426b2f to 340335e Compare March 10, 2025 22:43
@@ -37,10 +37,10 @@ linters:
- 'rowserrcheck'
- 'staticcheck'
- 'stylecheck'
- 'tenv'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was marked as deprecated in favor of usetesting when I ran golangci-lint run locally.

@@ -46,8 +46,7 @@ func TestCertRotation(t *testing.T) {
waitFactor = 2
)

certDir, err := os.MkdirTemp("", "test-certs-")
require.NoError(t, err)
certDir := t.TempDir()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one of the lint recommendations.

// Schema is the schema found.
Schema string

// SourcePosition is the position of the schema in the file.
SourcePosition spiceerrors.SourcePosition

// CompiledSchema is the compiled schema.
CompiledSchema *compiler.CompiledSchema
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This got pushed out into CompileSchema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CLI Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant