Skip to content

refactor: simplification - #106

Merged
rustatian merged 2 commits into
masterfrom
refactor/simplification
Oct 6, 2026
Merged

rustatian merged 2 commits into
masterfrom
refactor/simplification

Conversation

@rustatian

Copy link
Copy Markdown
Member

Reason for This PR

Remove repeated memory lock callback setup.

Description of Changes

  • Register each lock and create its cleanup callback in one place. Start the callback after registration in each acquisition path.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 17:30

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The refactor preserves existing behavior while reducing duplicated setup and retaining focused test coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Simplifies in-memory lock callback setup by centralizing lock registration in makeLockCallback.

Changes:

  • Registers callback channels inside makeLockCallback.
  • Updates acquisition paths and tests for the simplified API.
File Description
locker.go Centralizes lock registration and callback creation.
force_release_test.go Verifies registration occurs before callback execution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.80%. Comparing base (21dbe6a) to head (502fb9e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #106      +/-   ##
==========================================
+ Coverage   87.28%   87.80%   +0.52%     
==========================================
  Files           9        9              
  Lines        1007      968      -39     
==========================================
- Hits          879      850      -29     
+ Misses        128      118      -10     

☔ 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.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian self-assigned this Oct 6, 2026
@rustatian
rustatian merged commit 5c974fb into master Oct 6, 2026
8 checks passed
@rustatian
rustatian deleted the refactor/simplification branch October 7, 2026 09: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