Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Format/indent schema.json with yq #719

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickard-von-essen
Copy link
Contributor

This make reviewing actuall changes simpler

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • N/A Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

$ git show HEAD~:config/schema.json | jq > config/schema.json.old && diff config/schema.json.old config/schema.json

This make reviewing actuall changes simpler

Signed-off-by: Rickard von Essen <rickard.von.essen@gmail.com>
Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Hey @rickard-von-essen,

We really appreciate your contribution! 🙏 What exactly is the advantage of this change? You mentioned that it makes the review process easier, but how does it improve it in practice? Could you provide a concrete example?

@rickard-von-essen
Copy link
Contributor Author

Hi, Sorry for the very brief description. Currenlty the schema.json is a single line ~8 MB file and whenever you change the TERRAFORM_PROVIDER_VERSION github will not show any diff for it since it's too large.

Github Files changed tab will just display:

Large diffs are not rendered by default.

Trying to load it will just show:

1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.

After this change any changes to the schema (as result of TF provider updates) will clearly show what changed.

Example, going from v5.44.0 to v5.45.0 has this schema diff:

--- config/schema-5.44.0.json   2025-02-07 08:35:39.810663988 +0100
+++ config/schema-5.45.0.json   2025-02-07 08:36:17.703939970 +0100
@@ -144257,6 +144257,13 @@
                 "description_kind": "plain",
                 "required": true
               },
+              "default_backup_schedule_type": {
+                "type": "string",
+                "description": "Controls the default backup behavior for new databases within the instance.\nNote that 'AUTOMATIC' is not permitted for free instances, as backups and backup schedules are not allowed for free instances.\nif unset or NONE, no default backup schedule will be created for new databases within the instance. Possible values: [\"NONE\", \"AUTOMATIC\"]",
+                "description_kind": "plain",
+                "optional": true,
+                "computed": true
+              },
               "display_name": {
                 "type": "string",
                 "description": "The descriptive name for this instance as it appears in UIs. Must be\nunique per project and between 4 and 30 characters in length.",
@@ -175935,6 +175942,12 @@
                 "description_kind": "plain",
                 "optional": true
               },
+              "default_backup_schedule_type": {
+                "type": "string",
+                "description": "Controls the default backup behavior for new databases within the instance.\nNote that 'AUTOMATIC' is not permitted for free instances, as backups and backup schedules are not allowed for free instances.\nif unset or NONE, no default backup schedule will be created for new databases within the instance. Possible values: [\"NONE\", \"AUTOMATIC\"]",
+                "description_kind": "plain",
+                "computed": true
+              },
               "display_name": {
                 "type": "string",
                 "description": "The descriptive name for this instance as it appears in UIs. Must be\nunique per project and between 4 and 30 characters in length.",

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants