Skip to content

Remove :/ baseline skip (always check :/ baselines) #1993

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

Merged
merged 2 commits into from
May 5, 2025

Conversation

EliahKagan
Copy link
Member

Closes #1622

This rolls back all changes made to work around the Git 2.47.* bug that underlines #1622, because:

  • We shouldn't suppress the baseline check on CI anymore. That is only needed with Git 2.47.*, and CI is expected to have a recent Git. Currently the GitHub runners have 2.49.*.

  • It is tempting to change the suppression to occur locally instead, to support more development environments. But of prominent distributions, it looks like only Alpine Linux will carry a downstream 2.47.* for an extended time, and only in one version. The problem doing the suppression locally is that affected systems still won't be fully usable for development, as GIX_TEST_IGNORE_ARCHIVES=1 runs on them will still produce archives with broken baselines, which would appear to be suitable for committing due to all tests passing, even though they should not be committed.

This is done in two commits because the first commit takes the route of preserving the suppression but inverting its CI check so the suppression occurs locally instead of on CI, as well as extending the suppression to cover not only the regex_matches test but also the related and analogous contained_string_matches test, which was equally affected by #1622 except that it is not run nearly as often since default features include the feature that regex_matches tests and contained_string_matches does not.

This way, in the unlikely but not entirely implausible event that we do want to bring back the suppression, we can do so by reverting b623bf1 specifically, and the improved form of the suppression in 2400158 will be in place.

More details on all this can be found in the commit messages. For context, see #1622 (comment). This PR makes covers (2) and (3) of the plan there.

EliahKagan added 2 commits May 5, 2025 07:12
For GitoxideLabs#1622, baseline comparisons in `find_youngest_matching_commit`
where Git 2.47.* produces incorrect results were conditionally
suppressed in the `regex_matches` test case in GitoxideLabs#1635. That was
refined in GitoxideLabs#1719, and further refined in GitoxideLabs#1774.

This builds on those, making substantial changes, in view of how:

- We expect that CI have a very recent Git. The runners have been
  past 2.47.* for some time, and now have 2.49.*. Therefore it is
  no longer desirable to suppress the baseline comparison on CI.

- GitoxideLabs#1774 only examined the `regex_matches` test case. That test runs
  when the `revparse-regex` feature, which is a default `gix`
  feature, is enabled.

  But when `revparse-regex` is not enabled, the
  `contained_string_matches` test case runs instead. This test
  suffers the same baseline comparison failures with the same Git
  versions, due to assertions analogous to those that were adjusted
  to let `regex_matches` proceed and pass.

  This can be verified by running

      PATH="$HOME/git-2.47.2/bin:$PATH" GIX_TEST_IGNORE_ARCHIVES=1 \
          cargo nextest run -p gix \
          revision::spec::from_bytes::regex::find_youngest_matching_commit \
          --no-fail-fast --no-default-features \
          --features max-performance-safe,comfort,basic

  where the `PATH` environment variable is set differently if the
  `git` command provided in a Git 2.47.* installation is elsewhere
  than `~/git-2.47.2/bin`. Output from such a run can be seen in:
  https://gist.github.com/EliahKagan/bd8525d048350fc80a7666d8819089db

  Therefore, if a conditional suppression of the baseline
  comparison is to be preserved in `regex_matches`, then an
  analogous suppression under the same conditions should be added
  to `contained_string_matches`.

- Although most operating systems that package Git seem not to have
  2.47.* as their latest available downstream version in any
  release, it seems a few do. In particular, Alpine Linux v3.21 has
  git 2.47.2-r0, as shown at:
  https://pkgs.alpinelinux.org/packages?name=git&branch=v3.21&repo=&arch=x86_64&origin=&flagged=&maintainer=

  Therefore, if it is desirable to work with as wide a range as
  possible of (currently supported) operating system releases as
  development environments, there may be a benefit to conditionally
  suppressing the baseline tests when Git 2.47.* is used *locally*.

- However, doing this locally carries two downsides. First, the
  test code (even if refactored to decrease duplication) will be
  more complicated than if this is not done.

  Second, such an environment will still not be suitable for all
  development tasks, because generating the relevant test fixtures
  on it will contain incorrect baselines and therefore must not be
  committed.

  If they were to be committed by accident, then the problem would
  most likely be caught, because the tests would fail on CI, in
  other environments, and even in the same environment when run
  without `GIX_TEST_IGNORE_ARCHIVES` (in the absence of which the
  baseline comparisons are not suppressed).

  So this is not likely to have severely harmful effects. But it
  could be frustrating, because suppressing the baseline
  comparisons locally hides the usual evidence that the generated
  archives might not be suitable for committing.

This commit keeps the baseline comparison in `regex_matches` but
inverts its CI check so the suppression is only done locally rather
than only on CI, adds the same (modified) suppression to the
analogous `contained_string_matches` test case, and updates
comments accordingly. We may or may not keep this approach.
This rolls back all changes made to work around the Git 2.47.* bug
that underlies GitoxideLabs#1622, including the change made in the immediately
preceding commit.

This undoes the changes to `regex.rs` from GitoxideLabs#1635, GitoxideLabs#1719, GitoxideLabs#1774, and
2400158 (which is the immediately preceding commit). That file is
now as it was in 3745212.

The rationale is that the disadvantages of inverting the CI check
and extending the suppresson, as described in the previous commit,
really outweigh the advantages. This is mainly due to the risk of
generating archives that should not be committed but seem based on
test results like they could be committed.

(The suppressions being removed here will most likely not be needed
in the future, but if they are then this commit can be reverted,
and the suppression will be done locally but on on CI, consistently
across feature for which the relevant tests are run, and only when
Git is found to be a version in the 2.47.* range.)

Closes GitoxideLabs#1622
@EliahKagan EliahKagan enabled auto-merge May 5, 2025 07:28
@EliahKagan EliahKagan merged commit 7a33e2a into GitoxideLabs:main May 5, 2025
22 checks passed
@EliahKagan EliahKagan deleted the run-ci/baseline branch May 5, 2025 08:12
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request May 6, 2025
This expands the `unit-tests` recipe in the `justfile` (which is
one of the recipes the full CI `test` job runs) to add a command
that tests `gix` with all the current default features *except* for
`extras` and its subfeatures.

This appears to have been a missing potentially valuable area in
testing. In particular, as noted in 2400158 (GitoxideLabs#1993), the Git 2.47.*
bug that caused incorrect `find_youngest_matching_commit` baselines
to be generated had applied equally to the `regex_matches` and
`contained_string_matches` tests, but only the `regex_matches`
failure was found locally in GitoxideLabs#1622 and on CI in GitoxideLabs#1635, because no
combination of features under which `contained_string_matches` runs
was tested.

Thus, `contained_string_matches` was effectively not exercised, and
regressions that it should catch, as well as the effect of possible
changes to the test if any others are ever made, were not tested.
This resulted in the mitigations for GitoxideLabs#1622 not covering that test
either (until 2400158).

This commit chooses a combination of features that may plausibly be
in practical use and that is fairly simple to specify, to fill the
gap.

(If this turns out to slow things down too much, then it could be
narrowed to only run some tests.)

This only adds a command to the recipe. It does not remove any
commands that were already there. `gix` remains tested in all the
ways it was tested before, as well as in this one new way.
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request May 6, 2025
This expands the `unit-tests` recipe in the `justfile` (which is
one of the recipes the full CI `test` job runs) to add a command
that tests `gix` with all the current default features *except* for
`extras` and its subfeatures.

This appears to have been a missing potentially valuable area in
testing.

In particular, as noted in 2400158 (GitoxideLabs#1993), the Git 2.47.* bug that
caused incorrect `find_youngest_matching_commit` baselines to be
generated had applied equally to the `regex_matches` and
`contained_string_matches` tests, but only the `regex_matches`
failure was found locally in GitoxideLabs#1622 and on CI in GitoxideLabs#1635, because no
combination of features under which `contained_string_matches` runs
was tested.

Thus, `contained_string_matches` was effectively not exercised, and
regressions that it should catch, as well as the effect of possible
changes to the test if any others are ever made, were not tested.
This resulted in the mitigations for GitoxideLabs#1622 not covering that test
either (until 2400158).

This commit chooses a combination of features that may plausibly be
in practical use and that is fairly simple to specify, to fill the
gap.

(If this turns out to slow things down too much, then it could be
narrowed to only run some tests.)

This only adds a command to the recipe. It does not remove any
commands that were already there. `gix` remains tested in all the
ways it was tested before, as well as in this one new way.
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.

regex_matches baseline check fails due to rev-parse changes in git 2.47.0
1 participant