apheleia-project / jbs-build-issues

0 stars 0 forks source link

ICU Deploy Failure #6

Closed rnc closed 5 months ago

rnc commented 6 months ago

While within https://jvmshield.dev/builds/build/0cf1755bf1a6b20861c11567955fc700 the build succeeds it fails to deploy with a message of

build : verify-deploy-and-check-for-contaminates] 2024-03-15 10:09:59,040 INFO  [com.red.hac.con.ana.dep.git.Git] (main) Pushing to https://gitlab.apps.sdouglas2.clusters.stonesoupengineering.com/demo/github-unicode-org-icu.git with content from /workspace/source/source (branch main, commit 5861e1fd52f1d7673eee38bc3c965aa18b336062, tag release-73-1)
[build : verify-deploy-and-check-for-contaminates] \nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n
[build : verify-deploy-and-check-for-contaminates] 2024-03-15 10:10:00,320 ERROR [com.red.hac.con.ana.dep.git.Git] (main) Caught JGit problems processing the push
[build : verify-deploy-and-check-for-contaminates] 2024-03-15 10:10:00,321 ERROR [com.red.hac.con.ana.dep.DeployCommand] (main) Deployment failed: java.lang.RuntimeException: org.eclipse.jgit.api.errors.TransportException: Rejected by "pre-push" hook.
[build : verify-deploy-and-check-for-contaminates] \nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n
[build : verify-deploy-and-check-for-contaminates] 

(from https://jvmshield.dev/api/builds/attempts/logs/6d1eda49-6165-49eb-9edb-875a6a906bcf )

Note that the build-request-processor image is built by jib and does not have auxilliary programs such as git-lfs - which is what its pre-push hook has :

!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
git lfs pre-push "$@"

So, the question is how does that git-lfs hooks get installed. I think its because the builder image has git-lfs installed in https://github.com/redhat-appstudio/jvm-build-service-builder-images/blob/main/Dockerfile.template#L28 and was added in https://github.com/redhat-appstudio/jvm-build-service-builder-images/pull/18 by @dwalluck but I don't know the history of that or any builds it relates to.

I don't know why we need git-lfs especially as we do not call any of its commands (e.g. git lfs clone) and having it installed means the hooks are created which then affects when we try to push the sources to the gitlab repository. My suggestion would be to remove git-lfs from the builder image.

ICU is using git-lfs in https://github.com/unicode-org/icu/blob/release-73-1/.gitattributes#L79

Thoughts @stuartwdouglas @dwalluck ?

stuartwdouglas commented 5 months ago

AFAIK the build fails without git lfs, but I never really liked installing it as a non-official RH package, and I really don't like that this build has random jar files in the git repo. I am happy to get rid of LFS, the solution might be to manually convert any builds we need that need LFS into another format.