Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check-commit-email: do not fail when current dir is not under git #11281

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

bboozzoo
Copy link
Collaborator

The check fails with a source tarball, like the one used during spread tests.

Error: 2022-01-21 07:44:44 Error executing google:ubuntu-20.04-64:tests/unit/go (jan210735-282406) :
-----
...
Obtaining c-dependencies
HEAD is now at 74f4fe8 Merge pull request #63 from vasi/vasi-win-ci
Checking docs
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
  File "./check-commit-email.py", line 42, in <module>
    commitrange = get_commit_range()
  File "./check-commit-email.py", line 22, in get_commit_range
    lines = subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'cat-file', '-p', '@']' returned non-zero exit status 128.

Crushing failure and despair.

The check fails with a source tarball, like the one used during spread tests.

```
Error: 2022-01-21 07:44:44 Error executing google:ubuntu-20.04-64:tests/unit/go (jan210735-282406) :
-----
...
Obtaining c-dependencies
HEAD is now at 74f4fe8 Merge pull request snapcore#63 from vasi/vasi-win-ci
Checking docs
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
  File "./check-commit-email.py", line 42, in <module>
    commitrange = get_commit_range()
  File "./check-commit-email.py", line 22, in get_commit_range
    lines = subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'cat-file', '-p', '@']' returned non-zero exit status 128.

Crushing failure and despair.
```

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@bboozzoo bboozzoo added the Simple 😃 A small PR which can be reviewed quickly label Jan 21, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #11281 (7ec49c0) into master (4e01535) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11281   +/-   ##
=======================================
  Coverage   78.24%   78.24%           
=======================================
  Files         927      927           
  Lines      105872   105872           
=======================================
+ Hits        82837    82844    +7     
+ Misses      17881    17875    -6     
+ Partials     5154     5153    -1     
Flag Coverage Δ
unittests 78.24% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
overlord/hookstate/hookmgr.go 74.67% <0.00%> (-0.65%) ⬇️
cmd/snap/cmd_debug_state.go 70.18% <0.00%> (-0.46%) ⬇️
overlord/ifacestate/helpers.go 77.45% <0.00%> (+0.48%) ⬆️
daemon/api_connections.go 93.58% <0.00%> (+1.60%) ⬆️
osutil/synctree.go 79.24% <0.00%> (+2.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e01535...7ec49c0. Read the comment docs.

Copy link
Contributor

@mardy mardy left a comment

Choose a reason for hiding this comment

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

LGTM, I guess you could add the skip-spread label too?

Copy link
Contributor

@MiguelPires MiguelPires left a comment

Choose a reason for hiding this comment

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

LGTM

@mvo5
Copy link
Contributor

mvo5 commented Jan 21, 2022

Nice catch!

@mvo5 mvo5 merged commit 60152fa into snapcore:master Jan 21, 2022
Copy link
Member

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

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

thanks for fixing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly Test Robustness
Projects
None yet
6 participants