From 80debdbde1b46e0233c19221ab2dc3ad5c1fc1fe Mon Sep 17 00:00:00 2001 From: Brian Peiris Date: Mon, 29 Nov 2021 11:25:25 -0500 Subject: [PATCH 1/3] update public token for whats new page --- .env.defaults | 2 +- .env.prod | 2 +- webpack.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.defaults b/.env.defaults index 94fae334..2d582de1 100644 --- a/.env.defaults +++ b/.env.defaults @@ -17,5 +17,5 @@ NON_CORS_PROXY_DOMAINS="hubs.local,localhost" CORS_PROXY_SERVER="hubs-proxy.com" GITHUB_ORG="mozilla" GITHUB_REPO="spoke" -GITHUB_PUBLIC_TOKEN="de8cbfb4cc0281c7b731c891df431016c29b0ace" +GITHUB_PUBLIC_TOKEN="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" IS_MOZ="false" diff --git a/.env.prod b/.env.prod index 19abe706..84f6eb77 100644 --- a/.env.prod +++ b/.env.prod @@ -6,5 +6,5 @@ NON_CORS_PROXY_DOMAINS="hubs.mozilla.com,reticulum.io" ROUTER_BASE_PATH="/spoke" GITHUB_ORG="mozilla" GITHUB_REPO="spoke" -GITHUB_PUBLIC_TOKEN="de8cbfb4cc0281c7b731c891df431016c29b0ace" +GITHUB_PUBLIC_TOKEN="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" IS_MOZ="false" diff --git a/webpack.config.js b/webpack.config.js index bfcbf514..eb3228ca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -266,7 +266,7 @@ module.exports = env => { IS_MOZ: false, GITHUB_ORG: "mozilla", GITHUB_REPO: "spoke", - GITHUB_PUBLIC_TOKEN: "de8cbfb4cc0281c7b731c891df431016c29b0ace" + GITHUB_PUBLIC_TOKEN: "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" }) ] }; From f9bc2d5473b448883ce3298bbc3acbc385b889dc Mon Sep 17 00:00:00 2001 From: Brian Peiris Date: Mon, 29 Nov 2021 11:42:21 -0500 Subject: [PATCH 2/3] switch to ordering whats new entries by created_at instead of updated_at --- src/ui/whats-new/whats-new-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/whats-new/whats-new-utils.js b/src/ui/whats-new/whats-new-utils.js index a0944c76..68192534 100644 --- a/src/ui/whats-new/whats-new-utils.js +++ b/src/ui/whats-new/whats-new-utils.js @@ -25,7 +25,7 @@ export async function* getUpdates(perPage = 30) { const query = `query { repository(owner: "${process.env.GITHUB_ORG}", name: "${process.env.GITHUB_REPO}") { - pullRequests(labels: ["whats new"], states: [MERGED], first: ${perPage}, orderBy: { field: UPDATED_AT, direction: DESC }${cursorStr}) { + pullRequests(labels: ["whats new"], states: [MERGED], first: ${perPage}, orderBy: { field: CREATED_AT, direction: DESC }${cursorStr}) { edges { node { title From 916f79cd9d4eeda0f526a44091cb9bafd695e3f8 Mon Sep 17 00:00:00 2001 From: Brian Peiris Date: Mon, 29 Nov 2021 11:55:12 -0500 Subject: [PATCH 3/3] obfuscate token to avoid github revoking it automatically --- .env.defaults | 2 +- .env.prod | 2 +- src/ui/whats-new/whats-new-utils.js | 2 +- webpack.config.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.defaults b/.env.defaults index 2d582de1..58f7c8a4 100644 --- a/.env.defaults +++ b/.env.defaults @@ -17,5 +17,5 @@ NON_CORS_PROXY_DOMAINS="hubs.local,localhost" CORS_PROXY_SERVER="hubs-proxy.com" GITHUB_ORG="mozilla" GITHUB_REPO="spoke" -GITHUB_PUBLIC_TOKEN="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" +GITHUB_PUBLIC_TOKEN="ghp_SAFEPB2zzes9TEpAOSx2McNjJLQ1GXLBES2FsfWU" IS_MOZ="false" diff --git a/.env.prod b/.env.prod index 84f6eb77..be1b8d55 100644 --- a/.env.prod +++ b/.env.prod @@ -6,5 +6,5 @@ NON_CORS_PROXY_DOMAINS="hubs.mozilla.com,reticulum.io" ROUTER_BASE_PATH="/spoke" GITHUB_ORG="mozilla" GITHUB_REPO="spoke" -GITHUB_PUBLIC_TOKEN="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" +GITHUB_PUBLIC_TOKEN="ghp_SAFEPB2zzes9TEpAOSx2McNjJLQ1GXLBES2FsfWU" IS_MOZ="false" diff --git a/src/ui/whats-new/whats-new-utils.js b/src/ui/whats-new/whats-new-utils.js index 68192534..38bc0f0b 100644 --- a/src/ui/whats-new/whats-new-utils.js +++ b/src/ui/whats-new/whats-new-utils.js @@ -40,7 +40,7 @@ export async function* getUpdates(perPage = 30) { }`; // Read-only, public access token. - const token = process.env.GITHUB_PUBLIC_TOKEN; + const token = process.env.GITHUB_PUBLIC_TOKEN.replace("SAFE", ""); const response = await fetch("https://api.github.com/graphql", { method: "POST", diff --git a/webpack.config.js b/webpack.config.js index eb3228ca..8e97ac2a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -266,7 +266,7 @@ module.exports = env => { IS_MOZ: false, GITHUB_ORG: "mozilla", GITHUB_REPO: "spoke", - GITHUB_PUBLIC_TOKEN: "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" + GITHUB_PUBLIC_TOKEN: "ghp_SAFEPB2zzes9TEpAOSx2McNjJLQ1GXLBES2FsfWU" }) ] };