Skip to content
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

Hotfix IS-489 0.39.1 #913

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms",
"version": "0.39.0",
"version": "0.39.1",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
Expand Down
6 changes: 6 additions & 0 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
},
},
})

Expand Down
6 changes: 4 additions & 2 deletions src/services/api/AxiosInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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(
Expand Down