Skip to content

fix(cmd/boot): support array patch operations for boot resources#100

Merged
synackd merged 1 commit into
mainfrom
fix/patch-behavior
Jun 22, 2026
Merged

fix(cmd/boot): support array patch operations for boot resources#100
synackd merged 1 commit into
mainfrom
fix/patch-behavior

Conversation

@synackd

@synackd synackd commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Generate RFC 6902 JSON Patch payloads when boot <resource> patch commands use --add or --remove so array updates can be represented correctly. Use key-value/merge-patch method for --set-/--unset updates, but switch the selected patch method automatically when array operations are present.

Allow patch payload data to be an object or array by widening boot-service patch client arguments from map[string]interface{} to interface{}. This lets RFC 6902 patch documents pass through as top-level arrays.

Update --remove semantics to remove by array index instead of by value, and document that --add appends to an existing array. Refresh the manual page patch forms to include inline -d data and align BMC, config, and node command documentation.

Add tests for:

  • RFC 6902 array payload parsing
  • dot-path to JSON Pointer conversion and escaping
  • keyval patch data generation
  • RFC 6902 patch data generation for add/remove
  • invalid remove index rejection

This will likely affect #98.

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

@synackd synackd force-pushed the fix/patch-behavior branch 3 times, most recently from f45d6f3 to 842571f Compare June 17, 2026 14:57
@synackd

synackd commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

This is now ready for review and has been rebased onto the latest main.

Generate RFC 6902 JSON Patch payloads when boot patch commands use
--add or --remove so array updates can be represented correctly. Keep
--set/--unset-only updates on the existing keyval/merge-patch path, but
switch the selected patch method automatically when array operations are
present.

Allow patch payload data to be an object or array by widening boot-service
patch client arguments from map[string]interface{} to interface{}. This lets
RFC 6902 patch documents pass through as top-level arrays.

Update --remove semantics to remove by array index instead of by value, and
document that --add appends to an existing array. Refresh the man page patch
forms to include inline -d data and align BMC, config, and node command
documentation.

Add tests for:

- RFC 6902 array payload parsing
- dot-path to JSON Pointer conversion and escaping
- keyval patch data generation
- RFC 6902 patch data generation for add/remove
- invalid remove index rejection

Signed-off-by: Devon Bautista <17506592+synackd@users.noreply.github.com>
@synackd synackd force-pushed the fix/patch-behavior branch from 842571f to 9243066 Compare June 18, 2026 22:17
@synackd synackd merged commit bd364da into main Jun 22, 2026
13 checks passed
@synackd synackd deleted the fix/patch-behavior branch June 22, 2026 17:50
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