feat(client): remove gitHash from api requests (#51083)

pull/51085/head
Oliver Eyton-Williams 2023-07-28 20:35:41 +02:00 committed by GitHub
parent 5b641241ad
commit f91b5841d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 12 deletions

View File

@ -10,7 +10,7 @@ import type {
User
} from '../redux/prop-types';
const { apiLocation, gitHash } = envData;
const { apiLocation } = envData;
const base = apiLocation;
@ -177,7 +177,7 @@ export function getUserProfile(
username: string
): Promise<ResponseWithData<UserProfileResponse>> {
const responseWithData = get<{ entities?: ApiUser; result?: string }>(
`/api/users/get-public-profile?username=${username}&githash=${gitHash}`
`/api/users/get-public-profile?username=${username}`
);
return responseWithData.then(({ response, data }) => {
const { result, user } = parseApiResponseToClientUser({

View File

@ -1,5 +1,4 @@
const path = require('path');
const { execSync } = require('child_process');
const envPath = path.resolve(__dirname, '../.env');
const { error } = require('dotenv').config({ path: envPath });
@ -48,10 +47,6 @@ const locations = {
: radioLocation
};
// This is used to identify the current deployment and is trimmed to remove
// the trailing newline.
const gitHash = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
module.exports = Object.assign(locations, {
clientLocale,
curriculumLocale,
@ -87,6 +82,5 @@ module.exports = Object.assign(locations, {
growthbookUri:
!growthbookUri || growthbookUri === 'api_URI_from_Growthbook_dashboard'
? null
: growthbookUri,
gitHash
: growthbookUri
});

View File

@ -57,15 +57,13 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
const loggingKeys = ['sentryClientDSN'];
const abTestingKeys = ['growthbookUri'];
const diagnosticKeys = ['gitHash'];
const expectedVariables = locationKeys.concat(
deploymentKeys,
searchKeys,
donationKeys,
loggingKeys,
abTestingKeys,
diagnosticKeys
abTestingKeys
);
const actualVariables = Object.keys(env as Record<string, unknown>);
if (expectedVariables.length !== actualVariables.length) {