Skip to content

Howie/provision on fly - #49750

Open
Howie Leung (howieleung) wants to merge 48 commits into
mainfrom
howie/provision-on-fly
Open

Howie Leung (howieleung) wants to merge 48 commits into
mainfrom
howie/provision-on-fly

Conversation

@howieleung

Copy link
Copy Markdown
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

…ng state

- Introduced `GetEnvironmentFileVariables.Tests.ps1` to validate environment variable parsing from .env files.
- Added `GetSampleRequiredEnvironmentVariables.Tests.ps1` to ensure required environment variables are correctly identified for samples.
- Created `InvokeSampleTest.Integration.Tests.ps1` and `InvokeSampleTest.Tests.ps1` for testing sample execution in various modes, including playback and recording.
- Implemented `ResetRecordingState.Tests.ps1` to verify cleanup of recording state and pytest cache.
- Developed `ResolveSampleTest.Tests.ps1` to test sample resolution and error handling for ambiguous or missing files.
- Added `TestRecordingGitConflicts.Tests.ps1` to check for recording conflicts in git repositories.
- Created `TestHelpers.ps1` to provide reusable functions for test setup and synthetic package creation.
- Updated `conftest.py` to support command-line options for environment variable configuration.
#49613)

* Add comprehensive tests for environment variable handling and recording state

- Introduced `GetEnvironmentFileVariables.Tests.ps1` to validate environment variable parsing from .env files.
- Added `GetSampleRequiredEnvironmentVariables.Tests.ps1` to ensure required environment variables are correctly identified for samples.
- Created `InvokeSampleTest.Integration.Tests.ps1` and `InvokeSampleTest.Tests.ps1` for testing sample execution in various modes, including playback and recording.
- Implemented `ResetRecordingState.Tests.ps1` to verify cleanup of recording state and pytest cache.
- Developed `ResolveSampleTest.Tests.ps1` to test sample resolution and error handling for ambiguous or missing files.
- Added `TestRecordingGitConflicts.Tests.ps1` to check for recording conflicts in git repositories.
- Created `TestHelpers.ps1` to provide reusable functions for test setup and synthetic package creation.
- Updated `conftest.py` to support command-line options for environment variable configuration.

* Update cspell configuration and improve test assertions for multiline values
- Introduced SampleCiHelpers.ps1 for Azure CLI operations and manifest handling.
- Created Test-BicepTemplates.ps1 to validate Bicep template compilation.
- Added Bicep templates for resource group and sample resources.
- Implemented sample-resources.bicepparam for parameter bindings.
- Developed run_samples.py to execute pytest nodes against Bicep-created projects.
- Added select_samples.py for resolving sample test queries.
- Created test_run_samples.py for validating sample test invocation.
- Implemented test_select_samples.py for testing sample selection logic.
- Included standard-setup.lock.json for dependency management.
…pdate README; add tests for automatic provisioning flow
…viewToolboxTool; add VoiceAgentProfanityFilterMode; update apiHash and CrossLanguageVersion (#49708)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Numbered log entries can bypass credential redaction and expose secrets in published attachments, while reused artifact names cause publication failures when jobs rerun in the same build.

2 open issues
What changed in this PR

Adds on-demand live testing for azure-ai-projects samples, provisioning temporary Foundry environments around the existing synchronous and asynchronous test harness.

Changes:

  • Selects and distributes samples across up to four workers with identity, quota, provisioning, and cleanup checks.
  • Adds shared-identity bootstrap templates and temporary workload infrastructure.
  • Adds sanitized log attachments, validation-endpoint handling, documentation, and regression tests.
File Description
sdk/​ai/​azure-ai-projects/​tests/​samples/​shared-identities/​infra/​main.bicep Creates the permanent identity group and role assignments.
sdk/​ai/​azure-ai-projects/​tests/​samples/​shared-identities/​infra/​IdentityConfiguration.json Defines shared identities and required roles.
sdk/​ai/​azure-ai-projects/​tests/​samples/​shared-identities/​infra/​identities.bicep Creates and tags managed identities.
sdk/​ai/​azure-ai-projects/​tests/​samples/​shared-identities/​infra/​Deploy-Identities.ps1 Previews or deploys shared identity infrastructure.
sdk/​ai/​azure-ai-projects/​tests/​samples/​sample_log.py Centralizes credential redaction and bounded log writing.
sdk/​ai/​azure-ai-projects/​tests/​samples/​sample_executor.py Integrates sanitized logs and configurable capture directories.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​Test-BicepTemplates.ps1 Checks compiled infrastructure contracts and source provenance.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​SamplePreflight.Tests.ps1 Tests regional eligibility and quota checks.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​SampleCiHelpers.Tests.ps1 Tests target, ownership, identity, and diagnostic safeguards.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​Remove-SampleResources.Tests.ps1 Tests cleanup confirmation and ownership enforcement.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​New-SampleDeploymentPlan.Tests.ps1 Tests offline planning and unsupported-input rejection.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​Invoke-SampleProvisioning.Tests.ps1 Tests rejection before resource mutation.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​validation/​IdentityResolution.Tests.ps1 Tests shared-identity resolution and metadata validation.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​test_validation_environment.py Tests validation-endpoint precedence.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​test_select_samples.py Tests wildcard selection and queue partitioning.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​test_sample_ci_attachments.py Tests redaction and per-result JUnit attachments.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​test_run_samples.py Tests runner arguments, readiness, and environment isolation.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​test_pipeline.py Checks pipeline structure and execution safeguards.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​select_samples.py Collects, selects, and partitions existing sample tests.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​sample_ci_attachments.py Publishes sanitized executor logs through JUnit markers.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​run_samples.py Checks readiness and executes selected live tests.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​Remove-SampleResources.ps1 Deletes verified run-owned temporary resources.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​README.md Documents setup, execution, safety, and maintainer checks.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​New-SampleDeploymentPlan.ps1 Generates queue-bound deployment plans.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​Invoke-SampleProvisioning.ps1 Performs admission checks and provisions workloads.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​infra/​standard-shared-identities.bicep Defines Foundry dependencies using existing identities.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​infra/​standard-setup.lock.json Pins upstream reference sources and checksums.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​infra/​sample-resources.bicepparam Supplies environment-backed deployment parameters.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​infra/​sample-resources.bicep Deploys the sample model and GitHub MCP connection.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​infra/​resource-group.bicep Creates temporary groups with ownership and expiry tags.
sdk/​ai/​azure-ai-projects/​tests/​conftest.py Preserves the environment-supplied validation endpoint.
sdk/​ai/​azure-ai-projects/​tests.yml Orchestrates planning, admission, live tests, cleanup, and results.

Review effort: Balanced

Comment thread sdk/ai/azure-ai-projects/tests/samples/sample_log.py Outdated
Comment thread sdk/ai/azure-ai-projects/tests.yml
@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

What failed

Azure DevOps pipeline python - pullrequest (build 7017292) failed in the CSpell spelling validation step for sdk/ai/azure-ai-projects. The job exited with PowerShell exited with code '1' after CSpell found 48 issues across 18 files. No test failures were reported (failed_pipeline_tests was empty) — this is purely a spell-check/lint failure, not a build or test regression.

Relevant pipeline output
CSpell: Files checked: 32, skipped: 2, Issues found: 48 in 18 files.
##[error]sdk/ai/azure-ai-projects/tests.yml:156:31 - Unknown word (pscore)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/Invoke-SampleProvisioning.ps1:59:102 - Unknown word (retagged)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/Invoke-SampleProvisioning.ps1:163:78 - Unknown word (bicepparam)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/New-SampleDeploymentPlan.ps1:15:69 - Unknown word (DEFINITIONID)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/SampleCiHelpers.ps1:181:42 - Unknown word (cnotin)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/SampleCiHelpers.ps1:616:67 - Unknown word (idtyp)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/infra/sample-resources.bicepparam:4:72 - Unknown word (unconfigured)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/infra/standard-shared-identities.bicep:22:31 - Unknown word (foundy)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/infra/standard-shared-identities.bicep:247:10 - Unknown word (caphostproj)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/sample_ci_attachments.py:71:97 - Unknown word (pytrace)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/test_sample_ci_attachments.py:54:34 - Unknown word (Nlcjpw)
##[error]sdk/ai/azure-ai-projects/tests/samples/ci/test_select_samples.py:88:32 - Unknown word (axpy)
##[error]sdk/ai/azure-ai-projects/tests/samples/sample_log.py:38:54 - Unknown word (opusr)
##[error]Spelling errors detected. To correct false positives or learn about spell checking see: https://aka.ms/azsdk/engsys/spellcheck

(additional repeated DEFINITIONID/idtyp occurrences in *.Tests.ps1 validation files omitted for brevity — same root cause.)

Root cause

Several new identifiers/technical terms introduced by this PR's sample-provisioning scripts and bicep infra files (e.g. bicepparam, caphostproj, DEFINITIONID, idtyp, pytrace, axpy) are not present in the repo's CSpell dictionary (.vscode/cspell.json). One occurrence, foundy in standard-shared-identities.bicep:22:31, looks like a likely typo (probably intended to be foundry, given the Azure AI Foundry context of this PR) rather than a legitimate new term, and should be reviewed/corrected rather than allowlisted.

Recommended next steps

  • Add the legitimate new technical terms/identifiers (bicepparam, caphostproj, DEFINITIONID, idtyp, cnotin, pytrace, axpy, pscore, retagged, unconfigured, opusr, Nlcjpw) to the CSpell word list in .vscode/cspell.json.
  • Review standard-shared-identities.bicep:22 for the foundy occurrence — correct it to foundry if it is a typo, otherwise add it to the dictionary if intentional.
  • Re-run the python - pullrequest CSpell/validation stage after the fix to confirm all 48 issues are resolved.
  • See https://aka.ms/ci-fix

Automated fix: Requested

Generated by Pipeline Analysis Next Steps · copilot · sonnet50 · 34.7 AIC · ⌖ 0.576 AIC · ⊞ 8.9K · ◷

Base automatically changed from feature/azure-ai-projects/vnext to main October 30, 2026 16:39
Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Live sample output validation targets the sanitized playback URL instead of the configured project because pytest CLI mode overwrites the endpoint passed through the environment.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment on lines +172 to +173
environment = os.environ.copy()
environment.update(state["environment"])
Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The pytest configuration hook overwrites the environment-provided validation endpoint with a sanitized default, causing both default samples to attempt validation against a placeholder after provisioning billable resources.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The pytest configure hook overwrites the environment-supplied validation endpoint with a sanitized placeholder, causing both sample validators to target the wrong endpoint even in correctly configured live runs.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants