Skip to content

statestore: Implement Lock and Unlock for state stores#1266

Merged
austinvalle merged 11 commits into
mainfrom
av/lock-rpcs
Feb 10, 2026
Merged

statestore: Implement Lock and Unlock for state stores#1266
austinvalle merged 11 commits into
mainfrom
av/lock-rpcs

Conversation

@austinvalle

Copy link
Copy Markdown
Member

Related Issue

N/A

Description

This PR implements the LockState and UnlockState RPCs for statestore.StateStore, as well as adds a simple statestore.LockInfo helper for representing the lock data in a data store (presumably as JSON, although we can expand it later if there are other use-cases).

The general goal here is to provide a good option in framework that is close to the Terraform core LockInfo struct, which we can then recommend in documentation: https://github.com/hashicorp/terraform/blob/8a615f93e9c11105c6fa79287a0494f8f6a2886a/internal/states/statemgr/locker.go#L113-L141 . It's not required, and the provider developer can ultimately choose how they want to store the lock, as long as the LockID is able to be retrieved and referenced 👍🏻

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

No

austinvalle and others added 8 commits February 2, 2026 14:44
Bumps [github.com/hashicorp/copywrite](https://github.com/hashicorp/copywrite) from 0.22.0 to 0.24.0.
- [Release notes](https://github.com/hashicorp/copywrite/releases)
- [Commits](hashicorp/copywrite@v0.22.0...v0.24.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/copywrite
  dependency-version: 0.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@austinvalle austinvalle added this to the v1.18.0 milestone Feb 2, 2026
@austinvalle austinvalle requested a review from a team as a code owner February 2, 2026 22:29
@austinvalle austinvalle added the enhancement New feature or request label Feb 2, 2026

@stephybun stephybun 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 ⚡

@austinvalle austinvalle merged commit e642d51 into main Feb 10, 2026
39 checks passed
@austinvalle austinvalle deleted the av/lock-rpcs branch February 10, 2026 13:11
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants