Skip to content

Commit 3405d1d

Browse files
authored
Merge pull request #39 from cloudgraphdev/beta
Release 0.39.0
2 parents 7bc70eb + 4495957 commit 3405d1d

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [0.39.0-beta.1](https://github.com/cloudgraphdev/cloudgraph-provider-gcp/compare/0.38.0...0.39.0-beta.1) (2023-07-19)
2+
3+
4+
### Features
5+
6+
* collect provider errors ([c39093a](https://github.com/cloudgraphdev/cloudgraph-provider-gcp/commit/c39093ab6cb78c07ed60d365b2071d94b366cad8))
7+
8+
# [0.39.0-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-gcp/compare/0.38.0...0.39.0-alpha.1) (2023-07-19)
9+
10+
11+
### Features
12+
13+
* collect provider errors ([c39093a](https://github.com/cloudgraphdev/cloudgraph-provider-gcp/commit/c39093ab6cb78c07ed60d365b2071d94b366cad8))
14+
115
# [0.38.0](https://github.com/cloudgraphdev/cloudgraph-provider-gcp/compare/0.37.2...0.38.0) (2023-05-16)
216

317

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudgraph/cg-provider-gcp",
3-
"version": "0.38.0",
3+
"version": "0.39.0-beta.1",
44
"description": "CloudGraph provider plugin for GCP used to fetch GCP cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",
@@ -31,7 +31,7 @@
3131
"terraform:cleanup": "rimraf ./tests/terraform/{.terraform,.terraform.lock.hcl,tfplan} ./tests/terraform/*.{tfstate,tfplan,backup}"
3232
},
3333
"dependencies": {
34-
"@cloudgraph/sdk": "0.22.1",
34+
"@cloudgraph/sdk": "0.23.0",
3535
"@google-cloud/access-approval": "^2.1.2",
3636
"@google-cloud/api-gateway": "^1.2.1",
3737
"@google-cloud/asset": "^3.22.0",

src/services/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import services from '../enums/services'
1818
import { GcpBilling, GcpCredentials, rawDataInterface } from '../types'
1919
import { DEFAULT_REGION, DEFAULT_RESOURCES } from '../config/constants'
2020
import relations from '../enums/relations'
21+
import { getAllProviderErrors } from '../utils'
2122

2223
export const enums = {
2324
services,
@@ -142,7 +143,8 @@ export default class Provider extends CloudGraph.Client {
142143
const { addBillingConfig } = await this.interface.prompt([
143144
{
144145
type: 'confirm',
145-
message: 'Do you want to configure export cloud Billing data to BigQuery?',
146+
message:
147+
'Do you want to configure export cloud Billing data to BigQuery?',
146148
name: 'addBillingConfig',
147149
default: true,
148150
},
@@ -525,6 +527,7 @@ export default class Provider extends CloudGraph.Client {
525527
}
526528
}
527529

530+
result.errors = getAllProviderErrors()
528531
return result
529532
}
530533
}

src/utils/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import CloudGraph from '@cloudgraph/sdk'
2+
import { ProviderError } from '@cloudgraph/sdk/dist/src/types'
23
import environment from '../config/environment'
34

45
const { logger } = CloudGraph
@@ -14,6 +15,12 @@ export function initTestEndpoint(service?: string): string | undefined {
1415
return endpoint
1516
}
1617

18+
const errorsHistory: ProviderError[] = []
19+
20+
export function getAllProviderErrors(): ProviderError[] {
21+
return errorsHistory
22+
}
23+
1724
export function generateGcpErrorLog(
1825
service: string,
1926
functionName: string,
@@ -23,4 +30,10 @@ export function generateGcpErrorLog(
2330
`There was a problem getting data for service ${service}, CG encountered an error calling ${functionName}`
2431
)
2532
logger.debug(err.message)
33+
34+
errorsHistory.push({
35+
service,
36+
function: functionName,
37+
message: err?.message,
38+
})
2639
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@
598598
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
599599
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
600600

601-
"@cloudgraph/sdk@0.22.1":
602-
version "0.22.1"
603-
resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.22.1.tgz#bf5c2f263df17b085147a3ca234ac5b0a8806545"
604-
integrity sha512-aMrnoTRRIODAVvgtmqGZPB7Z8x1kMgKjFtLjpiHa121o0GCEZCjbxDmU8T3DwmRwI1u4QD5iKbXf9dB0573mJA==
601+
"@cloudgraph/sdk@0.23.0":
602+
version "0.23.0"
603+
resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.23.0.tgz#3f6012c0e3573f527da27ebcccb8841bbeffd21b"
604+
integrity sha512-c+Ozu8yLK3RlAcKy4d0fdTQc9JkdUJ2ESmrcW7oC5XdIARrDWQ5+Kr8AGPABOK1/UYtFyVR2JmUHnoSJdGAv6Q==
605605
dependencies:
606606
"@graphql-tools/load-files" "^6.5.3"
607607
"@graphql-tools/merge" "^8.2.1"

0 commit comments

Comments
 (0)