Skip to content

fix(cli): validate UModel YAML files - #94

Open
Chloride233 wants to merge 1 commit into
alibaba:mainfrom
Chloride233:fix/cli-validate-yaml
Open

fix(cli): validate UModel YAML files#94
Chloride233 wants to merge 1 commit into
alibaba:mainfrom
Chloride233:fix/cli-validate-yaml

Conversation

@Chloride233

@Chloride233 Chloride233 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This closes a small gap in the local authoring loop: the CLI docs point umctl umodel validate at a quickstart UModel YAML file, but the command only wrapped JSON before calling the validate API.

Now umctl umodel validate can accept one schema-style UModel YAML file and send the same elements payload the API already expects.

Scope

  • Reuses the UModel payload normalizer from import parsing.
  • Keeps umodel put JSON-only.
  • No REST API, MCP, SDK, schema, or Web UI changes.

Verification details

  • Affected version: main; no released tag was used for this reproduction.
  • Steps to reproduce before this change:
    1. Start UnifiedModel and create a workspace such as demo.
    2. Run go run ./cmd/umctl --addr http://localhost:8080 umodel validate demo examples/quickstart-multidomain/umodel/devops/entity_set/devops.service.yaml.
  • Expected behavior: The CLI accepts the documented schema-style YAML file, normalizes its kind, schema, metadata, and spec fields, and sends one element to /api/v1/umodel/demo/validate.
  • Actual behavior before this change: The validate command treated the file input as JSON-only and attempted to wrap the raw YAML as JSON, so it exited before sending a normalized elements payload.
  • Logs/stack trace: No runtime stack trace is involved. The regression is reproduced by TestUModelValidateAcceptsSchemaStyleYAMLFile, which fails without this change and verifies the normalized request payload with it.

Tests

  • go test ./cmd/umctl/cmd -run 'TestUModelValidateAcceptsSchemaStyleYAMLFile|TestCLICommandsRouteToCorrectEndpoints' -count=1
  • go test ./internal/umodel/payload -count=1
  • go test ./internal/bootstrap ./internal/sampledata -run 'QuickStart|quickstart|Sample|Localization' -count=1
  • git diff --check

@qiansheng91 qiansheng91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

Reviewed PR #94: fix(cli): validate UModel YAML files

The changes appear reasonable. No critical issues found in the diff.


Automated review by github-manager-bot

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Needs Verification

Thank you for reporting this issue. The reported behavior is being reviewed against the current codebase.

Next Steps:

  • This issue has been flagged for code-level verification
  • If confirmed, an automated fix proposal may be generated
  • You can reply with additional context, reproduction steps, or logs to help speed up the analysis

Automated evaluation by github-manager-bot

@qiansheng91 qiansheng91 added the bug Something isn't working label Jul 25, 2026
@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Under Review

Thank you for reporting this issue. It has been classified as a potential bug and is being reviewed against the current codebase.

A deeper verification will be performed. If confirmed as a valid bug, an automated fix proposal may be generated.


Automated evaluation by github-manager

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Needs Info

Thank you for reporting this issue. To proceed with verification, please provide:

  • Version/tag where this occurs
  • Steps to reproduce
  • Expected vs actual behavior
  • Relevant logs or stack traces

Automated evaluation by github-manager-bot

@Chloride233

Copy link
Copy Markdown
Contributor Author

Added the requested version, reproduction steps, expected vs. actual behavior, and verification evidence to the PR description. This is a non-crashing CLI input-handling gap on main; the regression test documents the failure mode and normalized request payload.

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Needs Verification

Thank you @ for reporting this. This issue has been flagged as a potential bug.

Next Steps:

  • This issue will be verified against the current codebase by the automated pipeline.
  • If confirmed, a fix proposal (spec + PR) will be generated automatically.
  • If more information is needed, a follow-up comment will request details.

Please ensure your report includes:

  • Steps to reproduce
  • Expected vs actual behavior
  • Version/tag where this occurs
  • Relevant logs or error messages

Automated evaluation by github-manager-bot

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Under Review

Thank you for reporting this issue. It has been classified as a potential bug and is being reviewed against the current codebase.

If confirmed as a valid bug, an automated fix proposal may be generated. Community members can reply /approve to proceed with PR generation, /revise to request changes to the approach, or /reject to decline.


Automated evaluation by github-manager

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Under Review

Thank you for reporting this. The issue has been classified as a potential bug and is queued for code-level verification.

Next steps:

  • Code-level analysis will verify the root cause
  • If confirmed, a fix spec and PR will be generated automatically
  • Reply /approve to accelerate PR generation once the spec is ready

Automated evaluation by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants