question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to split metadata yaml into files

See original GitHub issue

Our use case:

  • A few hundred tables
  • YAML files manually configured/updated on Git
  • CI/CD based on git and the cli-migrations-v2 image

The CLI forces us to have all table configuration in a single tables.yaml file that is a few thousand lines long and… a mess.

We would like to be able to something like this:

/metadata
-- table1.yaml
-- table2.yaml
      ...
-- tableN.yaml

Which would allow a much easier (and safer) process of development and review.

This might be somewhat related to https://github.com/hasura/graphql-engine/issues/3545, but I’ve been unable to find a PR for that and the CLI fails if you don’t have a tables.yaml file.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
malkhuzayyimcommented, Feb 26, 2021

@ferm10n just a standard “file per tracked table/view” would be a huge win over having a single yaml file which is in the thousands of lines long. And the switch is pretty straight forward.

It’s true I’m not considering other .yaml files in the metadata, but I’m personally only invested in having the tables file split up. The rest I can live with being in one file as I don’t rely on them that much.

1reaction
malkhuzayyimcommented, Feb 25, 2021

@ferm10n If I may chime in.

I think a primary candidate for splitting is the “tables.yaml”, as i imagine it is by far the most used file in hasura for the average use case, as all table info, permissions and events go there.

So the directory structure may stay the same for everything else in a hasura project, just the tables.yaml would become something like:

tables/
- table1.yaml
- table2.yaml
- table3.yaml
...etc

That would be a quick and easy win I believe, its probably very viable to do that while maintaining backwards compatibility too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to split a YAML into multiple files with a proper name
How can I split it using a one-liner AWK script in files first.yaml , second.yaml and third.yaml ? Solution needs to work with...
Read more >
Split into files uses `.yml` file ending · Issue #1165 · mikefarah/yq
Describe the bug. Files created by --split-exp use the .yml file ending althoguh yaml is the recommended file ending. Version of yq: 4.24.2...
Read more >
Split into multiple files - yq - GitBook
Split documents into files, using index ... This is like the example above, but we'll use $index for the filename. Note that this...
Read more >
10 YAML tips for people who hate YAML | Enable Sysadmin
Just write your JSON data into a Python variable, prepend an import statement, and end the file with a simple three-line output statement....
Read more >
Project Basics - Quarto
One of the most important features of Quarto Projects is the ability to share YAML metadata options across multiple documents. Shared metadata can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found