borgbackup / borgbackup/borg

CI/build should fail fast if no tags are available

Open
#7,259 8 comments 0 reactions 0 assignees View on GitHub
testsuite
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
12h 37m
Merged PRs (30d)
199

Description

This was reported a while ago... If you have a partial clone / a clone without tags / a repository that doesn't have tags, then the version file that's generated isn't compatible w/ the expectations of `version.py`:

version = '0.1.dev1+gedcff4f'

guess that is `setuptools_scm` not being able to determine the right version number.

possible reasons:
- you did not do a full git clone, but only fetched the latest state (thus it has not enough history information). a shallow clone will **not** work.
- you also need to check out the correct tag, e.g. `git checkout 1.2.0`
- the run `pip install -e .` and `borg -V` and it should tell `1.2.0`.

_Originally posted by @ThomasWaldmann in https://github.com/borgbackup/borg/issues/6510#issuecomment-1126679447_

---

Today, builds take >5 mins to fail in CI which is a lot of time for practically no benefit (you can't access the compiled content, you're just wasting GitHub resources and a build slot)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the no-tags and shallow-clone cases around `pip install -e .`, then inspect the generated version file and `version.py`. Done means CI detects unavailable tag information and fails before the five-minute build, with an actionable error instead of producing an unusable version.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.