hasura / hasura/graphql-engine

CLI migration parsing errors should be more helpful

Open
#7,856 3 comments 0 reactions 0 assignees View on GitHub
c/cli k/enhancement p/medium t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: v2.0.10
CLI Version (for CLI related issue): v2.0.10

### Environment

Cloud and Docker

### What is the expected behaviour?

Metadata apply should work

### Keywords

metadata, sources, parse

### What is the current behaviour?

Metadata apply fails with below error.

```
FATA[0000] failed to apply metadata:
{
"path": "$.metadata",
"error": "key \"sources\" not found",
"code": "parse-failed"
}
```

### How to reproduce the issue?

1. Add a table.
2. Rename the generated `metadata/.../public_table.yml` file to `metadata/.../public_Table.yml`.
3. Apply metadata

### Any possible solutions?

Ensure all table file names are all lower-case (or that they match the `tables.yml` file, not sure which is required).

### If the bug is confirmed, would you be willing to submit a PR?

Not sufficiently familiar with this code base, sorry! If someone pointed me to the location where such a change could be made, I'd be happy to though.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing metadata apply after renaming metadata/.../public_table.yml to metadata/.../public_Table.yml, then compare the filename with tables.yml. Trace where the CLI reports the parse-failed error for the missing "sources" key. Done means the failure explains the filename or naming mismatch clearly, or the documented naming requirement is enforced consistently.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.