Skip to content

Fix Collision error not reported when paused#546

Merged
erdii merged 1 commit into
mainfrom
bugfix/collisionerrorpaused-rebased
Jun 12, 2026
Merged

Fix Collision error not reported when paused#546
erdii merged 1 commit into
mainfrom
bugfix/collisionerrorpaused-rebased

Conversation

@erdii

@erdii erdii commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Change Type

Check List Before Merging

  • This PR passes all pre-commit hook validations.
  • This PR is fully tested and regression tests are included.
  • Relevant documentation has been updated.

Additional Information

@erdii erdii requested a review from a team as a code owner June 9, 2026 13:00
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

ObjectEngine's paused reconciliation behavior changes from skipping the create operation to executing a dry-run create. The migrateFieldManagersToSSA function now accepts reconciliation options and skips field-manager migration when paused. Options are threaded through create, apply, and collision-recovery paths.

Changes

Paused Reconciliation and Options Threading

Layer / File(s) Summary
migrateFieldManagersToSSA options refactoring
machinery/objects.go
migrateFieldManagersToSSA signature updated to accept types.ObjectReconcileOptions and conditionally skip migration when options.Paused is set.
create and apply methods with paused dry-run
machinery/objects.go
create method now appends client.DryRunAll when paused instead of returning nil early; apply method threads options into migrateFieldManagersToSSA.
Collision recovery options threading
machinery/objects.go
Reconcile's create-collision recovery path now passes options to migrateFieldManagersToSSA instead of calling it without options.
Test coverage for paused and collision behavior
machinery/objects_test.go
Updated paused create test case mock configuration; added TestObjectEngine_Collision with paused and non-paused subtests for AlreadyExists error handling; migrateFieldManagersToSSA test calls updated to pass options.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is an unfilled template with no actual summary, change type, or additional information provided by the author. Complete the description by adding a summary of changes, selecting a change type, and filling in any relevant additional information.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: addressing a collision error that was not being reported when reconciliation was paused.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/collisionerrorpaused-rebased

Comment @coderabbitai help to get the list of available commands and usage tips.

@erdii

erdii commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

supersedes #344

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.69%. Comparing base (42e572f) to head (07e5518).

Files with missing lines Patch % Lines
machinery/objects.go 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #546      +/-   ##
==========================================
+ Coverage   82.68%   82.69%   +0.01%     
==========================================
  Files          32       32              
  Lines        2737     2739       +2     
==========================================
+ Hits         2263     2265       +2     
  Misses        346      346              
  Partials      128      128              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
machinery/objects_test.go (1)

742-742: ⚡ Quick win

Test name is now misleading.

The test name "Paused, create skipped" no longer matches the behavior. Based on the updated mock configuration and the implementation (context snippet showing create() appends client.DryRunAll when paused), the create operation is now executed as a dry-run rather than being skipped entirely.

Consider renaming to something like "Paused, create dry-run" to accurately reflect the current behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@machinery/objects_test.go` at line 742, The test name "Paused, create
skipped" in the test case is misleading because the implementation now executes
the create operation as a dry-run (by appending client.DryRunAll when paused)
rather than skipping it entirely. Rename the test name field to accurately
reflect the actual behavior, such as "Paused, create dry-run" to match the
current implementation and mock configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@machinery/objects_test.go`:
- Line 742: The test name "Paused, create skipped" in the test case is
misleading because the implementation now executes the create operation as a
dry-run (by appending client.DryRunAll when paused) rather than skipping it
entirely. Rename the test name field to accurately reflect the actual behavior,
such as "Paused, create dry-run" to match the current implementation and mock
configuration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 21332906-1d7d-448b-9b00-a911952756c2

📥 Commits

Reviewing files that changed from the base of the PR and between 42e572f and 07e5518.

📒 Files selected for processing (2)
  • machinery/objects.go
  • machinery/objects_test.go

@thetechnick thetechnick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@erdii erdii merged commit 00f5fbd into main Jun 12, 2026
4 of 5 checks passed
@erdii erdii deleted the bugfix/collisionerrorpaused-rebased branch June 12, 2026 12:27
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