urbangrammarai / gee_pipeline

Pipeline for retrieving imagery from Google Earth Engine
MIT License
1 stars 0 forks source link

Function `get_tags()` fails when run from a clone without that git history present #19

Closed andrewphilipsmith closed 2 years ago

andrewphilipsmith commented 2 years ago

How to reproduce

1). Make a shallow clone of the git repo:

$ mkdir gee_temp_clone
$ cd gee_temp_clone
$ git init .
$ git remote add origin https://github.com/urbangrammarai/gee_pipeline
$ git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin

2). Run a unit test which

$ pytest pyveg/tests/test_combiner_modules.py::test_combine

Expect behaviour

The function pyveg/src/file_utils.py::get_tags() should produce a meaningful version string, when operating without a full git clone.

Actual behaviour

The function pyveg/src/file_utils.py::get_tags(), calls the subprocess git describe --tags. This generates the error message (sterr): fatal: No names found, cannot describe anything.

The function pyveg/src/file_utils.py::get_tags() returns an empty string.

Note:

The scenario occurs when running testing in GitHub Actions, where shallow clones are the default.

andrewphilipsmith commented 2 years ago

At present, the test pyveg/tests/test_combiner_modules.py::test_combine is skipped on CI, but runs locally. When this issue is fixed, this test should be re-enabled on CI.

andrewphilipsmith commented 2 years ago

This issue has been moved to the upstream repo https://github.com/alan-turing-institute/monitoring-ecosystem-resilience/issues/492