Skip to content
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

fix query insights zip versioning #34

Merged

Conversation

ansjcy
Copy link
Member

@ansjcy ansjcy commented Jul 20, 2024

Description

Currently the build is failing with

2024-07-19 19:37:51 ERROR    ERROR: Artifact query-insights.zip is invalid. Expected filename to include one of ['2.16.0.0'].

We are missing the correct version variable set up in the build script.

Test

./scripts/build.sh -v 3.0.0 -s true
+ getopts :h:v:q:s:o:p:a: arg
+ case $arg in
+ VERSION=3.0.0
+ getopts :h:v:q:s:o:p:a: arg
+ case $arg in
+ SNAPSHOT=true
+ getopts :h:v:q:s:o:p:a: arg
+ '[' -z 3.0.0 ']'
+ [[ ! -z '' ]]
+ [[ true == \t\r\u\e ]]
+ VERSION=3.0.0-SNAPSHOT
+ '[' -z '' ']'
+ OUTPUT=artifacts
+ mkdir -p artifacts
+ ./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=3.0.0-SNAPSHOT -Dbuild.snapshot=true -Dbuild.version_qualifier=
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.8/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.8
  OS Info               : Mac OS X 14.5 (aarch64)
  JDK Version           : 17 (Amazon Corretto JDK)
  JAVA_HOME             : /Users/cyji/.sdkman/candidates/java/17.0.7-amzn
  Random Testing Seed   : 5C11FBD8E80DDB25
  In FIPS 140 mode      : false
=======================================

BUILD SUCCESSFUL in 45s
11 actionable tasks: 9 executed, 2 from cache
++ find . -path '*build/distributions/*.zip'
+ zipPath=./build/distributions/query-insights-3.0.0.0-SNAPSHOT.zip
++ dirname ./build/distributions/query-insights-3.0.0.0-SNAPSHOT.zip
+ distributions=./build/distributions
+ echo 'COPY ./build/distributions/*.zip'
COPY ./build/distributions/*.zip
+ mkdir -p artifacts/plugins
+ cp ./build/distributions/query-insights-3.0.0.0-SNAPSHOT.zip ./artifacts/plugins
+ ./gradlew publishPluginZipPublicationToMavenLocal -Dopensearch.version=3.0.0-SNAPSHOT -Dbuild.snapshot=true -Dbuild.version_qualifier=
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.8
  OS Info               : Mac OS X 14.5 (aarch64)
  JDK Version           : 17 (Amazon Corretto JDK)
  JAVA_HOME             : /Users/cyji/.sdkman/candidates/java/17.0.7-amzn
  Random Testing Seed   : C5E7F8638788329B
  In FIPS 140 mode      : false
=======================================

BUILD SUCCESSFUL in 760ms
9 actionable tasks: 3 executed, 6 up-to-date
+ ./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=3.0.0-SNAPSHOT -Dbuild.snapshot=true -Dbuild.version_qualifier=
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.8
  OS Info               : Mac OS X 14.5 (aarch64)
  JDK Version           : 17 (Amazon Corretto JDK)
  JAVA_HOME             : /Users/cyji/.sdkman/candidates/java/17.0.7-amzn
  Random Testing Seed   : 133092F4E40EAAE4
  In FIPS 140 mode      : false
=======================================

BUILD SUCCESSFUL in 449ms
9 actionable tasks: 2 executed, 7 up-to-date
+ mkdir -p artifacts/maven/org/opensearch
+ cp -r ./build/local-staging-repo/org/opensearch/. artifacts/maven/org/opensearch
ls ./build/distributions
query-insights-3.0.0.0-SNAPSHOT-javadoc.jar
query-insights-3.0.0.0-SNAPSHOT-sources.jar
query-insights-3.0.0.0-SNAPSHOT.jar
query-insights-3.0.0.0-SNAPSHOT.pom
query-insights-3.0.0.0-SNAPSHOT.zip

Issues Resolved

#33

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Collaborator

@deshsidd deshsidd left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@ansjcy ansjcy merged commit 6b0dddd into opensearch-project:main Jul 20, 2024
11 of 12 checks passed
@opensearch-trigger-bot
Copy link

The backport to 2.16 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/query-insights/backport-2.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/query-insights/backport-2.16
# Create a new branch
git switch --create backport/backport-34-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6b0ddddc034e274dd3c258133fe5cfddb717f5f8
# Push it to GitHub
git push --set-upstream origin backport/backport-34-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/query-insights/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-34-to-2.16.

@opensearch-trigger-bot
Copy link

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/query-insights/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/query-insights/backport-2.x
# Create a new branch
git switch --create backport/backport-34-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6b0ddddc034e274dd3c258133fe5cfddb717f5f8
# Push it to GitHub
git push --set-upstream origin backport/backport-34-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/query-insights/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-34-to-2.x.

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.

2 participants