Skip to content

feat: add batch create/update/delete item contracts - #37

Merged
nobodyiam merged 2 commits into
apolloconfig:mainfrom
shalk:main
Sep 6, 2026
Merged

nobodyiam merged 2 commits into
apolloconfig:mainfrom
shalk:main

Conversation

@shalk

@shalk shalk commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add three new Item Management operations for submitting a list of namespace items in one call:
    • POST .../items/batch-create (batchCreateItems)
    • PUT .../items/batch-update (batchUpdateItems)
    • POST .../items/batch-delete (batchDeleteItems)
  • Bump spec version to 0.3.11 and add a CHANGELOG entry
  • Add contract tests validating the new paths/operationIds/schemas

Motivation

Apollo's OpenAPI item endpoints only support single-item create/update/delete (plus namespace-text replace and cross-namespace sync/diff). There's no operation for submitting a structured batch of creates/updates/deletes against a single namespace. This is a companion PR to a corresponding apolloconfig/apollo change that implements these operations against the existing internal ItemChangeSets batch plumbing.

Test plan

  • ./generate.sh --verify
  • python -m unittest tests/test_item_batch_contract.py

🤖 Generated with Claude Code

…ontracts

Expose three new Item Management operations for submitting a list of
namespace items to create, update, or delete in one call:
- POST .../items/batch-create (batchCreateItems)
- PUT  .../items/batch-update (batchUpdateItems)
- POST .../items/batch-delete (batchDeleteItems)

Bump version to 0.3.11.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 7c8e8450-b043-4a03-963d-197907eb9a71


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nobodyiam nobodyiam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The three batch paths and generated Spring signatures align with the companion implementation, and the local contract and generation checks pass. One contract mismatch remains.

Please fix this blocking item before updating:

  1. In apollo-openapi.yaml, express the runtime batch validation in the contract: add minItems: 1 to all three request arrays, add minLength: 1 to the batch-delete key items, and document 400 with ExceptionResponse for batchDeleteItems. Please extend tests/test_item_batch_contract.py accordingly. The companion controller rejects these inputs with HTTP 400, so v0.3.11 should not advertise them as valid or leave that response undocumented.

- Add minItems: 1 to the batch-create/update/delete request arrays
- Add minLength: 1 to batch-delete's key items
- Document 400 with ExceptionResponse for batchDeleteItems
- Extend tests/test_item_batch_contract.py to cover these constraints

Addresses nobodyiam's review on PR apolloconfig#37: the
companion apolloconfig/apollo#5665 controller already rejects these
inputs with HTTP 400, so the contract should advertise the same
constraints instead of leaving them undocumented.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
shalk added a commit to shalk/apollo that referenced this pull request Sep 4, 2026
Expose three new operations backed by the existing ItemChangeSets batch
plumbing (ItemService.updateItems), so callers can submit a list of
items to create, update, or delete against a single namespace in one
call instead of one item at a time:
- POST .../items/batch-create
- PUT  .../items/batch-update
- POST .../items/batch-delete

Bumps apollo-openapi spec to v0.3.11, which defines the new contracts
(apolloconfig/apollo-openapi#37).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@shalk
shalk requested a review from nobodyiam September 4, 2026 03:59
@nobodyiam

Copy link
Copy Markdown
Member

I rechecked head 62d3b987d3da8e2ee1e6de8639f0b345671abc6b. The requested contract/runtime alignment is now present: all three request arrays have minItems: 1, batch-delete keys have minLength: 1, and batchDeleteItems documents the 400 ExceptionResponse. All 13 repository Python tests pass, ./generate.sh --verify passes, and the generated ItemManagementApi signatures align with apolloconfig/apollo#5665. I found no remaining blocking contract issue. The existing CHANGES_REQUESTED state still needs an explicit maintainer re-review before the contract is merged and released.

Note: this reply was generated and posted automatically by AI for initial triage; a maintainer will follow up if needed.

@nobodyiam nobodyiam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rechecked head 62d3b987d3da8e2ee1e6de8639f0b345671abc6b. The previous blocking contract/runtime mismatch is fully resolved: all three request arrays enforce minItems: 1, batch-delete keys enforce minLength: 1, and batchDeleteItems documents the 400 ExceptionResponse, with corresponding contract coverage.

All 13 repository tests pass locally, OpenAPI validation and Portal generation verification pass, and the generated Spring project compiles successfully. The generated signatures also remain aligned with the latest companion implementation in apolloconfig/apollo#5665.

No remaining blocking findings. Approved.

Before merge, please approve and run the pending General CI Checks workflow and ensure all jobs pass.

@nobodyiam
nobodyiam merged commit 0a7c8fe into apolloconfig:main Sep 6, 2026
5 checks passed
mergify Bot pushed a commit to apolloconfig/apollo that referenced this pull request Sep 6, 2026
)

* feat(openapi): add batch create/update/delete for namespace items

Expose three new operations backed by the existing ItemChangeSets batch
plumbing (ItemService.updateItems), so callers can submit a list of
items to create, update, or delete against a single namespace in one
call instead of one item at a time:
- POST .../items/batch-create
- PUT  .../items/batch-update
- POST .../items/batch-delete

Bumps apollo-openapi spec to v0.3.11, which defines the new contracts
(apolloconfig/apollo-openapi#37).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: address nobodyiam's review on batch item OpenAPI operations

- Preserve existing item type in batchUpdateItems instead of unboxing a
  null OpenItemDTO.type, which NPE'd when the field was omitted
- Reject null elements in batch-create/batch-update payloads with 400
  instead of letting them NPE into a 500
- Align batch-create operator docs with the actual single batch-operator
  behavior (no per-item dataChangeCreatedBy fallback), matching
  batch-update/batch-delete
- Fix invalid heading-fragment anchors in the OpenAPI platform docs
- Add a CHANGES.md entry for PR #5665

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

# Conflicts:
#	CHANGES.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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