Skip to content

Add find_good_commit() with exponential search#16

Open
coiby wants to merge 15 commits intorhkdump:mainfrom
coiby:feature/auto-discover-good-commit
Open

Add find_good_commit() with exponential search#16
coiby wants to merge 15 commits intorhkdump:mainfrom
coiby:feature/auto-discover-good-commit

Conversation

@coiby
Copy link
Copy Markdown
Member

@coiby coiby commented Apr 6, 2026

Resolves: #1

Walks backward through history with doubling steps to auto-discover
a good commit when GOOD_COMMIT is not specified. Supports both git
and RPM modes.

@coiby coiby force-pushed the feature/auto-discover-good-commit branch from f357f07 to e09b439 Compare April 6, 2026 02:32
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from e09b439 to d95ba79 Compare April 6, 2026 02:39
@coiby coiby force-pushed the main branch 2 times, most recently from 433c4c8 to 124474c Compare April 7, 2026 13:15
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from d82cd88 to 1db5433 Compare April 7, 2026 13:16
@coiby coiby force-pushed the main branch 2 times, most recently from 75b8caa to 77a9584 Compare April 7, 2026 14:03
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from 1db5433 to 0674d68 Compare April 8, 2026 06:54
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from 0674d68 to 3a83da9 Compare April 11, 2026 00:43
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from 3a83da9 to d861fc0 Compare April 11, 2026 00:50
@coiby coiby force-pushed the feature/auto-discover-good-commit branch 2 times, most recently from bc5b9db to 2bd9a58 Compare April 11, 2026 01:27
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from 2bd9a58 to b667619 Compare April 11, 2026 01:29
coiby and others added 7 commits April 11, 2026 09:38
Instead of comparing hardcoded /boot paths, use ORIGINAL_KERNEL_RELEASE
to verify if the kernel being removed is the original one. This allows
proper identification even if kernels are installed to unusual paths like
/boot/boot/ (e.g. when using guestmount, chroot and dnf install).
If the program aborts after the running test kernel get removed, the
program can fail to build the kernel next time because "make
localmodconfig" will fail. So always reboot to the original kernel.

And add a trap so when the program aborts it will be rebooted to the
original kernel.
When GOOD_COMMIT is omitted, the tool will use exponential search
(doubling steps backwards through history) to find a good commit
automatically, in both git source and RPM modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Six tasks covering: _rpm_releases array, find_good_commit() function,
tests for all modes, initialize() integration, verify skip, and docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Populates an ordered array of kernel releases during RPM list
processing, needed for index-based traversal in auto-discovery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Walks backward through history with doubling steps to auto-discover
a good commit when GOOD_COMMIT is not specified. Supports both git
and RPM modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
coiby and others added 8 commits April 11, 2026 09:38
- Add test for git mode when no good commit is found (aborts with error)
- Add tests for RPM mode: success case and BAD_COMMIT validation
- Fix exponential search to test index 0/root commit as final fallback
  when the exponential steps skip over the earliest commit
- Add *.swp to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When GOOD_COMMIT is not specified, initialize() now only validates
BAD_COMMIT in RPM mode and leaves GOOD_REF empty. The auto-discovery
happens later in verify_intial_commits().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reorders verify_intial_commits() to check the bad commit first.
If it's not actually bad, there's no point searching for a good
commit. When GOOD_REF is empty, calls find_good_commit() after
verifying bad. When GOOD_REF is set, verifies it normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updated bisect.conf to clarify that GOOD_COMMIT is optional and describe
the auto-discovery behavior using exponential search backward through history.

Updated README.md to mark GOOD_COMMIT as optional in both Git Mode and RPM
Mode configuration tables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
So the feature that users only need to specify GOOD_COMMIT can be
tested.
… without crashkernel

When the to-be-tested kernel is already installed but doesn't have the
kernel crashkernel set up, the ssh_auto test plan will fail. Because
kdump-utils will only set up crashkernel parameter when a kernel is
freshly installed. Thus it won't work for already installed kernel. Call
"kdumpctl reset-crashkernel --kernel=ALL" unconditionally to address
this corner case.

Also optimize the code that enables kdump.serive.
@coiby coiby force-pushed the feature/auto-discover-good-commit branch from b667619 to 4084faf Compare April 11, 2026 01:38
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.

Allow to bisect by only specifying a bad commit

2 participants