Skip to content

Conversation

@stefanhaller
Copy link
Collaborator

Some of our documentation is auto-generated from the source code (the defaults section in Config.md, and the keybinding cheat sheets), and so is the JSON schema for the config file. We have a check running on CI that verifies that when the source code changes (e.g. a new config option is added), those files are properly regenerated, to make sure they are always up to date with the latest version of the source code.

This causes a problem when people look at the documentation for a newly added config option and wonder why it doesn't work in the lazygit version they are using. Lots of issues were filed where people report this as a bug, and we have to patiently explain to them that the documentation describes a feature that hasn't been released yet. A similar problem occurs when we rename a config option (as has recently happened with the 'paging' config, which was renamed to 'pagers' in #4953), in which case the user's editor (if it supports JSON validation against the jsonschema store) starts to complain about the old config, even though it still works, and the new one doesn't yet.

To solve this, keep the documentation and the JSON schema unchanged for the lifetime of a release; make those continuous changes in a separate copy of those folders, and only copy the files back to the real location right before we make a release. To facilitate this, we add a script to conveniently create a PR for copying the files back, and add a check to the release workflow to abort with an error if this was forgotten.

Note that we only use this approach in order to solve the problem with the auto-generated files; this has a consequence for making changes to the other, non-auto-generated parts of the docs. For example, when fixing a spelling error, rewording a paragraph to explain it better, or adding an entirely new file, those changes will now have to be made in docs-master, which means:

  1. if we forget this and make the change in docs accidentally, it will be reverted with the next release.
  2. if we do remember to make the change in docs-master, it will take until the next release for it to be visible to users.

We can mitigate 2. by making the identical change in both places, but I think we should first wait and see how often it happens, and whether it is actually a problem.

This way it will also work when we make a copy of the entire docs folder.
The plan is to keep the original docs and schema folders unchanged for the
duration of a release; we'll only continuously update the -master copies. Right
before a new release we will copy them over.
This needs to be run immediately before creating a release.

We could go further here and use gh to create the PR, but since I'm usually
logged in with my work account to gh, this won't help me. The git push command
prints the URL to create the PR, so it's a simple matter of command-clicking it,
which is good enough for me.
…t up to date

Of course it would be cooler if the workflow could create the PR and merge it if
necessary, but this will have to do for now.
@stefanhaller stefanhaller added the maintenance For refactorings, CI changes, tests, version bumping, etc label Nov 2, 2025
@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for aa2bdb01 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (aa2bdb0) Report Missing Report Missing Report Missing
Head commit (f3fa1b8) 58839 51206 87.03%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5010) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance For refactorings, CI changes, tests, version bumping, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants