Rollingback de way to bring back the package version
Signed-off-by: armandocomellas1 <cgarmando@google.com>
This commit is contained in:
@@ -17,9 +17,7 @@
|
||||
import { GcpApi } from './GcpApi';
|
||||
import { Operation, Project } from './types';
|
||||
import { OAuthApi } from '@backstage/core-plugin-api';
|
||||
import packageVers from '../../package.json';
|
||||
|
||||
const { version } = packageVers;
|
||||
import packageinfo from '../../package.json';
|
||||
|
||||
const BASE_URL =
|
||||
'https://content-cloudresourcemanager.googleapis.com/v1/projects';
|
||||
@@ -33,7 +31,7 @@ export class GcpClient implements GcpApi {
|
||||
headers: {
|
||||
Accept: '*/*',
|
||||
Authorization: `Bearer ${await this.getToken()}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${version}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${packageinfo.version}`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -52,7 +50,7 @@ export class GcpClient implements GcpApi {
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${await this.getToken()}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${version}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${packageinfo.version}`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -79,7 +77,7 @@ export class GcpClient implements GcpApi {
|
||||
headers: {
|
||||
Accept: '*/*',
|
||||
Authorization: `Bearer ${await this.getToken()}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${version}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${packageinfo.version}`,
|
||||
},
|
||||
body: JSON.stringify(newProject),
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('gcp-projects', () => {
|
||||
const response: any = {
|
||||
headers: {
|
||||
Accept: '*/*',
|
||||
'X-Goog-Api-Client': `backstage/cloudbuild/${packageinfo.version}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${packageinfo.version}`,
|
||||
},
|
||||
};
|
||||
jest.spyOn(sut, 'listProjects').mockImplementation((): any => {
|
||||
@@ -44,7 +44,7 @@ describe('gcp-projects', () => {
|
||||
expect(response).toStrictEqual({
|
||||
headers: {
|
||||
Accept: '*/*',
|
||||
'X-Goog-Api-Client': `backstage/cloudbuild/${packageinfo.version}`,
|
||||
'X-Goog-Api-Client': `backstage/gcpprojects/${packageinfo.version}`,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user