Repository navigation
Conversation
…9692) Customers were sending the wrong dataset_id because the Python client, example 09 and the README described it as an opaque "dataset ID" with placeholder values. The upload-URL resolver only issues a URL when datasetId exactly matches a config.entities[].id, which is the Dataset Name set on the CFT instance. - get_cft_upload_url / upload_cft_file docstrings: dataset_id is the Dataset Name, matched exactly; how to list valid names via get_integration_instance_details. - examples/09: help text, labels and placeholder use Dataset Name. - README: CFT section explains the exact match, shows the lookup, and reads upload_info['expiresIn'] (the mutation selects expiresIn, not expiresAt, so the old snippet raised KeyError). - tests: fixture returns expiresIn; new test_cft_docs.py discovers every upload_info[...] read in README, examples and the package and fails if one is not selected by the mutation, and asserts the docstring terms. No runtime behaviour change: the GraphQL string, variables and return statement are byte-identical. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
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.
+90 −14
Fixes TD-9692. A customer's Custom File Transfer upload failed because
dataset_idwas documented as an opaque "dataset ID". The upload-URL resolver issues a URL only whendatasetIdexactly matches aconfig.entities[].id, which is the Dataset Name set on the CFT instance. The fix is docs and examples, plus a README snippet that read the wrong response key.What changed
jupiterone/client.py: docstrings ofget_cft_upload_urlandupload_cft_fileonly.dataset_idis the Dataset Name, matched exactly, with how to list valid names viaget_integration_instance_details. The GraphQL string, variables and return line are byte-identical.examples/09_custom_file_transfer_example.py: help text, labels and placeholder describeJ1_CFT_DATASET_IDas the Dataset Name (exampleEuropaUsers). The env var name is unchanged.README.md: CFT section explains the exact match, shows the lookup, and readsupload_info['expiresIn']. The oldexpiresAtkey raisedKeyErrorbecause the mutation selectsuploadUrlandexpiresIn.tests/test_cft_methods.py: fixture returnsexpiresInas the real API does.tests/test_cft_docs.py(new): reads the mutation's selection set from the real query string, finds everyupload_info['<key>']read in README,examples/andjupiterone/, and fails if any key is not selected. Also asserts theget_cft_upload_urldocstring names "Dataset Name" andget_integration_instance_details.LOC summary
jupiterone/client.pyexamples/09_custom_file_transfer_example.pyREADME.mdtests/test_cft_docs.pytests/test_cft_methods.pyVerification
tests/test_cft_docs.pyfails 3 of 4 (READMEexpiresAtkey, both docstring assertions). On this branch all 4 pass.pytest -k cft: 18 passed.--ignore=tests/test_deferred_response.py --ignore=tests/test_query.py: 27 failed, 217 passed. The failing set is identical to the origin/main baseline (27 pre-existing failures outside CFT, e.g.test_syncapi_request,test_list_questions). None are new.python -m py_compile examples/09_custom_file_transfer_example.pypasses.jupiterone/client.pywith docstrings stripped matches origin/main.kj-review, read-only): verdict pass, no must-fix findings. Report at the run folderTD-9692-review-r1.md.Not verified
["data"]["integrationInstance"]["config"]["entities"]was checked against the integration service source, not against a live CFT instance.Nits left (not blocking)
config['entities']directly, so it raises on an instance with no entities..get('entities', [])would be gentler.test_cft_docs.pyselection-set regex would mis-tokenise a future nested selection. Not an issue for the current flat selection.dataset_idis still ID-shaped, andexpiresIn: 900differs from the server's 60 seconds. Test data only.Out of scope
python-client.md,custom-file-transfer.md), a follow-up PR in that repo.🤖 Generated with Claude Code