Skip to content

Commit

Permalink
refactor: Update patch to include logs for potential google-cloud wri…
Browse files Browse the repository at this point in the history
…te errors (LLC-1266) (#814)
  • Loading branch information
lucuilearningpool authored Jul 7, 2021
1 parent 124464c commit 206f700
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
32 changes: 25 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- run:
name: Installing Dependencies
command: yarn install --ignore-engines --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
key: v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- run:
name: Compiling Code
command: yarn build
Expand Down Expand Up @@ -56,9 +59,12 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- restore_cache:
keys:
- dist-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -90,9 +96,12 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- restore_cache:
keys:
- dist-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -132,9 +141,12 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- restore_cache:
keys:
- dist-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -171,9 +183,12 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- restore_cache:
keys:
- dist-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -201,9 +216,12 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
version: 19.03.13
- run:
name: Create hash for patches folder contents
command: cat patches/* | md5sum > patches.hash
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}
- restore_cache:
keys:
- dist-{{ .Branch }}-{{ .Revision }}
Expand Down
26 changes: 25 additions & 1 deletion patches/@google-cloud+common+3.6.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/@google-cloud/common/build/src/util.js b/node_modules/@google-cloud/common/build/src/util.js
index 4860a5d..022210e 100644
index 4860a5d..e910bb3 100644
--- a/node_modules/@google-cloud/common/build/src/util.js
+++ b/node_modules/@google-cloud/common/build/src/util.js
@@ -49,8 +49,12 @@ class ApiError extends Error {
Expand All @@ -15,3 +15,27 @@ index 4860a5d..022210e 100644
}
catch (e) {
this.errors = errorBody.errors;
@@ -214,6 +218,7 @@ class Util {
const writeStream = new ProgressStream();
writeStream.on('progress', evt => dup.emit('progress', evt));
dup.setWritable(writeStream);
+ console.log("makeWritableStream: dup setWritable writeStream");
const defaultReqOpts = {
method: 'POST',
qs: {
@@ -238,6 +243,7 @@ class Util {
options.makeAuthenticatedRequest(reqOpts, {
onAuthenticated(err, authenticatedReqOpts) {
if (err) {
+ console.log("makeWritableStream: onAuthenticated error", err);
dup.destroy(err);
return;
}
@@ -245,6 +251,7 @@ class Util {
request(authenticatedReqOpts, (err, resp, body) => {
util.handleResp(err, resp, body, (err, data) => {
if (err) {
+ console.log("makeWritableStream: onAuthenticated handleResponse error", err);
dup.destroy(err);
return;
}

0 comments on commit 206f700

Please sign in to comment.