mattermost-load-test-ng icon indicating copy to clipboard operation
mattermost-load-test-ng copied to clipboard

Automated generation of sample config files

Open agarciamontoro opened this issue 2 years ago • 10 comments
trafficstars

Summary

Just some Friday night fun to generate the sample config files automatically, since I found some discrepancies earlier this week and thought this was going to get out of sync rather sooner than later even if I fixed it.

So I created a command to generate the sample files automatically using the default values in the structs (making sure that slices had at least one element, so we could showcase all possible values), and added it to make assets so that CI will fail if it detects some change there.

Next step (next Friday, maybe?): use ltassist check to check the docs in CI as well.

Ticket Link

--

agarciamontoro avatar Nov 03 '23 17:11 agarciamontoro

That last commit should fail because I didn't run make assets. Let's see :eyes:

agarciamontoro avatar Nov 03 '23 17:11 agarciamontoro

It failed, yay! Let's see now after make assets.

agarciamontoro avatar Nov 03 '23 17:11 agarciamontoro

~~CI didn't run, huh?~~ Ah, it's running now, it just took a while :shrug:

agarciamontoro avatar Nov 03 '23 17:11 agarciamontoro

And it worked!

I acknowledge that we lost some specific examples (as in simplecontroller), but I'd argue that specific examples should live elsewhere, and that the sample config files should simply showcase all the possible fields and default values. Let me know if that doesn't make sense for you guys.

agarciamontoro avatar Nov 03 '23 17:11 agarciamontoro

So basically we are creating empty configs with default values if possible, rather than with examples, not sure if this was we semantically desired. cc @streamer45?

isacikgoz avatar Nov 06 '23 08:11 isacikgoz

So basically we are creating empty configs with default values if possible, rather than with examples

Yes, but I'd argue that the most important thing here is that the configs are now complete and will remain in sync from now on. But yes, we are losing some of the examples we wrote there. To be honest, the only one I'm actually concerned about is the list of coordinator queries; we rarely, if ever, use the rest. And I still believe that those examples, even if they're super useful, should live somewhere else, probably in a directory of template configurations tailored for different specific purposes, which is something we have discussed in the past. I can try to include that in this same PR so we don't lose any information when merging this one.

agarciamontoro avatar Nov 06 '23 09:11 agarciamontoro

I think having pre-loaded default config files are very important for someone to get up and running quickly with the tool. Losing the coordinator queries is not ideal. I think you are thinking in the right direction: having a directory to store some template configs and then merge with the autogeneration code is ideal in my view.

agnivade avatar Nov 06 '23 09:11 agnivade

Neat, I'll work on that directory of templates then. Thanks for the discussion, guys :)

agarciamontoro avatar Nov 06 '23 09:11 agarciamontoro

Removing myself. Feel free to request a review when ready.

agnivade avatar Dec 07 '23 04:12 agnivade

Fair enough! I will add you guys as reviewers again when it's done.

agarciamontoro avatar Dec 11 '23 10:12 agarciamontoro

Closing this ancient PR. Will reopen if I have some spare time to spend on it

agarciamontoro avatar Sep 23 '24 13:09 agarciamontoro