azure-upgrade, replace personal repo in integration test with repos under well-known orgs#2608
Conversation
…e repos
Replace the single weidongxu-microsoft/java-update-examples baseline
with three pinned upstream repos so the migration assertions exercise
the original Azure sample code:
- file-based auth -> Azure-Samples/aad-java-manage-service-principals
- EventProcessorHost -> logstash-plugins/logstash-input-azure_event_hubs
(sparse checkout of .ci/integration/event_hub_consumer)
- Batch defineNewApplicationPackage -> Azure-Samples/batch-java-manage-batch-accounts
runJavaMigration now takes a { repoUrl, commitId, sparseCheckoutPath? }
config and only adds the 'project can be found under ...' hint to the
prompt when a sparse subpath is used.
All three java-sdk-migration-e2e tests pass against the new baselines.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Azure upgrade integration tests to use scenario-specific upstream sample repositories pinned to fixed commits, improving determinism while supporting repos whose Java sample lives in a subdirectory.
Changes:
- Replaced the single shared samples repo with per-scenario repo/commit configurations.
- Refactored
runJavaMigrationto accept a repo config object and handle optionalsparseCheckoutPath. - Updated the affected tests to call
runJavaMigrationwith the new configs.
| const EVENT_PROCESSOR_HOST_REPO = { | ||
| repoUrl: "https://github.com/logstash-plugins/logstash-input-azure_event_hubs.git", | ||
| commitId: "4a05eea79342f1d451162d1a3e26270f6a484b4f", | ||
| // The Java sample lives in a subdirectory of this primarily-Ruby repo. | ||
| sparseCheckoutPath: ".ci/integration/event_hub_consumer", | ||
| } as const; |
There was a problem hiding this comment.
No. I assume logstash-plugins be well-known org, and will not be removed any time sooner.
|
FYI, we are migrating testing from old integration tests to vally eval suites. Here is a PR converting azure-upgrade test cases. Could you please help review and merge the migration PR and then apply these changes to the vally eval suites? |
| @@ -0,0 +1,404 @@ | |||
| /** | |||
There was a problem hiding this comment.
Could you delete this file? We no longer run js tests for azure-upgrade in our scheduled tests.
There was a problem hiding this comment.
Two issues in eval.yaml need fixing:
-
git clone --depth 1 --sparseis used foraad-java-manage-service-principalsandbatch-java-manage-batch-accounts, but nogit sparse-checkout setfollows. The default sparse-checkout cone only materializes root-level files. Both repos keep their Java sources undersrc/, so those files won't be checked out. This likely explains the failingevalCI check. Drop--sparsefrom these two clone commands (keep it for the logstash repo that genuinely uses sparse checkout). -
The bare
cd repo-namelines (254, 365) are no-ops left over from whengit sparse-checkout setwas chained there. Remove them or fold the fetch into that line.
Separately, @JasonYeMSFT flagged that integration tests are migrating to eval suites and asked to delete tests/azure-upgrade/integration.test.ts. That should be resolved before merging.
| - git clone --depth 1 --sparse https://github.com/weidongxu-microsoft/java-update-examples.git | ||
| - cd java-update-examples && git sparse-checkout set azure-legacy-sdk-update-azure-client-initialization | ||
| - cd java-update-examples && git fetch --depth 1 origin 6d071296df8929482b0903241a23713a0bb952a4 && git checkout 6d071296df8929482b0903241a23713a0bb952a4 | ||
| - git clone --depth 1 --sparse https://github.com/Azure-Samples/aad-java-manage-service-principals.git |
There was a problem hiding this comment.
--sparse enables sparse-checkout mode but no git sparse-checkout set follows. The default cone pattern only materializes root-level files. I checked the repo tree at this commit and Java sources live under src/, so they won't be checked out.
Drop --sparse since this repo doesn't need sparse checkout:
| - git clone --depth 1 --sparse https://github.com/Azure-Samples/aad-java-manage-service-principals.git | |
| - git clone --depth 1 https://github.com/Azure-Samples/aad-java-manage-service-principals.git |
Same fix needed on line 364 for batch-java-manage-batch-accounts.
| - cd java-update-examples && git sparse-checkout set azure-legacy-sdk-update-azure-client-initialization | ||
| - cd java-update-examples && git fetch --depth 1 origin 6d071296df8929482b0903241a23713a0bb952a4 && git checkout 6d071296df8929482b0903241a23713a0bb952a4 | ||
| - git clone --depth 1 --sparse https://github.com/Azure-Samples/aad-java-manage-service-principals.git | ||
| - cd aad-java-manage-service-principals |
There was a problem hiding this comment.
This bare cd is a no-op. The next command already starts with cd aad-java-manage-service-principals && ..., so this line does nothing. It was meaningful before when git sparse-checkout set was chained here.
Remove it (same for line 365):
| - cd aad-java-manage-service-principals | |
| - cd aad-java-manage-service-principals && git fetch --depth 1 origin 83b446085a7ef35cf26b6d36255aa833aeb287bb && git checkout 83b446085a7ef35cf26b6d36255aa833aeb287bb |
Dismissing: this review was incorrectly posted as changes-requested due to an automation bug. The findings remain valid as comments.
jongio
left a comment
There was a problem hiding this comment.
The eval CI check is failing. The likely root cause: --sparse is passed to git clone for aad-java-manage-service-principals (line 252) and batch-java-manage-batch-accounts (line 363), but no git sparse-checkout set follows either clone. The default sparse-checkout cone only materializes root-level files, so src/ (where the Java sources live) won't be checked out.
Fix: drop --sparse from those two clones. The logstash repo correctly uses sparse checkout because it chains git sparse-checkout set .ci/integration/event_hub_consumer on the next line.
Lines 253 and 364 (cd <repo-name>) are also no-ops. The subsequent command already starts with cd <repo-name> && ..., making the standalone cd redundant. Remove both lines.
Separately: @JasonYeMSFT asked to delete tests/azure-upgrade/integration.test.ts since integration tests are migrating to eval suites (see #2648). This PR adds a 404-line version of that file. Please resolve that conflict before merging.
| @@ -250,9 +250,9 @@ stimuli: | |||
| - "Continue with recommended options until complete." | |||
| environment: | |||
| commands: | |||
There was a problem hiding this comment.
--sparse enables sparse-checkout mode but no git sparse-checkout set follows. The default cone pattern only materializes root-level files. Java sources live under src/, so they won't be checked out. This is likely why the eval CI check is failing.
Drop --sparse since this repo doesn't need sparse checkout:
| commands: | |
| - git clone --depth 1 https://github.com/Azure-Samples/aad-java-manage-service-principals.git |
| @@ -361,9 +361,9 @@ stimuli: | |||
| - "Continue with recommended options until complete." | |||
| environment: | |||
| commands: | |||
There was a problem hiding this comment.
Same issue here: --sparse without a subsequent git sparse-checkout set means src/ won't be checked out.
| commands: | |
| - git clone --depth 1 https://github.com/Azure-Samples/batch-java-manage-batch-accounts.git |
jongio
left a comment
There was a problem hiding this comment.
One new nit since my last review (trailing underscore in the describe block name). My prior eval.yaml inline comments about --sparse without sparse-checkout set and no-op cd lines remain unresolved and are the likely cause of the failing eval CI check.
| return (navigated && surfaced) || getToolCalls(m).length > 30; | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
Trailing underscore in the describe block name: the suite reports as azure-upgrade_ - Integration Tests.
| describeIntegration(`${SKILL_NAME} - Integration Tests`, () => { |
Replaces the personal
weidongxu-microsoft/java-update-examplesrepo intests/azure-upgrade/integration.test.tswith the three well-known repos. Each entry is pinned to the latest commit on its default branch for reproducibility.Changes
DefaultAzureCredentialazure-legacy-sdk-update-azure-client-initializationAzure-Samples/aad-java-manage-service-principals@83b4460InMemory*->BlobCheckpointStoreazure-legacy-sdk-update-eventhubs-v3logstash-plugins/logstash-input-azure_event_hubs@4a05eea(sparse:.ci/integration/event_hub_consumer)defineNewApplicationPackage->applicationPackages().define()azure-legacy-sdk-update-batch-java-manage-batch-accountsAzure-Samples/batch-java-manage-batch-accounts@105a076runJavaMigrationnow takes a{ repoUrl, commitId, sparseCheckoutPath? }config and only adds the ""project can be found under ..."" hint when a sparse subpath is used.Test results
All three
java-sdk-migration-e2etests pass against the new baselines:migrates legacy file-based Azure auth (client init) to DefaultAzureCredential-> passmigrates EventProcessorHost InMemory managers to BlobCheckpointStore-> passmigrates Batch defineNewApplicationPackage chain to applicationPackages().define()-> passMigration assertions and skill-invocation tests are unchanged.