Skip to content

SPRXCLT-23: support query params and conditional PUT/DELETE in putEmptyObject#312

Merged
bert-e merged 2 commits into
development/9from
improvement/SPRXCLT-23-query-params-in-put-empty-object
May 14, 2026
Merged

SPRXCLT-23: support query params and conditional PUT/DELETE in putEmptyObject#312
bert-e merged 2 commits into
development/9from
improvement/SPRXCLT-23-query-params-in-put-empty-object

Conversation

@jonathan-gramain

@jonathan-gramain jonathan-gramain commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _createRequestHeader: append query string from params.query to the request path
  • putEmptyObject: accept params object (params.headers, params.query); return x-scal-version from PUT response as second callback argument (not the key)
  • putEmptyObject: fix non-streaming error handling to propagate expected errors (err.isExpected) rather than always wrapping in InternalError
  • deleteWithParams: new method — version-conditional DELETE via params.query.version; avoids changing the existing delete() signature for backward compatibility

Tests

  • Test server: support conditional PUT/DELETE (version param, If-None-Match: *), track per-key versions, return x-scal-version in PUT/HEAD responses
  • Update existing putEmptyObject and conditional-PUT tests for new signatures
  • Add three deleteWithParams tests (matching version, wrong version, absent key)

Motivation

Required by MD-1241 (lib/ring/Lease.js in the metadata service), which uses these capabilities to implement a distributed lease backed by a RING object with atomic acquire, steal, renew, and release.

Test plan

  • yarn test passes (existing + new unit tests)

🤖 Generated with Claude Code

@bert-e

bert-e commented May 13, 2026

Copy link
Copy Markdown
Contributor

Hello jonathan-gramain,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented May 13, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

jonathan-gramain and others added 2 commits May 13, 2026 17:47
…tyObject

Changes to lib/sproxyd.js:
- _createRequestHeader: append query string from params.query to request path
- putEmptyObject: accept params object (params.headers, params.query); return
  x-scal-version from PUT response as second callback argument (not the key)
- putEmptyObject: fix non-streaming error handling to propagate expected errors
  (err.isExpected) rather than always wrapping in InternalError
- deleteWithParams: new method — version-conditional DELETE via params.query.version;
  avoids changing the existing delete() signature for backward compatibility

Changes to tests/unit/sproxyd.js:
- test server: support conditional PUT/DELETE (version param, If-None-Match: *),
  track per-key versions, return x-scal-version in PUT/HEAD responses
- update existing putEmptyObject and conditional-PUT tests for new signatures
- add three deleteWithParams tests (matching version, wrong version, absent key)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jonathan-gramain jonathan-gramain force-pushed the improvement/SPRXCLT-23-query-params-in-put-empty-object branch from 1f619df to 9aae3ad Compare May 14, 2026 00:49
@jonathan-gramain jonathan-gramain changed the title SPRXCLT-23: support query params and conditional PUT in putEmptyObject SPRXCLT-23: support query params and conditional PUT/DELETE in putEmptyObject May 14, 2026
@jonathan-gramain

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented May 14, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9

The following branches have NOT changed:

  • development/6.4
  • development/7.10
  • development/7.4
  • development/8.0
  • development/8.1
  • development/8.2

Please check the status of the associated issue SPRXCLT-23.

Goodbye jonathan-gramain.

The following options are set: approve

@bert-e bert-e merged commit 9aae3ad into development/9 May 14, 2026
1 check passed
@bert-e bert-e deleted the improvement/SPRXCLT-23-query-params-in-put-empty-object branch May 14, 2026 18:52
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.

4 participants