-
Notifications
You must be signed in to change notification settings - Fork 861
ci: add release branch compatibility check to PR validation #2550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -803,3 +803,117 @@ jobs: | |||||||||||||||||||||||||||||||||||||
| - template: templates/kv.yml | ||||||||||||||||||||||||||||||||||||||
| - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}: | ||||||||||||||||||||||||||||||||||||||
| - template: templates/codecov.yml | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - job: ReleaseBranchCompat | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Release Branch Compatibility Check' | ||||||||||||||||||||||||||||||||||||||
| cancelTimeoutInMinutes: 0 | ||||||||||||||||||||||||||||||||||||||
| timeoutInMinutes: 60 | ||||||||||||||||||||||||||||||||||||||
| continueOnError: true | ||||||||||||||||||||||||||||||||||||||
| condition: and(eq(variables.isPR, true), eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/master')) | ||||||||||||||||||||||||||||||||||||||
| pool: | ||||||||||||||||||||||||||||||||||||||
| vmImage: $(UBUNTU_VERSION) | ||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||
| spark4.0: | ||||||||||||||||||||||||||||||||||||||
| RELEASE_BRANCH: spark4.0 | ||||||||||||||||||||||||||||||||||||||
| JAVA_VERSION: 17 | ||||||||||||||||||||||||||||||||||||||
| SBT_JAVA_OPTS: "-J--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" | ||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - checkout: self | ||||||||||||||||||||||||||||||||||||||
| fetchDepth: 0 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - task: JavaToolInstaller@0 | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Set up JDK $(JAVA_VERSION)' | ||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||
| versionSpec: $(JAVA_VERSION) | ||||||||||||||||||||||||||||||||||||||
| jdkArchitectureOption: x64 | ||||||||||||||||||||||||||||||||||||||
| jdkSourceOption: PreInstalled | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - bash: | | ||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||
| echo "=== Current HEAD (PR merge commit) ===" | ||||||||||||||||||||||||||||||||||||||
| git log --oneline -1 | ||||||||||||||||||||||||||||||||||||||
| PR_HEAD=$(git rev-parse HEAD) | ||||||||||||||||||||||||||||||||||||||
| echo "PR HEAD: $PR_HEAD" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| echo "=== Fetching release branch $(RELEASE_BRANCH) ===" | ||||||||||||||||||||||||||||||||||||||
| git fetch origin $(RELEASE_BRANCH) | ||||||||||||||||||||||||||||||||||||||
| RELEASE_TIP=$(git rev-parse FETCH_HEAD) | ||||||||||||||||||||||||||||||||||||||
| echo "Release branch tip: $RELEASE_TIP" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| # Find commits unique to the release branch (not in master) | ||||||||||||||||||||||||||||||||||||||
| # These are the release-specific patches we need to replay | ||||||||||||||||||||||||||||||||||||||
| MASTER_BASE=$(git merge-base FETCH_HEAD $PR_HEAD) | ||||||||||||||||||||||||||||||||||||||
| UNIQUE_COMMITS=$(git rev-list --count $MASTER_BASE..$RELEASE_TIP) | ||||||||||||||||||||||||||||||||||||||
| echo "Release branch has $UNIQUE_COMMITS unique commit(s) to replay" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| echo "=== Attempting rebase of $(RELEASE_BRANCH) onto PR HEAD ===" | ||||||||||||||||||||||||||||||||||||||
| git checkout FETCH_HEAD | ||||||||||||||||||||||||||||||||||||||
| git rebase --onto $PR_HEAD $MASTER_BASE 2>&1 || { | ||||||||||||||||||||||||||||||||||||||
| echo "##vso[task.logissue type=warning]Rebase of $(RELEASE_BRANCH) onto this PR has merge conflicts" | ||||||||||||||||||||||||||||||||||||||
|
smamindl marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||
| echo "=== Conflicting files ===" | ||||||||||||||||||||||||||||||||||||||
| git diff --name-only --diff-filter=U 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||
| git rebase --abort 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| echo "Rebase succeeded — $(RELEASE_BRANCH) patches apply cleanly onto this PR" | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Rebase $(RELEASE_BRANCH) onto PR HEAD' | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - task: AzureCLI@2 | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Compile $(RELEASE_BRANCH) after rebase' | ||||||||||||||||||||||||||||||||||||||
| timeoutInMinutes: 20 | ||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||
| azureSubscription: 'SynapseML Build' | ||||||||||||||||||||||||||||||||||||||
| scriptLocation: inlineScript | ||||||||||||||||||||||||||||||||||||||
| scriptType: bash | ||||||||||||||||||||||||||||||||||||||
| inlineScript: | | ||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||
| export SBT_OPTS="-Xmx4G -Xss2M -Duser.timezone=GMT" | ||||||||||||||||||||||||||||||||||||||
| echo "=== Compiling $(RELEASE_BRANCH) rebased onto PR HEAD ===" | ||||||||||||||||||||||||||||||||||||||
| sbt $(SBT_JAVA_OPTS) compile test:compile | ||||||||||||||||||||||||||||||||||||||
| echo "$(RELEASE_BRANCH) compiles successfully after rebase" | ||||||||||||||||||||||||||||||||||||||
|
smamindl marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - task: AzureCLI@2 | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Setup repo for tests' | ||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||
| azureSubscription: 'SynapseML Build' | ||||||||||||||||||||||||||||||||||||||
| scriptLocation: inlineScript | ||||||||||||||||||||||||||||||||||||||
| scriptType: bash | ||||||||||||||||||||||||||||||||||||||
| inlineScript: | | ||||||||||||||||||||||||||||||||||||||
| (timeout 30s pip install requests) || (echo "retrying" && timeout 30s pip install requests) | ||||||||||||||||||||||||||||||||||||||
| (timeout 5m sbt $(SBT_JAVA_OPTS) setup) || (echo "retrying" && timeout 5m sbt $(SBT_JAVA_OPTS) setup) || (echo "retrying" && timeout 5m sbt $(SBT_JAVA_OPTS) setup) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - template: templates/kv.yml | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
smamindl marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| - task: AzureCLI@2 | ||||||||||||||||||||||||||||||||||||||
| displayName: 'Unit tests on $(RELEASE_BRANCH) after rebase' | ||||||||||||||||||||||||||||||||||||||
| timeoutInMinutes: 60 | ||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||
| azureSubscription: 'SynapseML Build' | ||||||||||||||||||||||||||||||||||||||
| scriptLocation: inlineScript | ||||||||||||||||||||||||||||||||||||||
| scriptType: bash | ||||||||||||||||||||||||||||||||||||||
| inlineScript: | | ||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||
| export SBT_OPTS="-Xmx4G -Xss2M -Duser.timezone=GMT" | ||||||||||||||||||||||||||||||||||||||
| echo "=== Running unit tests on $(RELEASE_BRANCH) rebased onto PR HEAD ===" | ||||||||||||||||||||||||||||||||||||||
| FAILURES=0 | ||||||||||||||||||||||||||||||||||||||
| for pkg in core automl causal featurize image isolationforest stages recommendation nn train vw opencv exploratory; do | ||||||||||||||||||||||||||||||||||||||
| echo "=== Testing $pkg ===" | ||||||||||||||||||||||||||||||||||||||
| if ! timeout 10m sbt $(SBT_JAVA_OPTS) "testOnly com.microsoft.azure.synapse.ml.$pkg.**"; then | ||||||||||||||||||||||||||||||||||||||
| echo "##vso[task.logissue type=warning]$pkg tests failed on $(RELEASE_BRANCH)" | ||||||||||||||||||||||||||||||||||||||
| FAILURES=$((FAILURES + 1)) | ||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||
|
smamindl marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| if [ $FAILURES -gt 0 ]; then | ||||||||||||||||||||||||||||||||||||||
| echo "##vso[task.logissue type=warning]$FAILURES package(s) failed on $(RELEASE_BRANCH)" | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+900
to
+909
|
||||||||||||||||||||||||||||||||||||||
| FAILURES=0 | |
| for pkg in core automl causal featurize image isolationforest stages recommendation nn train vw opencv exploratory; do | |
| echo "=== Testing $pkg ===" | |
| if ! timeout 10m sbt $(SBT_JAVA_OPTS) "testOnly com.microsoft.azure.synapse.ml.$pkg.**"; then | |
| echo "##vso[task.logissue type=warning]$pkg tests failed on $(RELEASE_BRANCH)" | |
| FAILURES=$((FAILURES + 1)) | |
| fi | |
| done | |
| if [ $FAILURES -gt 0 ]; then | |
| echo "##vso[task.logissue type=warning]$FAILURES package(s) failed on $(RELEASE_BRANCH)" | |
| PACKAGES=(core automl causal featurize image isolationforest stages recommendation nn train vw opencv exploratory) | |
| SBT_COMMANDS=() | |
| for pkg in "${PACKAGES[@]}"; do | |
| echo "=== Queueing tests for $pkg ===" | |
| SBT_COMMANDS+=("testOnly com.microsoft.azure.synapse.ml.$pkg.**") | |
| done | |
| if ! timeout 25m sbt $(SBT_JAVA_OPTS) "${SBT_COMMANDS[@]}"; then | |
| echo "##vso[task.logissue type=warning]Unit tests failed on $(RELEASE_BRANCH)" |
Uh oh!
There was an error while loading. Please reload this page.