-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into count-with-aggregation-query
- Loading branch information
Showing
207 changed files
with
1,028 additions
and
546 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,58 @@ | ||
name: Generate Spring Auto-Configurations | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
branch_name: | ||
description: PR branch name | ||
required: true | ||
default: "renovate/main-gcp-libraries-bom.version" | ||
forked_repo: | ||
description: Fork name (enter none if repo branch) | ||
required: true | ||
default: "renovate-bot/GoogleCloudPlatform-_-spring-cloud-gcp" | ||
pull_request: | ||
types: [opened] | ||
jobs: | ||
generateLibraries: | ||
# Run job if manually triggered, or on PR with matching branch condition | ||
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/maven/com.google.cloud-libraries-bom') && github.event.action == 'opened') }} | ||
# Run this if workflow is manually triggered | ||
# On initial opening of renovate or dependabot PR with matching branch condition, | ||
# log information required for manually triggering workflow and exit with error to block PR | ||
if: ${{ (github.event_name == 'workflow_dispatch') || startsWith(github.head_ref, 'renovate/main-gcp-libraries-bom.version') || startsWith(github.head_ref, 'dependabot/maven/com.google.cloud-libraries-bom') }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get branch name | ||
id: get_branch_name | ||
- name: Get PR info | ||
id: get_pr_info | ||
continue-on-error: false | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
set -x | ||
if ${{ github.event_name == 'pull_request' }}; then | ||
echo "Branch name from PR event: $GITHUB_HEAD_REF" | ||
echo "BRANCH_NAME=$GITHUB_HEAD_REF" >> $GITHUB_OUTPUT | ||
else | ||
echo "Branch name from manual trigger: $GITHUB_REF_NAME" | ||
echo "BRANCH_NAME=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Fail if not dependabot branch | ||
echo "Please trigger update workflow manually. The following information may be helpful: " | ||
echo "PR head repo full name: $HEAD_REPO_NAME" | ||
echo "PR base repo full name: $BASE_REPO_NAME" | ||
echo "PR branch name: $PR_BRANCH_NAME" | ||
echo "Actor from PR event: $GITHUB_ACTOR" | ||
exit 1 | ||
env: | ||
HEAD_REPO_NAME: ${{ github.event.pull_request.head.repo.full_name }} | ||
BASE_REPO_NAME: ${{ github.event.pull_request.base.repo.full_name }} | ||
PR_BRANCH_NAME: ${{ github.head_ref }} | ||
- name: Get libraries bom version | ||
id: get_libraries_bom_version | ||
continue-on-error: false | ||
if: ${{ !startsWith(steps.get_branch_name.outputs.BRANCH_NAME, 'dependabot/maven/com.google.cloud-libraries-bom') }} | ||
# Fetch updated pom file with the new libraries-bom version. | ||
# This step differs slightly depending on whether the workflow is triggered for a forked repo. | ||
run: | | ||
echo "This workflow should only be triggered from a dependabot branch to update libraries-bom" | ||
echo "Stopping workflow triggered from branch: ${{ steps.get_branch_name.outputs.BRANCH_NAME }}" | ||
exit 1 | ||
set -x | ||
sudo apt-get update | ||
sudo apt-get install libxml2-utils | ||
if [[ ${{ github.event.inputs.forked_repo }} != "none" ]]; then | ||
git fetch https://github.com/${{ github.event.inputs.forked_repo }}.git ${{ github.event.inputs.branch_name }} | ||
git checkout FETCH_HEAD -- spring-cloud-gcp-dependencies/pom.xml | ||
else | ||
git fetch origin ${{ github.event.inputs.branch_name }} | ||
git checkout origin/${{ github.event.inputs.branch_name }} -- spring-cloud-gcp-dependencies/pom.xml | ||
fi | ||
echo "LIBRARIES_BOM_VERSION=$(xmllint --xpath "string(//*[local-name()='gcp-libraries-bom.version'])" spring-cloud-gcp-dependencies/pom.xml)" >> $GITHUB_OUTPUT | ||
- name: Setup Java 17 | ||
uses: actions/setup-java@v1 | ||
with: | ||
|
@@ -51,14 +76,19 @@ jobs: | |
set -x | ||
bash reset-previews-folder.sh | ||
- name: Generate library list | ||
id: generate_library_list | ||
continue-on-error: false | ||
working-directory: spring-cloud-generator | ||
run: | | ||
set -x | ||
set -e | ||
sudo apt-get update | ||
sudo apt-get install libxml2-utils | ||
bash generate-library-list.sh | ||
echo "Libraries BOM version: $LIBRARIES_BOM_VERSION" | ||
MONOREPO_TAG=v$(bash compute-monorepo-tag.sh -v $LIBRARIES_BOM_VERSION) | ||
echo "MONOREPO_COMMITISH=$MONOREPO_TAG" >> $GITHUB_OUTPUT | ||
bash generate-library-list.sh -c $MONOREPO_TAG | ||
cat library_list.txt | ||
env: | ||
LIBRARIES_BOM_VERSION: ${{ steps.get_libraries_bom_version.outputs.LIBRARIES_BOM_VERSION }} | ||
- name: Compile non-autogen libraries | ||
continue-on-error: false | ||
run: | | ||
|
@@ -76,7 +106,9 @@ jobs: | |
run: | | ||
set -x | ||
set -e | ||
bash generate-all.sh | ||
bash generate-all.sh -m $MONOREPO_COMMITISH | ||
env: | ||
MONOREPO_COMMITISH: ${{ steps.generate_library_list.outputs.MONOREPO_COMMITISH }} | ||
- name: Check for generation errors | ||
continue-on-error: false | ||
working-directory: spring-cloud-generator | ||
|
@@ -91,17 +123,6 @@ jobs: | |
cat failed-library-generations/$failed_lib_name | ||
done | ||
exit 1 | ||
- name: Check for compilation errors | ||
continue-on-error: false | ||
working-directory: spring-cloud-previews | ||
run: | | ||
../mvnw \ | ||
--batch-mode \ | ||
--show-version \ | ||
--threads 1.5C \ | ||
--define maven.test.skip=true \ | ||
--define maven.javadoc.skip=true \ | ||
install | ||
#Compares the current contents of spring-cloud-previews with the new generated libraries | ||
- name: Detect changes | ||
id: detect_changes | ||
|
@@ -122,27 +143,33 @@ jobs: | |
if: steps.detect_changes.outputs.CHANGED_FILES > 0 | ||
run: | | ||
set -x | ||
# stashes the changes from generated libs | ||
git stash push -- spring-cloud-previews/ | ||
git reset --hard | ||
git remote update | ||
# pops the changes in branch | ||
git checkout $BRANCH_NAME | ||
git stash pop | ||
git add ./spring-cloud-previews | ||
# configure author | ||
git config --global user.name "Cloud Java Bot" | ||
git config --global user.email "[email protected]" | ||
# commit | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | ||
git commit -m "chore: update starter modules in spring-cloud-previews" | ||
git push --set-upstream origin $BRANCH_NAME | ||
# push changes to branch | ||
if [[ ${{ github.event.inputs.forked_repo }} != "none" ]]; then | ||
git fetch https://github.com/${{ github.event.inputs.forked_repo }}.git ${{ github.event.inputs.branch_name }} | ||
git checkout FETCH_HEAD | ||
git stash pop | ||
git add ./spring-cloud-previews | ||
git commit -m "chore: update starter modules in spring-cloud-previews" | ||
git push https://github.com/${{ github.event.inputs.forked_repo }}.git HEAD:${{ github.event.inputs.branch_name }} | ||
else | ||
git fetch origin ${{ github.event.inputs.branch_name }} | ||
git checkout ${{ github.event.inputs.branch_name }} | ||
git reset --hard | ||
git stash pop | ||
git add ./spring-cloud-previews | ||
git commit -m "chore: update starter modules in spring-cloud-previews" | ||
git push -u origin ${{ github.event.inputs.branch_name }} | ||
fi | ||
env: | ||
BRANCH_NAME: ${{ steps.get_branch_name.outputs.BRANCH_NAME }} | ||
GITHUB_ACTOR_EMAIL: ${{ steps.determine_workflow_author_email.outputs.GITHUB_ACTOR_EMAIL }} | ||
GITHUB_ACTOR_NAME: ${{ steps.determine_workflow_author_email.outputs.GITHUB_ACTOR_NAME }} | ||
GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip |
Oops, something went wrong.