Skip to content

Conversation

@JonnavithulaGirish
Copy link
Member

@JonnavithulaGirish JonnavithulaGirish commented Aug 7, 2025

Related Issues

Usage

pnpm start consent upload-preferences --auth=your-auth-token --partition=your-partition --directory=./examples/pm-test --dryRun=true --skipWorkflowTriggers=true --skipExistingRecordCheck=true --isSilent=true --attributes="Tags:transcend-cli,Source:transcend-cli" --transcendUrl=https://api.transcend.io/ --allowedIdentifierNames="email,personId,memberId" --identifierColumns="email_id,person_id,member_id"

Note

Introduces a new CLI command to upload preference records from CSV with multi-identifier support, including interactive/batch flows, parsing, GraphQL integration, receipts, and examples.

  • CLI: consent upload-preferences
    • Core: command.ts, impl.ts, buildTaskOptions.ts, worker.ts
    • Upload flows: upload/batchUploader.ts, upload/buildInteractiveUploadPlan.ts, upload/interactivePreferenceUploaderFromPlan.ts, upload/types.ts
    • Transform: upload/transform/transformCsv.ts, buildPendingUpdates.ts, index.ts
    • Artifacts/receipts: artifacts/receipts/index.ts, receiptsState.ts
    • Docs: readme.ts
  • Preference Management Library:
    • Parsing: parsePreferenceManagementCsv.ts, parsePreferenceFileFormatFromCsv.ts, parsePreferenceIdentifiersFromCsv.ts, parsePreferenceAndPurposeValuesFromCsv.ts
    • Logic: getPreferencesForIdentifiers.ts, getPreferenceUpdatesFromRow.ts, codecs.ts, uploadPreferenceManagementPreferencesInteractive.ts, index.ts
  • GraphQL: createSombraGotInstance.ts, makeGraphQLRequest.ts, gqls/RequestDataSilo.ts
  • Helpers: collectCsvFilesOrExit.ts, pooling/logRotation.ts
  • Examples: CSV samples under examples/pm-test/
  • Schema/Docs: transcend-yml-schema-v9.json, updates to README.md and CHANGELOG.md

Written by Cursor Bugbot for commit f8a91f9. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Aug 7, 2025

Comment on lines +102 to +119
allowedIdentifierNames: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Identifiers configured for the run. Comma-separated list of identifier names.',
},
identifierColumns: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Columns in the CSV that should be used as identifiers. Comma-separated list of column names.',
},
columnsToIgnore: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Columns in the CSV that should be ignored. Comma-separated list of column names.',
optional: true,
Copy link
Member

@bencmbrook bencmbrook Aug 15, 2025

Choose a reason for hiding this comment

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

The preferred pattern for lists is to use the built-in variadic: ','. This will parse it in the same way, but it will also (A) provide better error messages for malformed inputs, and (B) it will also self-document that it's a list which can be provided as a comma-separated argument like this:

FLAGS
      --auth                    The Transcend API key.
     [--identifierColumns]...   Identifier names configured for the run. [separator = ,]

It also allows users to pass --identifierColumns 1 --identifierColumns 2 --identifierColumns 3

And if any of these are enums (I don't think they are, but) you can also do something like this to validate (and also self-document) the expected inputs:
Image

If you

Suggested change
allowedIdentifierNames: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Identifiers configured for the run. Comma-separated list of identifier names.',
},
identifierColumns: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Columns in the CSV that should be used as identifiers. Comma-separated list of column names.',
},
columnsToIgnore: {
kind: 'parsed',
parse: (value: string) => value.split(',').map((s) => s.trim()),
brief:
'Columns in the CSV that should be ignored. Comma-separated list of column names.',
optional: true,
allowedIdentifierNames: {
kind: 'parsed',
parse: String,
variadic: ',',
brief: 'Identifier names configured for the run.',
},
identifierColumns: {
kind: 'parsed',
parse: String,
variadic: ',',
brief: 'Columns in the CSV that should be used as identifiers.',
},
columnsToIgnore: {
kind: 'parsed',
parse: String,
variadic: ',',
brief: 'Columns in the CSV that should be ignored.',
optional: true,

@@ -1,252 +0,0 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
Copy link
Member

Choose a reason for hiding this comment

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

restore

@michaelfarrell76 michaelfarrell76 force-pushed the jonnavithulaGirish/multiIdentifier branch from a7aa378 to 0be1c91 Compare August 19, 2025 00:33
@michaelfarrell76 michaelfarrell76 force-pushed the jonnavithulaGirish/multiIdentifier branch from 536ca21 to 702709e Compare August 19, 2025 00:37
cursor[bot]

This comment was marked as outdated.

]);
currentState.timestampColum = timestampName;

currentState.setValue(timestampName, 'timestampColumn');
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect Parameter Order in setValue Calls

The setValue calls in parsePreferenceFileFormatFromCsv.ts and parsePreferenceAndPurposeValuesFromCsv.ts pass parameters in the wrong order, using (value, key) instead of the expected (key, value). This is inconsistent with getValue's key-first convention and likely results in incorrect state updates.

Additional Locations (1)

Fix in Cursor Fix in Web

'When uploading preferences to v1/preferences - this is the number of concurrent requests made at any given time by a single process.' +
"This is NOT the batch size—it's how many batch *tasks* run in parallel. " +
'The number of total concurrent requests is maxed out at concurrency * uploadConcurrency.',
default: '75', // FIXME 25
Copy link

Choose a reason for hiding this comment

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

Bug: Fix: incorrect default uploadConcurrency value persisted

The comment "// FIXME 25" on line 114 suggests the default value for uploadConcurrency should be 25 instead of 75, but was left at 75. This appears to be temporary debugging code or an unfinished change that was accidentally committed.

Fix in Cursor Fix in Web

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