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

Regularly test the version comparison functionality #576

Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Aug 22, 2024

There is a function to compare versions both in git update-git-for-windows as well as in the installer. Let's validate in our CI builds that both work as intended.

The script has an option to run a self-check; Let's make this part of
the CI build.

Signed-off-by: Johannes Schindelin <[email protected]>
It is uncommon that somebody tries to downgrade to an -rc version, but
it does happen from time to time.

Signed-off-by: Johannes Schindelin <[email protected]>
Currently, this only validates that the `VersionCompare()` function
works as intended. To that end, the test cases from the corresponding
self-check in `git update-git-for-windows` have been transmogrified, and
two new options have been added to `installer/release.sh`:

	--self-check

		This produces an installer that does not do anything but
		run the tests and exit with a non-zero exit code in case
		there were failures, otherwise exit code 0.

	--include-self-check

		This produces an installer that first runs the tests,
		and exits with exit code 1 if any test failed.

		If no test failed, it continues to install Git for
		Windows.

		This mode is useful for CI, where we want to run the
		self checks and also install Git for Windows in order to
		validate the installation.

Signed-off-by: Johannes Schindelin <[email protected]>
Now that we have a mode where internal validations can be run in the
installer before installing anything, let's do precisely that in the CI
builds (and fail the build if any tests fail).

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho self-assigned this Aug 22, 2024
This is a left-over from long ago, introduced in 4908879 (installer:
be prepared for Git tags when comparing versions, 2019-10-30).
Reconstructing my memory from that commit, it looks as if my intention
was to replace the faulty logic, but I left in that now-useless
conditional assignment of `Result` which is immediately overridden.

To help future me, let's just remove the unneeded code.

Signed-off-by: Johannes Schindelin <[email protected]>
Installing v2.46.0.vfs.0.0 while the official Git for Windows
v2.46.0 is installed constitutes neither an upgrade nor a downgrade. So
let's not complain that it is!

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho merged commit 6cf3583 into git-for-windows:main Aug 26, 2024
6 checks passed
@dscho dscho deleted the more-robust-installer-downgrade-check branch August 26, 2024 13: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.

2 participants