Conversation
--rule-transform-name said "Name or ID" but always sent the value as transformation.name. The API matches a transform rule's transformation by name and creates one when the name is new, even without code. So an ID, or a mistyped name, returned 200 and attached a new, empty transformation that failed every event with "TypeError: undefined requires parameter 1 to be a string". Resolve the value first, on create, update and upsert: - found by ID or exact name: reference it by transformation_id, sending any --rule-transform-code/--rule-transform-env as an update to it - not found, with code: create a new transformation with that name, as before (an ID is an error) - not found, without code: error, pointing at transformation list and --rule-transform-code Update and upsert now also require --rule-transform-name with transform code or env, as create already did. --rules and --rules-file are sent as given. Help text and REFERENCE.md say that code and env replace an existing transformation's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--rule-transform-namesaid "Name or ID" but always sent the value astransformation.name. The API matches by name and creates a transformation when the name is new, even with no code. So passing an ID, or a mistyped name, returned 200 and attached a new, empty transformation. That transformation failed every event withTypeError: undefined requires parameter 1 to be a string.The CLI now resolves the value before sending, on
create,updateandupsert:--rule-transform-name--rule-transform-code--rule-transform-codetransformation_idtransformation_id; code/env update ittrs_…IDupdateandupsertnow require--rule-transform-namewhen transform code or env is given, ascreatealready did--rules/--rules-fileare unchanged and sent as givenREFERENCE.mdnow say that code and env replace an existing transformation's, since a transformation can be shared by several connectionsRoot cause in core
processToPersistableRulescallsTransformationController.create(…, create_or_update = true). That looks up{team_id, name}and creates on a miss.updateschema, wherecodeis optional.codecolumn is nullable:table.text('code').notNullable;in the migration is missing its()./transformations/run). A core-side guard is being raised separately, so other clients (API, MCP, Terraform) are covered too.Implementation
resolveRuleTransformationinpkg/cmd/connection_transform_rule.go, called afterbuildConnectionRulesin all three commands. It sits outside the builder so it doesn't conflict with fix(connection): build rules in flag order #464.findTransformationIDtriesGET /transformations/{id}fortrs_values, then lists by name and requires an exact match, because the list filter can return near matches.{"type":"transform","transformation_id":…}. Code and env go intransformationwithoutname, so an ID is never sent as a new name. Core treats that as an update of the referenced transformation (ProcessRule.ts,transformation_idbranch).--rule-transform-name.Tests
connection_transform_rule_test.go), using a fake client:namesent)--rulesuntouched with no lookupsTestConnectionTransformRuleNameOrID(connectiontag):transformation_idgo vetandgo test ./pkg/...pass. The acceptance test runs in CI.🤖 Generated with Claude Code