Skip to content

Commit de651b3

Browse files
feat: SDK build for 22.0. (#959)
* docs: fixed table that wasn't generated properly * feature: SDK generated for Looker 22.0 * chore: update CI for Looker 22.0 * fix: update package.json to allow sdk 22.0 * chore: forgot yarn.lock * chore: fix versions * chore: release 1.22.0 Release-As: 1.22.0 * chore: make sure failure is reported when *.xml artifacts are not generated * chore: add debug for the triggering event on required-checks-hack-ci.yml * chore: fix bad error handling flow in python-ci.yml * chore: fix messages in reports from Required Checks Hack * fix: added handling for object in query string * chore: built api 22.0
1 parent 75ee320 commit de651b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+14963
-7142
lines changed

.github/workflows/codegen-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
# TODO: can we cache some layers of the image for faster download?
5555
# we probably don't want to cache the final image for IP security...
5656
run: |
57-
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
57+
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
5858
# set $LOOKER_OPTS to --no-ssl if we want to turn off ssl
59-
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
59+
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
6060
docker logs -f looker-sdk-codegen-ci --until=30s &
6161
6262
- uses: actions/setup-node@v1

.github/workflows/lerna-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242

4343
- name: Pull and run Looker docker image
4444
run: |
45-
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
46-
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
45+
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/22_0
46+
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
4747
docker logs -f looker-sdk-codegen-ci --until=30s &
4848
4949
- uses: actions/setup-node@v2

.github/workflows/python-ci.yml

Lines changed: 47 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ env:
1717
LOOKERSDK_VERIFY_SSL: false
1818
TOX_JUNIT_OUTPUT_DIR: results
1919

20-
defaults:
21-
run:
22-
shell: bash
23-
working-directory: python/
24-
2520
jobs:
2621
typecheck:
2722
name: Mypy
2823
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
shell: bash
27+
working-directory: python/
28+
2929
steps:
3030
- name: Cancel Previous Runs
3131
uses: styfle/[email protected]
@@ -39,29 +39,17 @@ jobs:
3939
- run: pip install mypy types-requests
4040
- run: mypy looker_sdk/
4141

42-
# if this job fails the required state check "Python Tests" is never
43-
# set, so we will set it manually.
44-
- name: Report Failure
45-
run: |
46-
curl --request POST \
47-
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
48-
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
49-
--header "content-type: application/json" \
50-
--header "Accept: application/vnd.github.v3+json" \
51-
--data '{
52-
"name": "Python Tests",
53-
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
54-
"conclusion": "failure"
55-
}' \
56-
--fail
57-
if: failure()
58-
5942
unit:
6043
needs: typecheck
6144
name: Unit - ${{ matrix.os }} / py${{ matrix.python-version }}
6245
env:
6346
TOX_JUNIT_OUTPUT_NAME: ${{ matrix.os }}.py${{ matrix.python-version }}
6447
runs-on: ${{ matrix.os }}-latest
48+
defaults:
49+
run:
50+
shell: bash
51+
working-directory: python/
52+
6553
strategy:
6654
# run all supported python versions on ubuntu
6755
# run only latest supported python version on windows/mac
@@ -94,23 +82,6 @@ jobs:
9482
python -m pip install --upgrade pip
9583
pip install tox
9684
97-
# if this job fails the required state check "Python Tests" is never
98-
# set, so we will set it manually.
99-
- name: Report Failure
100-
run: |
101-
curl --request POST \
102-
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
103-
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
104-
--header "content-type: application/json" \
105-
--header "Accept: application/vnd.github.v3+json" \
106-
--data '{
107-
"name": "Python Tests",
108-
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
109-
"conclusion": "failure"
110-
}' \
111-
--fail
112-
if: failure()
113-
11485
- name: Run Unit Tests
11586
run: tox -e unit
11687

@@ -127,15 +98,19 @@ jobs:
12798
env:
12899
TOX_JUNIT_OUTPUT_NAME: ${{ matrix.os }}.Looker-${{ matrix.looker }}.py3.x
129100
runs-on: ${{ matrix.os }}-latest
101+
defaults:
102+
run:
103+
shell: bash
104+
working-directory: python/
105+
130106
strategy:
131107
matrix:
132108
os:
133109
- ubuntu
134110
looker:
135-
- '21_12'
136-
- '21_16'
137111
- '21_18'
138112
- '21_20'
113+
- '22_0'
139114
# TODO uncomment `include:` when either macos or windows works to satisfaction.
140115
#include:
141116
# TODO: macos matrix leg is functional but it takes ~20 minutes (compared
@@ -231,23 +206,6 @@ jobs:
231206
run: |
232207
${{ github.workspace }}/.github/scripts/wait_for_looker.sh
233208
234-
# if this job fails the required state check "Python Tests" is never
235-
# set, so we will set it manually.
236-
- name: Report Failure
237-
run: |
238-
curl --request POST \
239-
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
240-
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
241-
--header "content-type: application/json" \
242-
--header "Accept: application/vnd.github.v3+json" \
243-
--data '{
244-
"name": "Python Tests",
245-
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
246-
"conclusion": "failure"
247-
}' \
248-
--fail
249-
if: failure()
250-
251209
- name: Run Integration Tests
252210
run: tox -e integration
253211

@@ -261,6 +219,11 @@ jobs:
261219
twine:
262220
needs: integration
263221
runs-on: ubuntu-latest
222+
defaults:
223+
run:
224+
shell: bash
225+
working-directory: python/
226+
264227
steps:
265228
- uses: actions/checkout@v2
266229
- uses: actions/setup-python@v2
@@ -283,7 +246,33 @@ jobs:
283246
with:
284247
path: artifacts
285248

249+
# If there are no test result files the test is reported as passing!
250+
# That allows for some weird failure modes, where an early failure
251+
# is not distinguished from a pass.
252+
- name: Check Results Files Exist
253+
id: check-results-exist
254+
run: |
255+
if [[ $(ls -l artifacts/python-test-results/*.xml 2> /dev/null | wc -l) -ge "1" ]]; then
256+
exit 0
257+
else
258+
curl --request POST \
259+
--url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
260+
--header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
261+
--header "content-type: application/json" \
262+
--header "Accept: application/vnd.github.v3+json" \
263+
--data '{
264+
"name": "Python Tests",
265+
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
266+
"conclusion": "failure"
267+
}' \
268+
--fail \
269+
-o /dev/null \
270+
--silent
271+
exit 1
272+
fi
273+
286274
- name: Publish Unit Test Results
275+
if: steps.check-results-exist.outcome == 'success'
287276
uses: EnricoMi/[email protected]
288277
with:
289278
# Cosmetic issue with `check_name` being associated to the wrong

.github/workflows/required-checks-hack-ci.yml

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,31 @@ jobs:
4040
with:
4141
filters: |
4242
apix:
43-
- packages/code-editor/**
44-
- packages/run-it/**
45-
- packages/api-explorer/**
46-
- packages/extension-api-explorer/**
47-
- packages/extension-utils/**
43+
- packages/code-editor/**/*
44+
- packages/run-it/**/*
45+
- packages/api-explorer/**/*
46+
- packages/extension-api-explorer/**/*
47+
- packages/extension-utils/**/*
4848
codegen:
49-
- packages/sdk-codegen/**
50-
- packages/sdk-codegen-utils/**
51-
- packages/sdk-codegen-scripts/**
49+
- packages/sdk-codegen/**/*
50+
- packages/sdk-codegen-utils/**/*
51+
- packages/sdk-codegen-scripts/**/*
5252
hackathon:
53-
- packages/wholly-sheet/**
54-
- packages/hackathon/**
53+
- packages/wholly-sheet/**/*
54+
- packages/hackathon/**/*
5555
python:
56-
- python/**
56+
- python/**/*
5757
resources:
58-
- bin/looker-resources-index/**
59-
- docs/resources/**
58+
- bin/looker-resources-index/**/*
59+
- docs/resources/**/*
6060
tssdk:
61-
- packages/sdk/**
62-
- packages/sdk-rtl/**
63-
- packages/sdk-node/**
64-
- packages/extension-sdk/**
65-
- packages/extension-sdk-react/**
66-
- packages/extension-utils/**
61+
- packages/sdk/**/*
62+
- packages/sdk-rtl/**/*
63+
- packages/sdk-node/**/*
64+
- packages/extension-sdk/**/*
65+
- packages/extension-sdk-react/**/*
66+
- packages/extension-utils/**/*
67+
6768
- name: Debug info
6869
run: |
6970
echo "${{ toJSON(steps.filter.outputs) }}"
@@ -85,6 +86,10 @@ jobs:
8586
--data '{
8687
"name": "Codegen Tests",
8788
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
89+
"output": {
90+
"title": "Required Checks Hack / Codegen Tests",
91+
"summary": "Associated files have not been changed so this can be skipped"
92+
},
8893
"conclusion": "success"
8994
}' \
9095
--fail
@@ -100,6 +105,10 @@ jobs:
100105
--data '{
101106
"name": "Typescript Tests",
102107
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
108+
"output": {
109+
"title": "Required Checks Hack / Typescript Tests",
110+
"summary": "Associated files have not been changed so this can be skipped"
111+
},
103112
"conclusion": "success"
104113
}' \
105114
--fail
@@ -115,6 +124,10 @@ jobs:
115124
--data '{
116125
"name": "Python Tests",
117126
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
127+
"output": {
128+
"title": "Required Checks Hack / Python Tests",
129+
"summary": "Associated files have not been changed so this can be skipped"
130+
},
118131
"conclusion": "success"
119132
}' \
120133
--fail
@@ -130,6 +143,10 @@ jobs:
130143
--data '{
131144
"name": "APIX Tests",
132145
"head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
146+
"output": {
147+
"title": "Required Checks Hack / APIX Tests",
148+
"summary": "Associated files have not been changed so this can be skipped"
149+
},
133150
"conclusion": "success"
134151
}' \
135152
--fail

.github/workflows/tssdk-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ jobs:
118118
os:
119119
- ubuntu
120120
looker:
121-
- '21_12'
122-
- '21_16'
123121
- '21_18'
124122
- '21_20'
123+
- '22_0'
125124

126125
steps:
127126
- name: Repo Checkout

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ These API-specific files still use all the same Run-Time Library (RTL) code in t
5050
Please review the following table for a breakdown of the options to initialize the desired SDK object.
5151

5252
| SDK | API 3.1 | API 4.0 | Notes |
53-
| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
53+
| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5454
| [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 |
5555
| [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. |
5656
| [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 |
57-
| [Swift](swift/looker) | Not applicable | `Looker40SDK()` | Swift only has SDK definitions for API 4.0 | |
58-
| [Look#](csharp) | `Looker31SDK()` | `Looker40SDK()` | Community-supported C# SDK for Looker | |
59-
| [GoLook](go) | Not applicable | `v4.NewLookerSDK()` | Community-supported GO SDK for Looker | |
57+
| [Swift](swift/looker) | Not applicable | `Looker40SDK()` | Swift only has SDK definitions for API 4.0 |
58+
| [Look#](csharp) | `Looker31SDK()` | `Looker40SDK()` | Community-supported C# SDK for Looker |
59+
| [GoLook](go) | Not applicable | `v4.NewLookerSDK()` | Community-supported GO SDK for Looker |
6060

6161
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.
6262

csharp/rtl/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public struct Constants
6161

6262
public const string DefaultApiVersion = "4.0";
6363
public const string AgentPrefix = "CS-SDK";
64-
public const string LookerVersion = "21.20";
64+
public const string LookerVersion = "22.0";
6565

6666
public const string Bearer = "Bearer";
6767
public const string LookerAppiId = "x-looker-appid";

csharp/sdk/3.1/methods.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,9 @@ public async Task<SdkResponse<string, Exception>> delete_folder(
25952595

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

66136615
/// ### Get information about all spaces.
66146616
///
6615-
/// In API 3.x, this will not return empty personal spaces, unless they belong to the calling user.
6617+
/// In API 3.x, this will not return empty personal spaces, unless they belong to the calling user,
6618+
/// or if they contain soft-deleted content.
6619+
///
66166620
/// In API 4.0+, all personal spaces will be returned.
66176621
///
66186622
/// GET /spaces -> SpaceBase[]

0 commit comments

Comments
 (0)