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

feat: enable ci for windows and macos #907

Merged
merged 26 commits into from
Oct 25, 2022

Conversation

derek-ho
Copy link
Collaborator

@derek-ho derek-ho commented Oct 12, 2022

Signed-off-by: Derek Ho dxho@amazon.com

Description

[Describe what this change achieves]

Issues Resolved

#249 #250

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho derek-ho requested a review from a team as a code owner October 12, 2022 19:25
@derek-ho derek-ho marked this pull request as draft October 12, 2022 19:25
Signed-off-by: Derek Ho <dxho@amazon.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2022

Codecov Report

Merging #907 (79f765c) into 2.x (057fa44) will decrease coverage by 35.10%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##                2.x     #907       +/-   ##
=============================================
- Coverage     97.87%   62.76%   -35.11%     
=============================================
  Files           284       10      -274     
  Lines          7425      658     -6767     
  Branches        475      119      -356     
=============================================
- Hits           7267      413     -6854     
- Misses          157      192       +35     
- Partials          1       53       +52     
Flag Coverage Δ
query-workbench 62.76% <ø> (?)
sql-engine ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...l/planner/optimizer/rule/MergeFilterAndFilter.java
...nsearch/sql/storage/bindingtuple/BindingTuple.java
.../org/opensearch/sql/planner/logical/LogicalAD.java
...ch/sql/planner/logical/LogicalPlanNodeVisitor.java
.../opensearch/sql/opensearch/executor/Scheduler.java
...g/opensearch/sql/expression/text/TextFunction.java
...org/opensearch/sql/expression/NamedExpression.java
...arch/sql/opensearch/response/agg/FilterParser.java
...earch/sql/opensearch/data/utils/ObjectContent.java
...search/sql/opensearch/security/SecurityAccess.java
... and 284 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

You can use a matrix build to run a workflow on few OS.
https://devblogs.microsoft.com/premier-developer/github-actions-overview/#matrix-builds

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho derek-ho marked this pull request as ready for review October 17, 2022 14:36
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disabled doctest/integTest for now, created an issue to enable them in the future
#921

@@ -36,9 +47,10 @@ jobs:
java-version: ${{ matrix.java }}

- name: Build with Gradle
run: ./gradlew --continue build assemble
run: ./gradlew --continue build ${{ env.BUILD_ARGS }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is assemble unnecessary here? It seems build includes assemble:
https://stackoverflow.com/a/44185464

workbench/package.json Outdated Show resolved Hide resolved
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
This was referenced Oct 17, 2022
@@ -16,7 +17,7 @@ class ErrorFormatterTest {
@Test
void htmlEscaping_should_disabled() {
assertEquals(
"{\n" + " \"request\": \"index=test\"\n" + "}",
format("{\n" + " \"request\": \"index=test\"\n" + "}"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be there %n too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch I reverted this file. As per @joshuali925's suggestion, I will not be doing replaceAll in ErrorFormatter, as this could affect user entered input. Reverted this file to initial state, as I am no longer doing anything in the ErrorFormatter itself.

Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho
Copy link
Collaborator Author

Looks like at least integ tests are disabled on Windows. That's fine, but please open an issue to re-enable them.

Done: #921

@derek-ho
Copy link
Collaborator Author

@Yury-Fridlyand can you give it another review and remove the changes requested block if things look good?

…s succeeds

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@Yury-Fridlyand
Copy link
Collaborator

Why ubuntu CI goes to download artifacts for macos?
https://github.com/opensearch-project/sql/actions/runs/3285095735/jobs/5411815462

> Could not resolve all files for configuration ':integ-test:opensearch_distro_extracted_testclusters-integ-test-sqlBwcCluster1-0-1.1.0-'.

   > Could not resolve opensearch-distribution:opensearch:1.1.0.
     Required by:
         project :integ-test
      > Could not resolve opensearch-distribution:opensearch:1.1.0.
         > Could not get resource 'https://artifacts.opensearch.org/releases/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'.
            > Could not HEAD 'https://artifacts.opensearch.org/releases/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'. Received status code 403 from server: Forbidden
      > Could not resolve opensearch-distribution:opensearch:1.1.0.
         > Could not get resource 'https://artifacts.opensearch.org/release-candidates/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'.
            > Could not HEAD 'https://artifacts.opensearch.org/release-candidates/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'. Received status code 403 from server: Forbidden

@derek-ho
Copy link
Collaborator Author

Why ubuntu CI goes to download artifacts for macos? https://github.com/opensearch-project/sql/actions/runs/3285095735/jobs/5411815462

> Could not resolve all files for configuration ':integ-test:opensearch_distro_extracted_testclusters-integ-test-sqlBwcCluster1-0-1.1.0-'.

   > Could not resolve opensearch-distribution:opensearch:1.1.0.
     Required by:
         project :integ-test
      > Could not resolve opensearch-distribution:opensearch:1.1.0.
         > Could not get resource 'https://artifacts.opensearch.org/releases/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'.
            > Could not HEAD 'https://artifacts.opensearch.org/releases/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'. Received status code 403 from server: Forbidden
      > Could not resolve opensearch-distribution:opensearch:1.1.0.
         > Could not get resource 'https://artifacts.opensearch.org/release-candidates/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'.
            > Could not HEAD 'https://artifacts.opensearch.org/release-candidates/core/opensearch/1.1.0/opensearch-min-1.1.0-darwin-x64.tar.gz'. Received status code 403 from server: Forbidden

I'm not quite sure I didn't touch that section, but i'll check...

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho
Copy link
Collaborator Author

derek-ho commented Oct 20, 2022

@Yury-Fridlyand Fixed it, please review again, thanks!

Yury-Fridlyand
Yury-Fridlyand previously approved these changes Oct 20, 2022
- name: Build with Gradle
run: ./gradlew --continue build assemble
run: ./gradlew --continue build ${{ env.BUILD_ARGS }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can use there

Suggested change
run: ./gradlew --continue build ${{ env.BUILD_ARGS }}
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right this is cleaner let me do this

+ "\"John,Smith\",\"30,,,\"";
assertEquals(expected, formatter.format(response));
assertEquals(format(expected), formatter.format(response));
}

@Test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you need %n in this test as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, put a %n on line 88 in this file

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho derek-ho merged commit 0699baa into opensearch-project:2.x Oct 25, 2022
@derek-ho derek-ho deleted the enable-windows-macos branch October 25, 2022 18:00
@opensearch-trigger-bot
Copy link
Contributor

The backport to main failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-main main
# Navigate to the new working tree
cd .worktrees/backport-main
# Create a new branch
git switch --create backport/backport-907-to-main
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0699baa2ae47fb72af9721986df669e786655cd2
# Push it to GitHub
git push --set-upstream origin backport/backport-907-to-main
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-main

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

derek-ho added a commit to derek-ho/sql that referenced this pull request Oct 25, 2022
…s-macos

feat: enable ci for windows and macos
(cherry picked from commit 0699baa)
derek-ho added a commit to derek-ho/sql that referenced this pull request Oct 25, 2022
…s-macos

feat: enable ci for windows and macos
(cherry picked from commit 0699baa)
Signed-off-by: Derek Ho <dxho@amazon.com>
derek-ho added a commit that referenced this pull request Oct 25, 2022
…nch (#962)

* Merge pull request #907 from derek-ho/enable-windows-macos

feat: enable ci for windows and macos
(cherry picked from commit 0699baa)
Signed-off-by: Derek Ho <dxho@amazon.com>

* always and os==ubuntu

Signed-off-by: Derek Ho <dxho@amazon.com>

Signed-off-by: Derek Ho <dxho@amazon.com>
@penghuo penghuo mentioned this pull request Dec 6, 2022
6 tasks
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.

6 participants