[RELENG-149] tox/pre-commit failing in integration-test-tox-verify-master: failing to checkout robot-tidy repo master branch Created: 10/Jun/20  Updated: 11/Aug/20  Resolved: 11/Aug/20

Status: Closed
Project: releng
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Lowest
Reporter: Jamo Luhrsen Assignee: Thanh Ha (zxiiro)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Not sure the root cause yet, but some things I noticed.

the high level problem is saying that we can't check out 'master' branch of
the robot-tidy hook:

[INFO] Initializing environment for https://github.com/guykisel/pre-commit-robotframework-tidy.
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'checkout', 'master')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    error: pathspec 'master' did not match any file(s) known to git.
    
Check the log at /home/jenkins/.cache/pre-commit/pre-commit.log
ERROR: InvocationError for command /w/workspace/integration-test-tox-verify-master/.tox/pre-commit/bin/pre-commit run --all-files (exited with code 1)

pre-commit is installing importlib-resources which recently released 2.0.0 and that
is showing up as incompatible with the virtualenv==20.0.21 that is also installed
with pre-commit.

lftools has us locked to pre-commit==2.2.0, although a new release of that (2.5.0)
also came out this week.

I cannot reproduce this locally, so trying to figure out slowly in the sandbox.



 Comments   
Comment by Jamo Luhrsen [ 10/Jun/20 ]

We can merge https://git.opendaylight.org/gerrit/c/integration/test/+/90364 to get unblocked, but that is removing our
robot-tidy check which is really helpful to keep our code style reasonable.

Comment by Thanh Ha (zxiiro) [ 11/Jun/20 ]

Resolved with https://git.opendaylight.org/gerrit/c/integration/test/+/90393. Not sure why 'master' keeps failing but workaround this by pinning a specific hash id instead. Very strange... It's like the upstream repo is broken somehow when cloned via pre-commit.

Comment by Jamo Luhrsen [ 11/Jun/20 ]

ok, workaround is merged. I re-opened this, assigned to me and marked it with lowest priority. At some point in the future
I'll likely come across this open ticket again and I can try to change the robot-tidy-pre-commit repo back to master to see
if it works. this is a very weird issue. weird that it just started happening too.

Comment by Jamo Luhrsen [ 11/Jun/20 ]

Something has changed somewhere in our environment that is breaking pre-commit when it tries to 'git checkout master' on some
repos. The exact problem for that is not known, but we are using a 7+ year old version of git on these build VMs. If we upgrade to
version XXX, the problem is fixed. here is a log of the job working. you can see some steps in there to upgrade git, although I guess
the proper fix is to get this upgraded and baked in to the build VM to start with.

https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/builder-copy-sandbox-logs/783/console-timestamp.log.gz

Comment by Jamo Luhrsen [ 11/Jun/20 ]

abelur do you know how we can get git upgraded in our centos7 build systems that run these tox verify jobs?

Comment by Thanh Ha (zxiiro) [ 12/Jun/20 ]

Proposed a fix in common-packer https://gerrit.linuxfoundation.org/infra/c/releng/common-packer/+/64261

It appears LF scripts were trying to get an up to date Git however failed to install due to package name change in IUS repo.

Comment by Thanh Ha (zxiiro) [ 11/Aug/20 ]

This is fixed at this point.

Generated at Wed Feb 07 20:37:36 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.