Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f14703f
Add cloudbuild.yaml
danieljbruce May 6, 2026
248638f
Shorten the script
danieljbruce May 6, 2026
cdb2ad1
remove the timeout
danieljbruce May 6, 2026
372a03b
feat: add new Bigtable feature
danieljbruce May 6, 2026
7caf8a0
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 6, 2026
55b0dec
Merge branch 'main' into migrate-bigtable-to-gcp-cloud-build
danieljbruce May 6, 2026
7a3fadd
Merge branch 'main' into migrate-bigtable-to-gcp-cloud-build
danieljbruce May 6, 2026
5f930f9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 6, 2026
f3772ea
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
gcf-owl-bot[bot] May 6, 2026
83f73dd
feat: add new Bigtable feature
danieljbruce May 6, 2026
d7782b2
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 6, 2026
6be7893
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 6, 2026
1f71bd1
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
gcf-owl-bot[bot] May 6, 2026
e6cc411
Changed to `ubuntu` in the yaml file
danieljbruce May 6, 2026
c836303
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 6, 2026
1ab42bc
change the dir to handwritten/bigtable
danieljbruce May 6, 2026
8e6ff1d
Change the pre-system test script
danieljbruce May 7, 2026
051f019
Fix the unique id error
danieljbruce May 7, 2026
20b11db
Add pre system tests to the first step
danieljbruce May 7, 2026
a74e61e
Remove the comment changed to
danieljbruce May 7, 2026
0aae31a
Eliminate the first pack and play error
danieljbruce May 8, 2026
af443d1
Fix `require` error with node dependencies
danieljbruce May 8, 2026
57bbdad
Modify the pack and play tests by adding a header
danieljbruce May 8, 2026
f6d43fe
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 8, 2026
8dd7d70
Eliminate unnecessary comments
danieljbruce May 8, 2026
fd18c1a
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 8, 2026
bfe5155
Restore the system test script
danieljbruce May 8, 2026
e51a2e8
Increase the timeout to 3 hours for the system tes
danieljbruce May 8, 2026
11f861b
Merge branch 'main' into migrate-bigtable-to-gcp-cloud-build
danieljbruce May 8, 2026
88a19c7
Add dependency comment
danieljbruce May 8, 2026
c6a65a8
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 11, 2026
83539cc
Do a conditional diff check
danieljbruce May 11, 2026
9f6587c
check against main removed
danieljbruce May 11, 2026
9916905
Add a comment about the packnplay tests
danieljbruce May 11, 2026
3ce9c3f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 11, 2026
45420f8
pin the node version
danieljbruce May 11, 2026
206070f
Apply suggestions from code review
danieljbruce May 12, 2026
93476ce
Change all node runs to node 24
danieljbruce May 12, 2026
b8599b8
Fix the install script to use cjs
danieljbruce May 12, 2026
34475c4
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 12, 2026
9fcae3c
Remove initial step for checking the diff
danieljbruce May 12, 2026
11f52d2
Remove workspace check and presystem-test
danieljbruce May 12, 2026
ae907a5
Merge branch 'migrate-bigtable-to-gcp-cloud-build' of https://github.…
danieljbruce May 12, 2026
f786ec8
Merge branch 'main' of https://github.com/googleapis/google-cloud-nod…
danieljbruce May 12, 2026
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
Prev Previous commit
Next Next commit
Do a conditional diff check
  • Loading branch information
danieljbruce committed May 11, 2026
commit 83539cc0291314096a9dc9bc628f671e6df58819
34 changes: 32 additions & 2 deletions handwritten/bigtable/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
steps:
# 0. Check for changes in handwritten/bigtable
- name: 'gcr.io/cloud-builders/git'
id: 'check-changes'
entrypoint: 'bash'
args:
- '-c'
- |
git fetch origin main --quiet
# If on a branch, compare with origin/main. If on main, compare with previous commit.
DIFF_RANGE="origin/main..."
if [ "$(git rev-parse HEAD)" == "$(git rev-parse origin/main)" ]; then
DIFF_RANGE="HEAD~1..HEAD"
fi
if git diff --quiet "$DIFF_RANGE" -- . ; then
echo "No changes in handwritten/bigtable. Skipping tests."
echo "skip" > /workspace/skip_tests
else
echo "Changes detected in handwritten/bigtable. Proceeding with tests."
fi
dir: 'handwritten/bigtable'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this step at all since GCB can configure when to run based on change detection? When this config enabled it should only run if there are changes in this directory in the first place, right?

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. In which case, I think we can also remove waitFor: ['check-changes'] which was added earlier because of this step


# 1. Set up Node.js environment
- name: 'gcr.io/cloud-builders/npm'
entrypoint: 'bash'
args:
- '-c'
- |
if [ -f /workspace/skip_tests ]; then exit 0; fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just terminate the workflow early? Do we have to guard every step? I am not sure how to do this, but I suspect this has to be a built in feature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gemini-code-assist implement this suggestion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Google Cloud Build, there is no native 'early exit' or 'skip all' command that can terminate the entire build pipeline from a single step. The approach of using a sentinel file (like /workspace/skip_tests) to guard subsequent steps is the standard, idiomatic way to implement conditional execution in GCB. While it requires a check in each step, it ensures that the build pipeline remains predictable and that each step can explicitly decide whether to run or exit gracefully.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll go with gemini's suggestion on this one. I actually tried to remove this step a day ago, but gemini cli combined all these configs into one config which I didn't want so I abandoned this change. I guess it did it because the configs don't support an early exit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we can remove this now that we removed the first step and we are not writing to workspace/skip_tests anymore.

npm install -g npm@latest
npm config set prefix /usr/local
npm install
npm run presystem-test
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may get executed twice. I think NPM will automatically execute the pre* commands on run? Can you verify?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true. It does so I think we can remove this.

dir: 'handwritten/bigtable'
id: 'install-dependencies'
waitFor: ['check-changes']

# 2. Configure environment variables for the tests and run system tests
# - GOOGLE_APPLICATION_CREDENTIALS: GCB steps run as a service account
Expand All @@ -22,14 +45,19 @@ steps:
# the GCB service account's inherent permissions.
# - GCLOUD_PROJECT: Can be passed as a build variable.
- name: 'gcr.io/cloud-builders/npm'
entrypoint: 'npm'
args: ['run', 'system-test']
entrypoint: 'bash'
args:
- '-c'
- |
if [ -f /workspace/skip_tests ]; then exit 0; fi
npm run system-test
dir: 'handwritten/bigtable'
env:
- 'GCLOUD_PROJECT=${_GCP_PROJECT_ID}' # Pass project ID via build variable
# If you need specific credentials from Secret Manager, uncomment these:
# - 'GOOGLE_APPLICATION_CREDENTIALS=/secrets/sa-key.json'
id: 'run-system-tests'
waitFor: ['install-dependencies']
# For Secret Manager, uncomment these (adjust secret name and volume path as needed):
# secretEnv: ['SA_KEY']
# volumes:
Expand All @@ -42,6 +70,7 @@ steps:
args:
- '-c'
- |
if [ -f /workspace/skip_tests ]; then exit 0; fi
# Check if nyc is installed and run report
if [ -f ./node_modules/nyc/bin/nyc.js ]; then
./node_modules/nyc/bin/nyc.js report || true # `|| true` prevents build failure if nyc report itself exits non-zero
Expand All @@ -57,6 +86,7 @@ steps:
echo "Codecov reporting (if desired) would be integrated here."
dir: 'handwritten/bigtable'
id: 'coverage-report'
waitFor: ['run-system-tests']

# If you use Secret Manager for credentials, uncomment and configure:
# availableSecrets:
Expand Down
Loading