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

rust-compress-state debug: indent the chonky json #905

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

Conversation

pushytoxin
Copy link
Contributor

If the room list gets posted in the debug step, at least make it readable.

However something doesn't seem right to me.
Internally, {{ matrix_synapse_rust_synapse_compress_state_eligible_rooms }} is an array of objects, not a JSON string.
The debug step should have a sane default to pretty print the output, and not rely on us manually applying the filter.
If there is a way to configure what filter is used when Ansible is printing data to a terminal, let me know please.

If the room list gets posted in the debug step, at least make it readable.
@pushytoxin
Copy link
Contributor Author

Upon closer inspection, the the data that is printed by default isn't actually JSON

[{''room_id'': ''!iyIlasdfasdfRmRHFx:matrix.org'', ''count'': 8621734},
{''room_id'': ''!Oasdfasdfasdfasdfm:matrix.org'', ''count'': 6077025}...
]

Indentation is mine, but the '' isn't.
This is too weird for me. I'm signing off this PR.

@spantaleev
Copy link
Owner

So.. does this PR make things better or not? |to_yaml may be another possibility.

If we can make it more readable, that'd nice, but it's not too important. It's a debug step, after all ;) Mostly to help us (or the user) debug things, should they go wrong.

@pushytoxin
Copy link
Contributor Author

The message is informative, I think it's nice to have, it's just not very readable by default. Either YAML or JSON should work equally well.

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.

2 participants