From 4e2c09855514975b89c1ac94abd840275ef84b47 Mon Sep 17 00:00:00 2001 From: Harish V Date: Tue, 22 Aug 2023 13:53:22 +0800 Subject: [PATCH 1/2] feat: move tracked sites to env --- src/config/config.ts | 6 ++++++ src/services/api/AxiosInstance.ts | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/config/config.ts b/src/config/config.ts index 69a7548f5..2cb63b837 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -412,6 +412,12 @@ const config = convict({ format: String, default: "", }, + ggsTrackedSites: { + doc: "Comma-separated list of tracked sites for GitHub API hits", + env: "GGS_EXPERIMENTAL_TRACKING_SITES", + format: String, + default: "", + }, }, }) diff --git a/src/services/api/AxiosInstance.ts b/src/services/api/AxiosInstance.ts index 9f073395e..767f5db66 100644 --- a/src/services/api/AxiosInstance.ts +++ b/src/services/api/AxiosInstance.ts @@ -13,7 +13,9 @@ import { tokenServiceInstance } from "@services/db/TokenService" import { statsService } from "../infra/StatsService" -const GITHUB_EXPERIMENTAL_TRIAL_SITES = ["pa-corp"] +const GGS_EXPERIMENTAL_TRACKING_SITES = config + .get("featureFlags.ggsTrackedSites") + .split(",") const REPOS_SUBSTRING = "repos/isomerpages" const extractRepoNameFromGithubUrl = (url: string): string => { @@ -99,7 +101,7 @@ const githubApiInterceptor = (resp: AxiosResponse) => { const fullUrl = `${resp.config.baseURL || ""}${resp.config.url || ""}` if ( resp.status !== 304 && - _.some(GITHUB_EXPERIMENTAL_TRIAL_SITES, (site) => fullUrl.includes(site)) && + _.some(GGS_EXPERIMENTAL_TRACKING_SITES, (site) => fullUrl.includes(site)) && resp.config.method ) { statsService.incrementGithubApiCall( From 66ba5bae0d40d53aa0cd79c2000232acfaabb0ac Mon Sep 17 00:00:00 2001 From: Harish V Date: Tue, 22 Aug 2023 13:53:41 +0800 Subject: [PATCH 2/2] 0.39.1 --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2a32924..688fb7546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.39.1](https://github.com/isomerpages/isomercms-backend/compare/v0.39.0...v0.39.1) + +- feat: move tracked sites to env [`4e2c098`](https://github.com/isomerpages/isomercms-backend/commit/4e2c09855514975b89c1ac94abd840275ef84b47) + #### [v0.39.0](https://github.com/isomerpages/isomercms-backend/compare/v0.38.1...v0.39.0) +> 16 August 2023 + - fix(GGs): hotfixes from bugs identified during testing [`#903`](https://github.com/isomerpages/isomercms-backend/pull/903) - fix: require base64 [`#904`](https://github.com/isomerpages/isomercms-backend/pull/904) - fix: use synchronous fs mkdir [`#902`](https://github.com/isomerpages/isomercms-backend/pull/902) diff --git a/package-lock.json b/package-lock.json index d2ef21b59..062cc929f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "isomercms", - "version": "0.39.0", + "version": "0.39.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "isomercms", - "version": "0.39.0", + "version": "0.39.1", "dependencies": { "@aws-sdk/client-amplify": "^3.370.0", "@aws-sdk/client-cloudwatch-logs": "^3.370.0", diff --git a/package.json b/package.json index 5c696951e..0034b3007 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "isomercms", - "version": "0.39.0", + "version": "0.39.1", "private": true, "scripts": { "build": "tsc -p tsconfig.build.json",