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

Add DDEV project config schema #3158

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

jamesmacwhite
Copy link
Contributor

@jamesmacwhite jamesmacwhite commented Aug 23, 2023

Hello!

I would like to contribute an addition to the schemastore project for the DDEV project config configuration file schema.

Discussing with the maintainer of DDEV, self hosting the schema within DDEV makes the most sense to ensure configuration options and changes are able to be made accordingly per releases. Before self hosting the schema was tested against a valid config.yaml file and passes strict validation tests. However as we are self hosting the schema was cannot utilise these tests I don't think, but we are looking to implement these into CI process within DDEV itself.

Schema reference: https://raw.githubusercontent.com/ddev/ddev/master/pkg/ddevapp/schema.json

Reading the contributing guidelines and because this is a new schema, I believe adding a URL rerference is only required, looking at other examples, but do let me know if there's anything further needed!

@rfay @nico-loeber

@rfay
Copy link

rfay commented Aug 23, 2023

Do you want to include both project and global in this PR @jamesmacwhite ?

@jamesmacwhite
Copy link
Contributor Author

Do you want to include both project and global in this PR @jamesmacwhite ?

I'm not sure we can because of the fileMatch rule logic, given the path to the global config is a $HOME path, which I don't think the fileMatch logic can handle, as it seems geared towards project specific or relative to a project folder.

I'd love to get feedback on this from the schemastore maintainers however to confirm if something like
/home/*/.ddev/global_config.yaml would work? I'm not sure it would currently though.

if it possible I'll happily submit a separate one, just as it's two different schema files, so just for being neat about it.

@hyperupcall
Copy link
Member

hyperupcall commented Aug 23, 2023

@jamesmacwhite fileMatches can be for files in home or project files. For example, if your software reads from $HOME/.ddev/config.yaml, then your IDE should match it (it's a bug if it doesn't).

Your /home/*/.ddev/global_config.yaml wouldn't match with the current value of fileMatch since the fileMatch would only look for configuration with a basename of config.yaml. But, if fileMatch was "**/.ddev/*.yaml", then it would match.

@hyperupcall
Copy link
Member

hyperupcall commented Aug 23, 2023

Feel free to submit all DDEV schemas in this single PR! It's probably easier to keep track of them that way.

@jamesmacwhite
Copy link
Contributor Author

jamesmacwhite commented Aug 23, 2023

@hyperupcall Thanks for your quick response! That's great to hear! I'll add the global config as well!

Just to confirm the fileMatch rules align:

$HOME/.ddev/global_config.yaml would be **/.ddev/global_config.yaml
.ddev/config.yaml would be .ddev/config.yaml or **/.ddev/config.yaml

The global config path would be something like /home/jameswhite/.ddev/global_config.yaml
The project specific config would be /home/jameswhite/Projects/example/.ddev/config.yaml

Would these rules align accordingly?

@rfay
Copy link

rfay commented Aug 23, 2023

Just a note @jamesmacwhite - **/.ddev/config.yaml should be **/.ddev/config*.yaml

Copy link

@rfay rfay left a comment

Choose a reason for hiding this comment

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

  • Match all config*.yaml

Also please add global config per discussion.

src/api/json/catalog.json Outdated Show resolved Hide resolved
@jamesmacwhite
Copy link
Contributor Author

Thanks! I've added the ddev global config schema and updated the fileMatch files accordingly.

Copy link

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Looking great to me, thanks!

@hyperupcall
Copy link
Member

hyperupcall commented Aug 23, 2023

@jamesmacwhite Yes! And as far as I understand it, .ddev/config.yaml and **/.ddev/config.yaml are the same (in catalog.json, not all entries have **/).

@hyperupcall
Copy link
Member

@jamesmacwhite Is this ready to be merged?

@jamesmacwhite
Copy link
Contributor Author

@hyperupcall Thank you. Yes, all the schemas are ready! @rfay (DDEV maintainer) is happy I believe!

@hyperupcall
Copy link
Member

Awesome, thank you

@hyperupcall hyperupcall merged commit 37a1f55 into SchemaStore:master Aug 23, 2023
@rfay
Copy link

rfay commented Aug 23, 2023

Congrats on a bunch of great work and initiative @jamesmacwhite , thanks for the amazing responsiveness @hyperupcall 🚀

@jamesmacwhite
Copy link
Contributor Author

Thanks everyone!

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.

3 participants