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

support fly config in json and yaml formats #3545

Merged
merged 15 commits into from
May 21, 2024
Merged

support fly config in json and yaml formats #3545

merged 15 commits into from
May 21, 2024

Conversation

rubys
Copy link
Contributor

@rubys rubys commented May 13, 2024

fly launch using the configuration of your choice -- toml remains the default, but --json or --yaml can be specified to select an alternate format.

Or convert at any time using fly config show --local and specify --yaml or --toml and redirect the output to a file with the correct file extension. (json remains the default for this command). Just remember to delete the other representation -- the search order is fly.toml, then fly.json, then fly.yaml.

fly config save can also be used (it defaults to toml).

@rubys rubys marked this pull request as draft May 13, 2024 11:00
Copy link
Member

@dangra dangra left a comment

Choose a reason for hiding this comment

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

Come to say I love the work you are doing here, adding json and yaml support is awesome but please add unit tests. TOML is well tested now, not perfect but covers many legacy stuff that we don't want to break. I'd like to see a similar level of test coverage for yaml and json.

@rubys
Copy link
Contributor Author

rubys commented May 20, 2024

@dangra If you look in testdata, you will now see full-reference in all three formats. There were produced using bin/flyctl config show --local. And there now are tests that loading these configurations produce identical configurations as the original toml file.

This demonstrates that configurations can round-trip in all three formats.

Any other suggestions?

@rubys rubys requested a review from dangra May 20, 2024 22:40
@rubys rubys marked this pull request as ready for review May 20, 2024 23:40
internal/appconfig/serde.go Outdated Show resolved Hide resolved
Copy link
Member

@dangra dangra left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Member

@dangra dangra left a comment

Choose a reason for hiding this comment

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

:shipit:

@rubys rubys merged commit 8758ec7 into master May 21, 2024
39 checks passed
@rubys rubys deleted the fly-json-and-yaml branch May 21, 2024 20:41
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.

None yet

2 participants