Comments (17)
Thanks for reporting this.
By any chance, does git fetch --unshallow
work?
from cloud-builders.
I believe I may have a corrupted repo in GH. I will confirm and close if so
from cloud-builders.
This does seem to be a problem specifically with a) the commands the Builder uses to initiate the repo combined with b) Google Source Repository.
After running the commands locally listed here, running git fetch --unshallow
:
- Works fine if
$REMOTE
is the GitHub repo - Breaks with the commands above if
$REMOTE
is the Google hosted repo
This seems to only occur if there are many tags - when I remove all but the latest tag, this works fine.
But at the moment Google Source Repository + Google Cloud Builder isn't usable for us
from cloud-builders.
FYI this is still a breaking issue - latest build-id if anyone is on these: 1be7d2d4-651c-44d6-8d06-d1dabb782514
from cloud-builders.
--unshallow
does seem to work! Thank you
Closing this for now
from cloud-builders.
Is this thread saying that:
- name: gcr.io/cloud-builders/git
args: [fetch, --unshallow]
Should work? Is it supposed to work with github triggered builds? I am still getting "did not send all necessary objects" with that.
Our release versions are based on the latest tag + commit info and the git info a build currently has is not enough for it to pick up the latest tag, so like git describe --tags --long
fails.
from cloud-builders.
And while args: [fetch]
does work to fetch all the branches. The HEAD
must still detached because describe continues to fail.
from cloud-builders.
It worked in one instance
Do you want to open a new issue given you can repro? Or maintainers: feel free to open this for tracking
from cloud-builders.
I figured I'd check if i understood this issue before opening a new one, though it is the same issue I believe, so maybe reopening makes more sense?
from cloud-builders.
It is extra weird since it worked once. I created a new trigger on a branch cloudbuild-test
and added a step after the fetch
that does ['checkout', 'develop']
and that build was able to build the version based on the latest tag, like a git describe --tags --long
. But when I do the same checkout from a trigger on the develop
branch it is again detached.
from cloud-builders.
One thing to check is whether it works on GitHub based repos. You can repro the steps with the link above
from cloud-builders.
Do you know what it will set to $REV
? Does it use the branch name or does github send the latest commit ref from the branch in the trigger?
from cloud-builders.
Do you know what it will set to $REV? Does it use the branch name or does github send the latest commit ref from the branch in the trigger?
Fair question; I'm not sure
from cloud-builders.
Just bumping this, as nothing seems to work for me. Our use case is similar, on our build pipeline we would like to get some git history/reflog to see what needs rebuilding from a monorepo with several services, but even after --unshallow
, git reflog show $BRANCH_NAME --pretty='%h'
or git reflog show origin/$BRANCH_NAME --pretty='%h'
both show only the latest commit.
from cloud-builders.
This GitHub issue tracker is intended for bugs with the officially supported builder images specifically.
Please report issues and feature requests regarding the GCB service to our public issue tracker at
https://issuetracker.google.com/issues/new?component=190802&template=1162743
from cloud-builders.
When I tried adding the fetch
step for my Github repo, I got this error from Cloud Build: fatal: could not read Username for 'https://github.com': No such device or address
I was able to get it to work following these docs: "Accessing GitHub from a build via SSH keys " (linked from "Including the repository history in a build").
Steps from the docs that I followed exactly:
- enabled Secret Manager
- generated a new ssh keypair: added private key as a Secret Manager secret, added public key to my Github profile
- granted Secret Manager access to the Cloud Build service account
- added step to
cloudbuild.yaml
config for setting up ssh private key andknown_hosts
file
I deviated from the docs for the other part of the "Configure the build" section, though. The steps in the docs are for making a new clone of the repo, but I just wanted to extend the history of the shallow clone I already had. So, instead of the git clone
step, I added this step:
- id: 'fetch more history'
name: gcr.io/cloud-builders/git
entrypoint: bash
args:
- -c
- |
git remote set-url origin '[email protected]:<GITHUB_USERNAME>/<GITHUB_REPO>'
git fetch --depth=300
volumes:
- name: 'ssh'
path: /root/.ssh
Sorry for bumping this old issue, but hope this helps someone who stumbled upon this issue while searching like I did!
from cloud-builders.
To report an issue with the hosted Google Cloud Build service, please report it to your Google Cloud Support team or use the public issue tracker at
https://issuetracker.google.com/issues/new?component=190802&template=1162743.
from cloud-builders.
Related Issues (20)
- Running container on GCP instance via GirLab
- [BUG] Java Builder doc currently recommends openjdk (DEPRECATED) should recommend Temurin HOT 1
- Docker build squash HOT 1
- [BUG] Bazel image missing `python3-distutils`
- [BUG] kubectl - memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused HOT 3
- [FR] xp.zen.one.zip.MAXFIELD.dev.GT.snapdragon.K3M.oxford.USNRx.fugk.ZoeOzone.ZOZANZI.xia.xiu.BuGzLoPœvzg.opus.hummingbird.circa.VELOTRIX.sexpixel.clarity.verity 609 https://t.co/gadgetgreen
- [BUG] Recent commit for 'latest' tag was a breaking change for many
- [BUG] Latest gcloud image throws (AttributeError): 'bool' object has no attribute 'lower' HOT 2
- [BUG] Cloud Build Error
- [BUG] npm 9.7.0 HOT 2
- Docs refer to stale bazel-provided images, new images aren't compatible with Cloud Build HOT 2
- [BUG] gke-deploy generated files fail deployment HOT 2
- yarn image has outdated node versions
- [FR] Add labels to cloud-builder images
- [BUG] gke-deploy does not respect the declared ApiVersion
- How to pass credentials to GKE-DEPLOY HOT 1
- [FR] Update Bazel to 7.x HOT 2
- [FR] Remove mandatory dependence on gsutil HOT 1
- [BUG] kubectl builder finds wrong context when executed in parallel HOT 1
- [BUG] `/gke-deploy: No such file or directory` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-builders.