2021-01-19T16:58:27.528Z 784f32d9-df03-522b-86b6-6a58cee71a88 ERROR RequestError [HttpError]: If you would like to help us test the Checks API during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details.
μμΈ #386
μ§κΈμ #386μΌλ‘ λλ릴 κ²μ μ μν©λλ€.
#481μ μν΄ ν΄κ²°λ¨
μ΄ μ€λ₯κ° κ³μ λ°μν©λλ€. μ΄μ #481μ΄ λ³ν©λκ³ λ°©κΈ λ¦΄λ¦¬μ€λ 0.9.0 λλ€ zipμ΄ μ μ©λ ν μ§μ λλ€λ₯Ό λ§λ€λ €κ³ νμ΅λλ€.
2021-01-21T18:33:14.240Z 66df9451-e423-5303-ab9e-ccd22f36bbf2 ERROR RequestError [HttpError]: If you would like to help us test the Checks API during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details.
at /var/task/index.js:2756:23
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
status: 415,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
'alt-svc': 'clear',
connection: 'close',
'content-length': '288',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Thu, 21 Jan 2021 18:33:14 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
status: '415 Unsupported Media Type',
'strict-transport-security': 'max-age=31536000; includeSubdomains',
via: '1.1 google',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-enterprise-version': '2.22.6',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': '197c6068-c1d5-43d2-9ed4-bb0d409b2500',
'x-ratelimit-limit': '12500',
'x-ratelimit-remaining': '12036',
'x-ratelimit-reset': '1611255703',
'x-runtime-rack': '0.038530',
'x-xss-protection': '1; mode=block'
},
request: {
method: 'GET',
url: 'https://github.example.com/api/v3/repos/acme/somerepo/check-runs/68859',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.0.12 octokit-core.js/3.2.4 Node.js/12.20.1 (linux; x64)',
authorization: 'token [REDACTED]'
},
request: { hook: [Function: bound bound register] }
},
documentation_url: 'https://docs.github.com/enterprise/2.22/rest/reference/checks#get-a-check-run'
}
server: 'GitHub.com',
μ¬μ ν Lambdasμ λν΄ μ΄μ 컀λ°μ μ¬μ©νκ³ μμ΅λλ€.
μλμ. μ¬κΈ° Githubμμ λ€μ΄λ‘λν μ μλ λλ€ v0.9.0μ μ€ννκ³ μλ€κ³ νμ ν©λλ€. server: 'GitHub.com'
ν€λλ GitHub Enterpriseμμ λ°νλ©λλ€.
무μ ν€λ μ΄μ κ° λ μ Accept: application/vnd.github.v3+json
μ¬μ ν λμ μ μ μ‘λκ³ μλ application/vnd.github.antiope-preview+json
? ghesApiUrl
λ https://github.com/philips-labs/terraform-aws-github-runner/blob/v0.9.0/modules/runners/lambdas/runners/src/scale-runners/μ μ€μ λμ΄
@buamod λμΌν server
ν€λλ₯Ό μ»μ΅λλ€. κ·Έκ² μ μμΈ κ² κ°μ£ ?
@samuelb v0.9.0 μ λν μμ μ¬νμ λν ν
μ€νΈ μμ μ λμ³€μΌλ―λ‘ λ‘컬μμ gh-auth.test.ts
L120μ μμ νμ΅λλ€.
request: mockedRequestInterface.defaults({ baseUrl: githubServerUrl, mediaType: { previews: ['antiope'] } }),
ν μ€νΈλ₯Ό ν΅κ³Όνμ΅λλ€.
λν octokitμμ λλ²κ·Έ λ₯Ό log: console,
κ° gh-auth.ts
L11 μ μ½μ
λμκ³ , μ¬μ»΄νμΌλκ³ , μ
λ‘λλμ΄ λ€μκ³Ό κ°μ΄ μμ±λμμ΅λλ€.
2021-01-22T13:33:31.960Z a3e98909-2b21-52b0-9e5c-d18dfd7d23cf DEBUG request {
method: 'GET',
baseUrl: 'https://githubtest.internal/api/v3',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.0.9 octokit-core.js/3.2.4 Node.js/12.19.0 (linux; x64)'
},
mediaType: { format: '', previews: [ 'antiope' ] },
request: { hook: [Function: bound bound register] },
url: '/repos/{owner}/{repo}/check-runs/{check_run_id}',
check_run_id: 845,
owner: 'ActionsTest',
repo: 'repo-test'
}
ν€λλ μ¬μ ν μ λ¬λμ§λ§ μ΄μ μλ‘μ΄ mediaType
κ° μ€μ λ©λλ€.
log: console,
μΆκ°νλ©΄ λ€μκ³Ό κ°μ΄ νμλ©λλ€.
021-01-22T15:15:21.285Z 68d40d07-e072-55a8-b924-55830e47ae02 DEBUG request {
method: 'GET',
baseUrl: 'https://github.example.com/api/v3',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.0.12 octokit-core.js/3.2.4 Node.js/12.20.1 (linux; x64)'
},
mediaType: { format: '', previews: [] },
request: { hook: [Function: bound bound register] },
url: '/repos/{owner}/{repo}/check-runs/{check_run_id}',
check_run_id: 69556,
owner: 'acme',
repo: 'somerepo'
}
μ΄ λ―Έλμ΄ μ νμ΄ μ€μ λμ§ μμμ΅λλ€.
λλ μ²΄ν¬ μμ μ€λ₯Έμͺ½ μ§μ μ λ λ², μΈ λ² νμΈνμ΅λλ€. λλ κ·Έκ²μ μ μ νκ² νμΈνκ³ λλ€ λ컀 μ΄λ―Έμ§ λ±μ μ κ±°νμ΅λλ€.
λ°©κΈ μ¬μ©μ μμ΄μ νΈμμ octokit-rest.js λ²μ μ΄ κ·νμ λ€λ¦ λλ€. μ΄μ μ #386μ λλ리λ κ²μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ ν κ°μ§ μ΅μ μ΄ λ κ²μ΄λΌκ³ μ μνμ΅λλ€. #481μ΄ μ€μ λ‘ κ·Έ λ¬Έμ λ₯Ό ν΄κ²°νμ§ λͺ»νλλ° octokit-rest.js/18.0.9λ₯Ό μ¬μ©νμ¬ λΉλν λ μ€μλ‘ λ¬Έμ κ° ν΄κ²°λ κ²μΌλ‘ κ°μ£Όνμ μ μμ΅λκΉ?
λ΄ λ§μ§λ§ μ»΄νμΌμ΄ μΊμλ λΌμ΄λΈλ¬λ¦¬λ₯Ό μ¬μ©νκ³ μμλ κ² κ°μ΅λλ€. λλ λΉμ κ³Ό κ°μ κ²°κ³Όλ₯Ό μ»μκ³ λ€μ μ»΄νμΌνμ΅λλ€.
μ΄ μμ μ μ μκ² ν¨κ³Όμ μ΄μμ΅λλ€.
( gh-auth.ts
L8)
export async function createOctoClient(token: string, ghesApiUrl: string = ''): Promise<Octokit> {
const ocktokitOptions: OctokitOptions = {
auth: token,
log: console,
};
if (ghesApiUrl) {
ocktokitOptions.baseUrl = ghesApiUrl;
ocktokitOptions.previews = ['antiope'];
}
return new Octokit(ocktokitOptions);
}
μ΄κ²μ΄ λλ₯Ό μν΄ μλνλμ§ νμΈν μ μμ΅λλ€ π
iff --git a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
index 01dc3cf..ae3720e 100644
--- a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
+++ b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
@@ -11,6 +11,7 @@ export async function createOctoClient(token: string, ghesApiUrl: string = ''):
};
if (ghesApiUrl) {
ocktokitOptions.baseUrl = ghesApiUrl;
+ ocktokitOptions.previews = ['antiope'];
}
return new Octokit(ocktokitOptions);
}
@@ -51,7 +52,6 @@ export async function createGithubAuth(
if (ghesApiUrl) {
authOptions.request = request.defaults({
baseUrl: ghesApiUrl,
- mediaType: { previews: ['antiope'] }
});
}
return await createAppAuth(authOptions)({ type: authType });
CloudWatchμμ:
2021-01-22T16:34:00.464Z 750ac5d2-fd1a-52ff-a26a-9d57fdbb2281 DEBUG request {
method: 'GET',
baseUrl: 'https://github.example.com/api/v3',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.0.12 octokit-core.js/3.2.4 Node.js/12.20.1 (linux; x64)'
},
mediaType: { format: '', previews: [ 'antiope' ] },
request: { hook: [Function: bound bound register] },
url: '/repos/{owner}/{repo}/check-runs/{check_run_id}',
check_run_id: 69599,
owner: 'acme',
repo: 'somerepo'
}
2021-01-22T16:34:00.841Z 750ac5d2-fd1a-52ff-a26a-9d57fdbb2281 INFO GET /repos/acme/somerepo/check-runs/69599 - 200 in 377ms
μ€ν #482
λ¦΄λ¦¬μ€ 0.9.1 μμ±
κ°μ₯ μ μ©ν λκΈ
λ¦΄λ¦¬μ€ 0.9.1 μμ±