Skip to content

feat(node-policy): add notloaded warnings and shared document scope docs - #31

Merged
SomeoneWithOptions merged 1 commit into
mainfrom
fix/node-policy-warning-kind
Oct 22, 2026
Merged

SomeoneWithOptions merged 1 commit into
mainfrom
fix/node-policy-warning-kind

Conversation

@SomeoneWithOptions

Copy link
Copy Markdown
Owner

Summary

Node type policy ops are now tagged Preview in the upstream spec (n8n Public API 1.1.1), and the write-result warnings changed shape. This PR updates the client and CLI to match.

Warnings carry kind (breaking fix)

  • NodeTypePolicyWarning gains kind (shadowed | notLoaded); shadowedByRuleId is omitted when empty. Unknown kinds are kept as sent.
  • set --output json now keeps kind, so notLoaded and shadowed can be told apart.
  • Text output renders per kind. Before, every warning was printed as "rule X never matches", which was wrong for notLoaded. An unknown kind gets a generic line.
  • set --input now ignores warnings as raw JSON. Before, a raw API response or a previous set output failed with unknown field "kind", even though the help said warnings were accepted.

get → edit → set semantics (help only, no wire change)

  • Group, scope and get/set help now say that GET returns the rules of every attached document combined, while PUT writes only the scope's own document. It warns that a round trip copies rules from shared documents into the scope's own document.
  • Help marks the API as Preview.
  • The text label "Scope document" is now "Scope ID". Help says it is null until the scope is first written.
  • 409 hints name attachment changes and updates to attached shared documents as causes.
  • Docs regenerated (make docs).

Not in this PR

  • Making the client generic for credential-type policies (optional prep in the brief) is left to the policy-documents branch. It means renaming every type and method, which is more than a small change.

Evidence

  • Spec-derived: everything above (openapi.upstream.yml 1.1.1, policyEffectiveWriteResultPublicDto, the PUT instance/project and attachment descriptions).
  • Not live-verified: node policy answers 403 (not licensed) on the test instance. The spec gives no definition of notLoaded; the help wording ("selects node types this instance has not loaded") comes from the name.

Tests

  • Fixtures updated with kind, plus a notLoaded case.
  • New tests: JSON output keeps kind and omits shadowedByRuleId for notLoaded; unknown-kind rendering; a previous set output, a raw API response, and an unknown warning shape all accepted as --input without sending back warnings/scopeId; client encode round trip.
  • make check green.

🤖 Generated with Claude Code

@SomeoneWithOptions
SomeoneWithOptions merged commit 5161541 into main Oct 22, 2026
4 checks passed
@SomeoneWithOptions
SomeoneWithOptions deleted the fix/node-policy-warning-kind branch October 22, 2026 04:34
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.

1 participant