Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…wflakeclient into SNOW-715551v2
  • Loading branch information
sfc-gh-ext-simba-jy committed Dec 17, 2024
2 parents f3eddf5 + 9d050a6 commit a6a853e
Show file tree
Hide file tree
Showing 31 changed files with 250 additions and 4,213 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ jobs:
- name: Use cached warnings as a baseline
shell: bash
run: cp warnings.json ./ci/scripts/warnings_baseline.json
if: steps.cache-restore-warnings.outputs.cache-hit == true
if: steps.cache-restore-warnings.outputs.cache-hit == 'true'
- name: Warning report
shell: bash
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: ci/scripts/warning_report.sh
- name: Upload build log
uses: actions/upload-artifact@v4
Expand All @@ -71,6 +73,6 @@ jobs:
uses: actions/cache/save@v4
with:
path: warnings.json
key: ${{ github.event.pull_request.base.sha }}-compile-warnings
key: ${{ github.sha }}-compile-warnings
if: github.ref_name == github.event.repository.default_branch

2 changes: 1 addition & 1 deletion .github/workflows/jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
summary: '${{ github.event.issue.title }}'
description: |
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:3c0352b5-63f7-4e26-9afe-38f6f9f0f4c5"}, "components":[{"id":"19292"}] }'
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:e1f41916-da57-4fe8-b317-116d5229aa51"}, "components":[{"id":"19292"}], "labels": ["oss"], "priority": {"id": "10001"} }'

- name: Update GitHub Issue
uses: ./jira/gajira-issue-update
Expand Down
52 changes: 42 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,61 @@ Snowflake Connector for C/C++
:target: http://www.apache.org/licenses/LICENSE-2.0.txt


Prerequisites
================================================================================

Operating system
For a list of the operating systems supported by Snowflake clients, see `Operating system support <https://docs.snowflake.com/en/release-notes/requirements#label-client-operating-system-support>`_.

To build libsnowflakeclient, the following software must be installed:

- On Windows: Visual Studio 2015, 2017, 2019 or 2022
- On Linux:

- gcc/g++ 8.3 or higher. **Note**: on certain OS (e.g. Centos 7) the preinstalled gcc/libstdc++ version is below the required minimum. For Centos 7, this is 4.8.5, which is below the requirement. Building libsnowflakeclient might be unsuccessful on such OS's until the prerequisite is fulfilled, i.e. libraries upgraded to at least the minimum version.
- cmake 3.17 or higher

- On macOS:

- clang
- cmake 3.17 or higher

To run test cases, the following software must be installed:

- jq: https://jqlang.github.io/jq/download/
- python 3.7 or higher

Build and Tests
======================================================================

Build
----------------------------------------------------------------------

Ensure you have cmake 3.17 or later version.

Linux and OSX
^^^^^^^^^^^^^

.. code-block:: bash
./scripts/build_dependencies.sh
./scripts/build_libsnowflakeclient.sh
Windows
^^^^^^^^^^

Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS14, VS15, VS16, VS17] and run the script.

.. code-block:: bash
set platform=x64
set build_type=Debug
set vs_version=VS14
ci\build.bat
set build_type=Release
set vs_version=VS17
.\scripts\build_dependencies.bat
.\scripts\build_libsnowflakeclient.bat
Prepare for Test
----------------------------------------------------------------------

Set the Snowflake connection info in ``parameters.json`` and place it in $HOME:
Set the Snowflake connection info in ``parameters.json`` and place it in the root path of libsnowflakeclient repository:

.. code-block:: json
Expand All @@ -55,9 +79,16 @@ Set the Snowflake connection info in ``parameters.json`` and place it in $HOME:
"SNOWFLAKE_TEST_DATABASE": "<your_database>",
"SNOWFLAKE_TEST_SCHEMA": "<your_schema>",
"SNOWFLAKE_TEST_ROLE": "<your_role>"
"SNOWFLAKE_TEST_HOST": "<your_snowflake_url>"
"CLOUD_PROVIDER": "<your_cloud_provider>"
}
}
where:

- :code:`<your_snowflake_url>` is optional. Set it when your Snowflake URL is not in the format of :code:`account.snowflakecomputing.com`.
- :code:`<CLOUD_PROVIDER>` is the cloud platform of your Snowflake account. (:code:`AWS`, :code:`AZURE` or :code:`GCP`).

Proxy
^^^^^^^^^^

Expand Down Expand Up @@ -96,9 +127,10 @@ Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], V
.. code-block:: bash
set platform=x64
set build_type=Debug
set vs_version=VS14
ci\test.bat
set build_type=Release
set vs_version=VS17
.\scripts\run_tests.bat
Code Coverage (Linux)
Expand Down
15 changes: 14 additions & 1 deletion ci/scripts/warning_report.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

if [[ ! -f ci/scripts/warnings_baseline.json ]];
then
echo "Baseline file does not exist."
echo "[]" > ci/scripts/warnings_baseline.json
fi

python3 ci/scripts/generate_warning_report.py --build-log build.log --load-warnings ci/scripts/warnings_baseline.json --dump-warnings warnings.json --report report.md

if [[ -n "${GITHUB_STEP_SUMMARY}" ]];
Expand All @@ -9,5 +15,12 @@ fi

if [[ "$(head -n 1 report.md)" == "### Failed" ]];
then
exit 1
if [[ "${BRANCH_NAME}" == "master" ]];
then
echo "Failures are ignored on master since there is no base branch to reference."
exit 0
else
echo "Warnings check failed. Check workflow summary to find out the details."
exit 1
fi
fi
Loading

0 comments on commit a6a853e

Please sign in to comment.