Skip to content

fix: Improve ok() helper function #1542

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

Merged
merged 2 commits into from
Dec 9, 2024
Merged

fix: Improve ok() helper function #1542

merged 2 commits into from
Dec 9, 2024

Conversation

haywood
Copy link
Collaborator

@haywood haywood commented Dec 3, 2024

I'm hesitant to change this function too much, since we don't know what kind of odd dependencies on its current behavior might exist. However, adding exception chaining and surfacing the original error message seems like a risk worth taking.

  • Eliminate duplicated version in AuthSession by delegating to a shared implementation defined on the SDKResponse companion object.

  • For the SDKError case:

    • Set Error.message from SDKError.message
    • Set Error.casue from SDKError.cause
  • Also ran ktlint -F on the files I changed so that gradle check would pass the linting stage

  • Also added kotlin-ci.yml to run ./gradlew jar on kotlin changes

Fixes #1539 🦕

- Eliminate duplicated version in AuthSession by delegating to a shared
  implementation defined on the SDKResponse companion object.

- For the SDKError case:
  - Set Error.message from SDKError.message
  - Set Error.casue from SDKError.cause
@haywood haywood force-pushed the haywood-improve-ok branch 6 times, most recently from 897905d to 608e1b5 Compare December 3, 2024 12:37
@haywood haywood marked this pull request as ready for review December 3, 2024 12:41
@haywood haywood requested a review from a team as a code owner December 3, 2024 12:41
@haywood haywood force-pushed the haywood-improve-ok branch 2 times, most recently from ad3f8e1 to 82c583b Compare December 3, 2024 12:51
@haywood haywood force-pushed the haywood-improve-ok branch from 82c583b to af708e2 Compare December 3, 2024 12:51
Copy link
Collaborator

@drstrangelooker drstrangelooker left a comment

Choose a reason for hiding this comment

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

Looks LGTM To Me

@haywood haywood merged commit 7b15f90 into main Dec 9, 2024
13 checks passed
@haywood haywood deleted the haywood-improve-ok branch December 9, 2024 14:40
drstrangelooker added a commit that referenced this pull request Jan 13, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>@looker/api-explorer: 0.9.71</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.37 to 0.1.38
    * @looker/extension-utils bumped from 0.1.47 to 0.1.48
    * @looker/run-it bumped from 0.9.70 to 0.9.71
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk-codegen bumped from 21.9.6 to 21.9.7
  * devDependencies
    * @looker/sdk-codegen-scripts bumped from 21.5.27 to 21.5.28
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/code-editor: 0.1.38</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @looker/sdk-codegen bumped from 21.9.6 to 21.9.7
</details>

<details><summary>@looker/extension-api-explorer: 22.21.28</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/api-explorer bumped from 0.9.70 to 0.9.71
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/extension-sdk-react bumped from 24.20.0 to 25.0.0
    * @looker/extension-utils bumped from 0.1.47 to 0.1.48
    * @looker/run-it bumped from 0.9.70 to 0.9.71
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk-codegen bumped from 21.9.6 to 21.9.7
</details>

<details><summary>@looker/extension-playground: 1.0.28</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/extension-sdk-react bumped from 24.20.0 to 25.0.0
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/extension-tile-playground: 1.1.15</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/extension-sdk-react bumped from 24.20.0 to 25.0.0
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/extension-utils: 0.1.48</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.37 to 0.1.38
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/extension-sdk-react bumped from 24.20.0 to 25.0.0
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/hackathon: 22.21.30</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.37 to 0.1.38
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/extension-sdk-react bumped from 24.20.0 to 25.0.0
    * @looker/extension-utils bumped from 0.1.47 to 0.1.48
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/wholly-artifact bumped from 0.1.28 to 0.1.29
</details>

<details><summary>@looker/run-it: 0.9.71</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.37 to 0.1.38
    * @looker/extension-utils bumped from 0.1.47 to 0.1.48
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk-codegen bumped from 21.9.6 to 21.9.7
    * @looker/sdk-codegen-utils bumped from 21.0.17 to 21.0.18
</details>

<details><summary>@looker/sdk-codegen: 21.9.7</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @looker/sdk-codegen-utils bumped from 21.0.17 to 21.0.18
</details>

<details><summary>@looker/sdk-codegen-scripts: 21.5.28</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk-codegen bumped from 21.9.6 to 21.9.7
    * @looker/sdk-codegen-utils bumped from 21.0.17 to 21.0.18
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/sdk-codegen-utils: 21.0.18</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/wholly-artifact: 0.1.29</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
  * devDependencies
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>@looker/wholly-sheet: 0.5.67</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
  * devDependencies
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>sdk-codegen-all: 25.0.0</summary>

##
[25.0.0](sdk-codegen-all-v24.20.1...sdk-codegen-all-v25.0.0)
(2025-01-13)


### Features

* generate SDKs for Looker 25.0
([#1558](#1558))
([56502e5](56502e5))


### Bug Fixes

* Improve ok() helper function
([#1542](#1542))
([7b15f90](7b15f90))
</details>

<details><summary>looker_sdk: 25.0.0</summary>

##
[25.0.0](looker_sdk-v24.20.0...looker_sdk-v25.0.0)
(2025-01-13)


### Features

* generate SDKs for Looker 25.0
([#1558](#1558))
([56502e5](56502e5))
</details>

<details><summary>embed-components: 25.0.0</summary>

##
[25.0.0](embed-components-v24.20.0...embed-components-v25.0.0)
(2025-01-13)


### Miscellaneous Chores

* **embed-components:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/embed-services bumped from 24.20.0 to 25.0.0
    * @looker/sdk bumped from 24.20.0 to 25.0.0
  * devDependencies
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>embed-services: 25.0.0</summary>

##
[25.0.0](embed-services-v24.20.0...embed-services-v25.0.0)
(2025-01-13)


### Miscellaneous Chores

* **embed-services:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
  * devDependencies
    * @looker/sdk-node bumped from 24.20.0 to 25.0.0
</details>

<details><summary>extension-sdk: 25.0.0</summary>

##
[25.0.0](extension-sdk-v24.20.0...extension-sdk-v25.0.0)
(2025-01-13)


### Miscellaneous Chores

* **extension-sdk:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

<details><summary>extension-sdk-react: 25.0.0</summary>

##
[25.0.0](extension-sdk-react-v24.20.0...extension-sdk-react-v25.0.0)
(2025-01-13)


### Miscellaneous Chores

* **extension-sdk-react:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 24.20.0 to 25.0.0
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

<details><summary>sdk: 25.0.0</summary>

##
[25.0.0](sdk-v24.20.0...sdk-v25.0.0)
(2025-01-13)


### Features

* generate SDKs for Looker 25.0
([#1558](#1558))
([56502e5](56502e5))
</details>

<details><summary>sdk-node: 25.0.0</summary>

##
[25.0.0](sdk-node-v24.20.0...sdk-node-v25.0.0)
(2025-01-13)


### Miscellaneous Chores

* **sdk-node:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 24.20.0 to 25.0.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Mike DeAngelo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The SDK does not handle error conditions properly
2 participants