Skip to content

Conversation

felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Aug 30, 2025

Before:

[section]
int       = %!s(int=123)
float     = 1.230000
bool      = true
date      = 2025-01-01 00:00:00 +0000 UTC
timestamp = 2025-01-01 01:02:03 +0000 UTC
string    = this is a string

After first commit:

[section]
int       = 123
float     = 1.230000
bool      = true
date      = 2025-01-01T00:00:00Z
timestamp = 2025-01-01T01:02:03Z
string    = this is a string

Latest version:

[section]
int       = 123
float     = 1.23
bool      = true
date      = 2025-01-01T00:00:00Z
timestamp = 2025-01-01T01:02:03Z
string    = this is a string

Fixes #1915.

@felixfontein
Copy link
Contributor Author

@getsops/maintainers this change is a breaking change, since it changes the output. For integers, I think this is definitely OK. Timestamps haven't been supported for that long, and I think the new output is a lot better, and I think there it's definitely also OK. For floats, I think the old output was bad since it potentially destroyed the value (like 1.2345E-10 getting turned into 0). What do you think, is this OK for a new feature release?

@felixfontein felixfontein changed the title Fix converting integers to strings; also improve time.Time formatting Fix converting integers to strings; improve float and time.Time formatting Aug 30, 2025
@felixfontein felixfontein changed the title Fix converting integers to strings; improve float and time.Time formatting INI: fix converting integers to strings; improve float and time.Time formatting Aug 30, 2025
Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Felix Fontein <felix@fontein.de>
@felixfontein felixfontein merged commit 193c269 into getsops:main Sep 9, 2025
16 checks passed
@felixfontein
Copy link
Contributor Author

@sabre1041 thanks a lot for reviewing this!

@felixfontein felixfontein deleted the ini-bug branch September 9, 2025 19:03
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.

INI store: conversion to string destroys integers
2 participants