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: SDK build for 22.0. #959

Merged
merged 13 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codegen-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
# TODO: can we cache some layers of the image for faster download?
# we probably don't want to cache the final image for IP security...
run: |
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
# set $LOOKER_OPTS to --no-ssl if we want to turn off ssl
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
docker logs -f looker-sdk-codegen-ci --until=30s &
- uses: actions/setup-node@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lerna-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:

- name: Pull and run Looker docker image
run: |
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
docker logs -f looker-sdk-codegen-ci --until=30s &
- uses: actions/setup-node@v2
Expand Down
105 changes: 47 additions & 58 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ env:
LOOKERSDK_VERIFY_SSL: false
TOX_JUNIT_OUTPUT_DIR: results

defaults:
run:
shell: bash
working-directory: python/

jobs:
typecheck:
name: Mypy
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: python/

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
Expand All @@ -39,29 +39,17 @@ jobs:
- run: pip install mypy types-requests
- run: mypy looker_sdk/

# if this job fails the required state check "Python Tests" is never
# set, so we will set it manually.
- name: Report Failure
run: |
curl --request POST \
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header "content-type: application/json" \
--header "Accept: application/vnd.github.v3+json" \
--data '{
"name": "Python Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"conclusion": "failure"
}' \
--fail
if: failure()

unit:
needs: typecheck
name: Unit - ${{ matrix.os }} / py${{ matrix.python-version }}
env:
TOX_JUNIT_OUTPUT_NAME: ${{ matrix.os }}.py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
working-directory: python/

strategy:
# run all supported python versions on ubuntu
# run only latest supported python version on windows/mac
Expand Down Expand Up @@ -94,23 +82,6 @@ jobs:
python -m pip install --upgrade pip
pip install tox

# if this job fails the required state check "Python Tests" is never
# set, so we will set it manually.
- name: Report Failure
run: |
curl --request POST \
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header "content-type: application/json" \
--header "Accept: application/vnd.github.v3+json" \
--data '{
"name": "Python Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"conclusion": "failure"
}' \
--fail
if: failure()

- name: Run Unit Tests
run: tox -e unit

Expand All @@ -127,15 +98,19 @@ jobs:
env:
TOX_JUNIT_OUTPUT_NAME: ${{ matrix.os }}.Looker-${{ matrix.looker }}.py3.x
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
working-directory: python/

strategy:
matrix:
os:
- ubuntu
looker:
- '21_12'
- '21_16'
- '21_18'
- '21_20'
- '22_0'
# TODO uncomment `include:` when either macos or windows works to satisfaction.
#include:
# TODO: macos matrix leg is functional but it takes ~20 minutes (compared
Expand Down Expand Up @@ -231,23 +206,6 @@ jobs:
run: |
${{ github.workspace }}/.github/scripts/wait_for_looker.sh

# if this job fails the required state check "Python Tests" is never
# set, so we will set it manually.
- name: Report Failure
run: |
curl --request POST \
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header "content-type: application/json" \
--header "Accept: application/vnd.github.v3+json" \
--data '{
"name": "Python Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"conclusion": "failure"
}' \
--fail
if: failure()

- name: Run Integration Tests
run: tox -e integration

Expand All @@ -261,6 +219,11 @@ jobs:
twine:
needs: integration
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: python/

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -283,7 +246,33 @@ jobs:
with:
path: artifacts

# If there are no test result files the test is reported as passing!
# That allows for some weird failure modes, where an early failure
# is not distinguished from a pass.
- name: Check Results Files Exist
id: check-results-exist
run: |
if [[ $(ls -l artifacts/python-test-results/*.xml 2> /dev/null | wc -l) -ge "1" ]]; then
exit 0
else
curl --request POST \
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header "content-type: application/json" \
--header "Accept: application/vnd.github.v3+json" \
--data '{
"name": "Python Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"conclusion": "failure"
}' \
--fail \
-o /dev/null \
--silent
exit 1
fi

- name: Publish Unit Test Results
if: steps.check-results-exist.outcome == 'success'
uses: EnricoMi/publish-unit-test-result-action@v1.12
with:
# Cosmetic issue with `check_name` being associated to the wrong
Expand Down
55 changes: 36 additions & 19 deletions .github/workflows/required-checks-hack-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,31 @@ jobs:
with:
filters: |
apix:
- packages/code-editor/**
- packages/run-it/**
- packages/api-explorer/**
- packages/extension-api-explorer/**
- packages/extension-utils/**
- packages/code-editor/**/*
- packages/run-it/**/*
- packages/api-explorer/**/*
drstrangelooker marked this conversation as resolved.
Show resolved Hide resolved
- packages/extension-api-explorer/**/*
- packages/extension-utils/**/*
codegen:
- packages/sdk-codegen/**
- packages/sdk-codegen-utils/**
- packages/sdk-codegen-scripts/**
- packages/sdk-codegen/**/*
- packages/sdk-codegen-utils/**/*
- packages/sdk-codegen-scripts/**/*
hackathon:
- packages/wholly-sheet/**
- packages/hackathon/**
- packages/wholly-sheet/**/*
- packages/hackathon/**/*
python:
- python/**
- python/**/*
resources:
- bin/looker-resources-index/**
- docs/resources/**
- bin/looker-resources-index/**/*
- docs/resources/**/*
tssdk:
- packages/sdk/**
- packages/sdk-rtl/**
- packages/sdk-node/**
- packages/extension-sdk/**
- packages/extension-sdk-react/**
- packages/extension-utils/**
- packages/sdk/**/*
- packages/sdk-rtl/**/*
- packages/sdk-node/**/*
- packages/extension-sdk/**/*
- packages/extension-sdk-react/**/*
- packages/extension-utils/**/*

- name: Debug info
run: |
echo "${{ toJSON(steps.filter.outputs) }}"
Expand All @@ -85,6 +86,10 @@ jobs:
--data '{
"name": "Codegen Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"output": {
"title": "Required Checks Hack / Codegen Tests",
"summary": "Associated files have not been changed so this can be skipped"
},
"conclusion": "success"
}' \
--fail
Expand All @@ -100,6 +105,10 @@ jobs:
--data '{
"name": "Typescript Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"output": {
"title": "Required Checks Hack / Typescript Tests",
"summary": "Associated files have not been changed so this can be skipped"
},
"conclusion": "success"
}' \
--fail
Expand All @@ -115,6 +124,10 @@ jobs:
--data '{
"name": "Python Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"output": {
"title": "Required Checks Hack / Python Tests",
"summary": "Associated files have not been changed so this can be skipped"
},
"conclusion": "success"
}' \
--fail
Expand All @@ -130,6 +143,10 @@ jobs:
--data '{
"name": "APIX Tests",
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
"output": {
"title": "Required Checks Hack / APIX Tests",
"summary": "Associated files have not been changed so this can be skipped"
},
"conclusion": "success"
}' \
--fail
3 changes: 1 addition & 2 deletions .github/workflows/tssdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ jobs:
os:
- ubuntu
looker:
- '21_12'
- '21_16'
- '21_18'
- '21_20'
- '22_0'

steps:
- name: Repo Checkout
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ These API-specific files still use all the same Run-Time Library (RTL) code in t
Please review the following table for a breakdown of the options to initialize the desired SDK object.

| SDK | API 3.1 | API 4.0 | Notes |
| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Python](python) | `looker_sdk.init31()` | `looker_sdk.init40()` | Both API 3.1 and 4.0 are supported, and can be initialized with the functions shown |
| [TypeScript](packages/sdk) | `Looker31SDK()`, `LookerNodeSDK.init31()`, or `LookerBrowserSDK.init31()` | `Looker40SDK()`, `LookerNodeSDK.init40()` or `LookerBrowserSDK.init40()` | Both API 3.1 and 4.0 are supported and can be initialized with the functions shown. **Important** - See information on the [typescript SDK dependencies](#very-important-note-regarding-the-looker-typescript-sdk) at the bottom of this file. |
| [Kotlin](kotlin) | Do not use | `LookerSDK()` | API 4.0 was specifically created to correct the endpoint payloads for strongly-typed languages like Kotlin and Swift. Because Kotlin really requires API 4.0, API 4.0 is the default namespace for it |
| [Swift](swift/looker) | Not applicable | `Looker40SDK()` | Swift only has SDK definitions for API 4.0 | |
| [Look#](csharp) | `Looker31SDK()` | `Looker40SDK()` | Community-supported C# SDK for Looker | |
| [GoLook](go) | Not applicable | `v4.NewLookerSDK()` | Community-supported GO SDK for Looker | |
| [Swift](swift/looker) | Not applicable | `Looker40SDK()` | Swift only has SDK definitions for API 4.0 |
| [Look#](csharp) | `Looker31SDK()` | `Looker40SDK()` | Community-supported C# SDK for Looker |
| [GoLook](go) | Not applicable | `v4.NewLookerSDK()` | Community-supported GO SDK for Looker |

By supporting both API versions in the same SDK package, we hope the migration path to the latest API is simplified. Both SDK versions can be used at the same time, in the same source file, which should allow for iterative work to move to the new API version.

Expand Down
2 changes: 1 addition & 1 deletion csharp/rtl/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct Constants

public const string DefaultApiVersion = "4.0";
public const string AgentPrefix = "CS-SDK";
public const string LookerVersion = "21.20";
public const string LookerVersion = "22.0";

public const string Bearer = "Bearer";
public const string LookerAppiId = "x-looker-appid";
Expand Down
8 changes: 6 additions & 2 deletions csharp/sdk/3.1/methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2595,7 +2595,9 @@ public async Task<SdkResponse<string, Exception>> delete_folder(

/// ### Get information about all folders.
///
/// In API 3.x, this will not return empty personal folders, unless they belong to the calling user.
/// In API 3.x, this will not return empty personal folders, unless they belong to the calling user,
/// or if they contain soft-deleted content.
///
/// In API 4.0+, all personal folders will be returned.
///
/// GET /folders -> Folder[]
Expand Down Expand Up @@ -6612,7 +6614,9 @@ public async Task<SdkResponse<string, Exception>> delete_space(

/// ### Get information about all spaces.
///
/// In API 3.x, this will not return empty personal spaces, unless they belong to the calling user.
/// In API 3.x, this will not return empty personal spaces, unless they belong to the calling user,
/// or if they contain soft-deleted content.
///
/// In API 4.0+, all personal spaces will be returned.
///
/// GET /spaces -> SpaceBase[]
Expand Down
Loading