cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

[enhancement]: Relocate json schemas somewhere more sensible

Open holmanb opened this issue 2 years ago • 6 comments

Enhancement

All of our jsonschemas are hidden down under cloudinit/config/schemas/, which doesn't make sense:

a) these files contain data not Python code b) some of these files are not specific to configuration modules c) the __init__.py was never required

These file should exist in a directory under the top directory, probably named something like schema (alternatively jsonschema or maybe something more generic like data).

Expected changes:

  • code in cloudinit/, specifically schema.py
  • test/unittest/
  • setup.py
  • possibly distro packaging too (presumably avoidable with setup.py finesse)

holmanb avatar Dec 13 '23 17:12 holmanb

Hi @holmanb , can this task be assigned to me?

antwigambrah avatar Jan 19 '24 13:01 antwigambrah

Hello, @antwigambrah, thanks for improving cloud-init. We do not typically assign issues to people, but please, feel free to put together a PR. If you have any questions regarding the implementation, please ask them here or in the IRC channel on libera #cloud-init.

Contributing guidelines: https://docs.cloud-init.io/en/latest/development/index.html

aciba90 avatar Feb 14 '24 11:02 aciba90

Hello, @antwigambrah, thanks for improving cloud-init. We do not typically assign issues to people, but please, feel free to put together a PR. If you have any questions regarding the implementation, please ask them here or in the IRC channel on libera #cloud-init.

Contributing guidelines: https://docs.cloud-init.io/en/latest/development/index.html

Just seeing this . Thanks @holmanb @aciba90 Added the pr

antwigambrah avatar Mar 01 '24 04:03 antwigambrah

It would be better to deploy these files somewhere under cloud-init.io domain, instead of directly going to github...

https://raw.githubusercontent.com/canonical/cloud-init/main/cloudinit/config/schemas/schema-cloud-config-v1.json

afbjorklund avatar Apr 07 '24 16:04 afbjorklund

It would be better to deploy these files somewhere under cloud-init.io domain, instead of directly going to github...

Why?

https://raw.githubusercontent.com/canonical/cloud-init/main/cloudinit/config/schemas/schema-cloud-config-v1.json

@afbjorklund We publish them already to the jsonschema store, if you want a non-github location to pull from.

holmanb avatar Apr 08 '24 21:04 holmanb

The current location works OK with the tools, just thinking that normally you would download files from a web server?

The https://www.schemastore.org/json/ seems to be linking to the same address, but I just embedded a copy for now.

EDIT: apparently there was also a request for specific versions and not just main, so will change that as well.

I am using go (not python), and this tool for validation: https://github.com/santhosh-tekuri/jsonschema

afbjorklund avatar Apr 09 '24 05:04 afbjorklund