test: add Fabric OpenAIPrompt end-to-end gate - #2668
test: add Fabric OpenAIPrompt end-to-end gate#2668Rana Singh (ranadeepsingh) wants to merge 1 commit into
Conversation
## Summary Add a manifest-driven fabric-spark-cli runner, reusable scenarios, and an Azure Pipeline gate that executes exact SynapseML core and cognitive artifacts on a managed Fabric Spark runtime. Cover OpenAIPrompt behaviors derived from PySpark AI Functions and retain JUnit, provenance, diagnostics, and cleanup evidence. ## Prompting Intent The engineer asked for a reusable way to remove uncertainty from SynapseML bug fix and feature pull requests by running their exact artifacts end to end on Fabric. They specifically requested a pipeline scenario that exercises the public OpenAIPrompt PySpark primitive with AI Functions-inspired cases, without injecting OpenAI credentials. ## Linked Sources - Motivating pull request: microsoft#2662 - No standalone requirements or design specification; the implementation follows the engineering conversation and repository contribution guidance. ## Rationale Use Fabric platform notebooks for OpenAIPrompt because direct batch submission does not provide the workload-operation context required by Fabric's implicit LLM endpoint. Side-load exact package jars and record hashes and class sources so a passing run proves the proposed JVM implementation was exercised. Keep credentials out of scenario arguments, skip untrusted forks, and delete unique scratch notebooks and lakehouses in finally paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Hey Rana Singh (@ranadeepsingh) 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
There was a problem hiding this comment.
Pull request overview
This PR adds a manifest-driven Fabric end-to-end (E2E) runner (tools/fabric_e2e/run.py) that executes checked-in scenarios on a managed Microsoft Fabric Spark runtime via fabric-spark-cli, producing machine-readable evidence (JUnit + JSON + retained logs/notebooks). It also extends CI (pipeline.yaml) to gate an OpenAIPrompt notebook-based scenario on trusted builds and publishes results/evidence.
Changes:
- Added a reusable Fabric E2E runner with scenario manifest validation, jar hashing/provenance checks, structured diagnostics, JUnit output, and deterministic cleanup of scratch resources.
- Added multiple Fabric E2E scenarios (runtime smoke, jar provenance, LightGBM streaming, OpenAIPrompt AI Functions-inspired checks) plus unit tests validating runner/manifest/pipeline wiring.
- Updated Azure Pipelines FabricE2E job to skip untrusted fork PRs, add an OpenAIPrompt gate step, and publish OpenAIPrompt JUnit + evidence artifacts.
Show a summary per file
| File | Description |
|---|---|
| tools/fabric_e2e/scenarios/runtime_smoke.py | Minimal distributed Spark action + evidence marker for Fabric access proof. |
| tools/fabric_e2e/scenarios/jar_provenance.py | Validates that a specified JVM class loads from a supplied jar and records evidence. |
| tools/fabric_e2e/scenarios/lightgbm_streaming.py | Exercises repeated LightGBM streaming fits and captures native/library diagnostics on Fabric. |
| tools/fabric_e2e/scenarios/openai_prompt_ai_functions.py | Notebook-executed OpenAIPrompt scenario validating implicit Fabric auth and structured output behaviors. |
| tools/fabric_e2e/scenarios.json | Scenario manifest defining scripts, minimum jars, execution mode, and default args/conf. |
| tools/fabric_e2e/run.py | Core runner: manifest-driven execution, evidence capture, jar hashing, log parsing, and cleanup. |
| tools/ci/tests/test_fabric_e2e.py | Unit tests for runner command construction, manifest loading, marker parsing, and notebook generation. |
| tools/ci/tests/test_pipeline_yaml.py | CI assertions ensuring the Fabric OpenAIPrompt gate is wired as intended. |
| pipeline.yaml | CI updates: fork-skipping FabricE2E, OpenAIPrompt Fabric gate, publishing results/evidence, and new branch gating variable. |
| .github/skills/fabric-e2e/SKILL.md | New repo skill documenting repeatable Fabric E2E workflows and constraints. |
| .github/skills/fabric-e2e/references/scenarios.md | Reference doc describing scenarios, required jars, overrides, and outputs. |
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 11/11 changed files
- Comments generated: 1
- Review effort level: Lite
| )" | ||
| export PIP_INDEX_URL="https://azure:${feed_token}@${feed}" | ||
| export PIP_DISABLE_PIP_VERSION_CHECK=1 |
|
Superseded by #2669. The replacement uses the same commit from a trusted upstream branch so the credential-bearing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2668 +/- ##
==========================================
- Coverage 86.64% 86.56% -0.08%
==========================================
Files 337 337
Lines 19556 19556
Branches 1928 1928
==========================================
- Hits 16944 16929 -15
- Misses 2612 2627 +15 🚀 New features to boost your workflow:
|
Related Issues/PRs
Motivated by the real-runtime validation gap exposed in #2662.
What changes are proposed in this pull request?
Add a reusable, manifest-driven
fabric-spark-clipath that runs exactSynapseML build artifacts on a managed Fabric Spark runtime and retains
machine-readable evidence.
lakehouses/notebooks and exact cleanup in
finally.class-source provenance, diagnostics, JUnit, CLI output, and executed
notebook.
OpenAIPromptscenarios.OpenAIPromptwith AI Functions-inspired generation, sentiment,summarization, translation, structured extraction, null propagation, usage,
and error-column cases.
pass an endpoint, OpenAI key, subscription key, or AAD token.
FabricE2Eto build the exact core/cognitive package jars, run thenotebook scenario for
masterandspark3.5, skip untrusted fork PRs, andpublish JUnit plus retained evidence.
Platform-notebook execution is intentional: direct Fabric batch submission
does not carry the workload-operation context required by the implicit Fabric
LLM endpoint.
Managed proof completed with the exact commit jars:
3.5.5.5.4.20260807.1fabric-spark-cli 0.1.20260807.5openai-prompt-ai-functions0The managed proof used developer authentication. This PR's
FabricE2Erun isthe remaining proof of the
SynapseML Buildservice connection's workspacepermissions.
How is this patch tested?
I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.
python -m pytest -q tools/ci/tests/test_fabric_e2e.py tools/ci/tests/test_pipeline_yaml.pysbt scalastyle test:scalastylewith the repository-supported JDKblack --check --extend-exclude 'docs/'over tracked and new Python sourcesManaged Fabric execution of the checked-in OpenAIPrompt scenario with exact
core/cognitive jars
Does this PR change any dependencies?
The pipeline installs pinned
fabric-spark-cli==0.1.20260807.5from theexisting authenticated SynapseMaven feed. No published SynapseML dependency or
dependency manifest changes.
Does this PR add a new feature? If so, have you added samples on website?