Skip to content

Commit df40441

Browse files
authored
fix: use new CDN for errorcodes repository (#1320)
* fix: use new Looker content CDN for errorcodes * remove deprecated function calls * remove misleading /live/ path from test samples
1 parent 6eedf6f commit df40441

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

kotlin/src/main/com/looker/rtl/Constants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ class DelimArray<T> : Array<T>() {
6161
*/
6262

6363
fun isTrue(value: String?): Boolean {
64-
val low = unQuote(value?.toLowerCase())
64+
val low = unQuote(value?.lowercase())
6565
return low == "true" || low == "1" || low == "t" || low == "y" || low == "yes"
6666
}
6767

6868
fun isFalse(value: String?): Boolean {
69-
val low = unQuote(value?.toLowerCase())
69+
val low = unQuote(value?.lowercase())
7070
return low == "false" || low == "0" || low == "f" || low == "n" || low == "no"
7171
}
7272

kotlin/src/main/com/looker/rtl/ErrorDoc.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ typealias ErrorCodeIndex = HashMap<String, ErrorDocItem>
109109
class ErrorDoc(val sdk: APIMethods, val cdnUrl: String = ErrorCodesUrl): IErrorDoc {
110110
companion object {
111111
/** Location of the public CDN for Looker API Error codes */
112-
const val ErrorCodesUrl = "https://marketplace-api.looker.com/errorcodes/"
112+
const val ErrorCodesUrl = "https://static-a.cdn.looker.app/errorcodes/"
113113

114114
/** Default "not found" content for error documents that don't (yet) exist */
115115
const val ErrorDocNotFound = "### No documentation found for "

kotlin/src/test/TestErrorDoc.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class TestErrorDoc {
106106
assertEquals("login", errDoc.methodName("/login_404.md"))
107107
assertEquals("login_2", errDoc.methodName("/login_2_404.md"))
108108
assertEquals("and_another", errDoc.methodName("/and_another_404.md"))
109-
assertEquals("login", errDoc.methodName("errorcodes/live/login_404.md"))
110-
assertEquals("login", errDoc.methodName("https://foo.bar.com/live/login_404.md"))
109+
assertEquals("login", errDoc.methodName("errorcodes/login_404.md"))
110+
assertEquals("login", errDoc.methodName("https://foo.bar.com/login_404.md"))
111111
}
112112
}

packages/extension-api-explorer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The API Explorer extension can be manually installed and run with a Looker insta
2424
use_embeds: yes
2525
use_clipboard: yes
2626
core_api_methods: ["versions", "api_spec"]
27-
external_api_urls : ["https://raw.githubusercontent.com","http://localhost:30000","https://localhost:8080","https://marketplace-api.looker.com","https://docs.looker.com","https://developer.mozilla.org/"]
27+
external_api_urls : ["https://raw.githubusercontent.com","http://localhost:30000","https://localhost:8080","https://static-a.cdn.looker.app","https://docs.looker.com","https://developer.mozilla.org/"]
2828
oauth2_urls: []
2929
}
3030
}

packages/sdk-rtl/src/errorDoc.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,8 @@ describe('ErrorDoc', () => {
221221
['login_404.md', 'login'],
222222
['login_2_404.md', 'login_2'],
223223
['and_another_404.md', 'and_another'],
224-
['errorcodes/live/login_404.md', 'login'],
225-
[
226-
'https://marketplace-api.looker.com/errorcodes/live/login_404.md',
227-
'login',
228-
],
224+
['errorcodes/login_404.md', 'login'],
225+
['https://static-a.cdn.looker.app/errorcodes/login_404.md', 'login'],
229226
])('url:"%s" should be "%s"', (url, expected) => {
230227
expect(errDoc.methodName(url)).toEqual(expected)
231228
})

packages/sdk-rtl/src/errorDoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface IErrorDocItem {
3333
}
3434

3535
/** Location of the public CDN for Looker API Error codes */
36-
export const ErrorCodesUrl = 'https://marketplace-api.looker.com/errorcodes/'
36+
export const ErrorCodesUrl = 'https://static-a.cdn.looker.app/errorcodes/'
3737

3838
/** Structure of the error code document index */
3939
export type ErrorCodeIndex = Record<string, IErrorDocItem>

0 commit comments

Comments
 (0)