Conversation
Github Action will run basic tests including format-check, static-analysis and unit-tests. And testing farm will run integration tests.
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>
- 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.
|
🤖 Hi @coiby, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
📋 Review Summary
This Pull Request introduces a significant new feature: auto-discovery of the good commit. The implementation is well-designed, robust, and includes comprehensive test coverage for both git and RPM modes, as well as various edge cases. The changes are well-integrated into the existing codebase, and documentation (README, bisect.conf) has been updated to reflect the new optional GOOD_COMMIT parameter.
🔍 General Feedback
- The addition of the
trap SIGINTinkab.shis an excellent safety improvement. - The refactoring of
do_abortandsetup_kdumpfunctions improves maintainability and clarity. - Thorough test coverage for the new feature in
spec/find_good_commit_spec.shis commendable.
|
|
||
| - name: Unit Tests | ||
| run: | | ||
| dnf install git -yq |
There was a problem hiding this comment.
🟢 This change is good to ensure git is available for unit tests, especially with the new features relying on git operations. It clarifies the environment setup for the CI/CD pipeline.
| log "Failed to run 'make localmodconfig, will try $ORIGINAL_KERNEL_CONFIG" | ||
| # The test kernel may be removed. As a result "make localconfig" won't work | ||
| # The test kernel may be removed. As a result, "make localmodconfig" | ||
| # may not work. "make localmodconfig" will need to find a base config |
There was a problem hiding this comment.
🟢 The updated comment provides much better context on why make localmodconfig might fail and what the fallback mechanism entails. This greatly improves the maintainability and debuggability of the script.
| @@ -49,8 +51,8 @@ remove_test_kernel() { | |||
| if [[ -z "$kernel_to_remove" ]]; then return; fi | |||
|
|
|||
| # Safety check: never remove the original kernel | |||
There was a problem hiding this comment.
🟢 This change makes the safety check for remove_test_kernel more robust and direct by comparing the kernel release strings. It's a good improvement to prevent accidental removal of the original kernel.
| # | ||
| # shellcheck source=lib.sh | ||
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/lib.sh" | ||
|
|
There was a problem hiding this comment.
🟠 Adding a trap for SIGINT to call reboot_to_origin_kernel is an excellent safety enhancement. It ensures that the system returns to a known good state even if the bisection process is interrupted, which is crucial for reliability.
| @@ -102,6 +102,7 @@ signal_checkpoint() { | |||
| } | |||
|
|
|||
| declare -A release_commit_map | |||
There was a problem hiding this comment.
🟢 Declaring _rpm_releases=() here is a good and necessary step for the new RPM mode auto-discovery feature. It ensures the array is properly initialized before use.
| @@ -349,22 +429,23 @@ setup_kdump() { | |||
| fi | |||
There was a problem hiding this comment.
🟢 Updating the RPM initialization logic to treat GOOD_COMMIT as optional and only abort if BAD_COMMIT or a provided GOOD_COMMIT is not found, correctly integrates the auto-discovery feature. This ensures flexibility for the user while maintaining necessary checks.
| do_abort "KERNEL_RPM_LIST file not found." | ||
| fi | ||
| # kexec reboot by default inherit /proc/cmdline. So make sure | ||
| # crashkernel exists in /proc/cmdline |
There was a problem hiding this comment.
🟠 The integration of find_good_commit into initialize() when GOOD_REF is empty is the core of the new auto-discovery feature. This ensures that a good commit is automatically identified when the user doesn't provide one, streamlining the bisection process.
| @@ -0,0 +1,211 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
🟡 The addition of spec/find_good_commit_spec.sh provides excellent test coverage for the new auto-discovery feature. The test cases cover both git and RPM modes, including success scenarios, failure conditions, and edge cases like root commit fallback, demonstrating a thorough approach to testing.
| @@ -44,23 +45,19 @@ Describe 'remove_test_kernel' | |||
| End | |||
|
|
|||
| Describe "safety check" | |||
There was a problem hiding this comment.
🟡 The updated and new test cases for remove_test_kernel significantly improve the testing for the safety check. This ensures that the original kernel is not accidentally removed, even under various conditions, which is critical for system stability.
| @@ -54,7 +54,6 @@ INSTALL_STRATEGY="rpm" | |||
| TEST_STRATEGY="panic" | |||
| REBOOT_STRATEGY= | |||
There was a problem hiding this comment.
🟢 Removing the explicit GOOD_COMMIT=$GOOD_COMMIT from the test configurations is correct, as GOOD_COMMIT is now optional and can be auto-discovered. This aligns the tests with the new feature's behavior.
b018685 to
7fcdea6
Compare
7fcdea6 to
7c1a398
Compare
Testing harm reject hardcoded provision method 'virtual.testcloud',
Suitable provision method 'virtual.testcloud' disallowed by configuration
75b8caa to
77a9584
Compare
No description provided.