chore(flow-functionality): add @stable and harden pythonApiGeneration - #140
Merged
Conversation
… test The previous test asserted only `clipboardContent.length > 0`, which would pass even if the wrong tab's snippet or an empty buffer were copied. Replaced with structural assertions that match the real shape of `getNewPythonApiCode` for the Basic Prompting template: - starts with `import requests` - contains `import uuid`, the API key placeholder, the `/api/v1/run/<UUID>` URL - contains the default `"Hello"` input value, output/input type `chat` - contains the session_id mutation, headers dict, and the requests.request call Also added the missing spec doc under docs/flow-functionality/ and marked the scenario as covered in QA-CHECKLIST.md and QA-SCENARIOS-GUIDE.md. Removed the misleading `@api` tag — this test exercises the UI snippet generator, not the REST endpoint.
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.
Summary
clipboardContent.length > 0, which would pass even if the wrong tab's snippet or an empty buffer was copied. Replaced with 10 structural assertions that mirror the real output ofgetNewPythonApiCodefor the Basic Prompting template.docs/flow-functionality/pythonApiGeneration.md(mirrors the curl spec) and marked scenario 5.2 as covered inQA-CHECKLIST.mdandQA-SCENARIOS-GUIDE.md.@stable, removed the misleading@apitag (this test exercises the UI snippet generator, not the REST endpoint), kept@releaseand@workspace.What the new assertions check
import requestsimport uuid,api_key = 'YOUR_API_KEY_HERE'<base>/api/v1/run/<UUID>(regex on[0-9a-f-]{36})"input_value": "Hello","output_type": "chat","input_type": "chat"payload["session_id"] = str(uuid.uuid4())headers = {"x-api-key": api_key}requests.request("POST", url, json=payload, headers=headers)Test plan
tsc --noEmitclean--retries=0(14.9s total)trace.zipand verified against the assertionsLast validated: Langflow 1.10.x)