GitVersion unable to work with remote reference and needs local copy of branches

Aperta
#2,921 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, git
Ambito
devtools, release

Direzione di ricerca

Inizia con i passaggi per riprodurre il problema usando un repository in cui develop è stato eliminato localmente mentre esiste ancora nel remoto, quindi esamina gli entry point che determinano le informazioni sul branch e sulla versione di GitVersion. Il lavoro è completato quando un feature branch può risolvere la cronologia di develop e produrre la versione prevista 1.2.0-version-test.1+## senza scaricare localmente ogni branch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature

Currently the GitVersion to support gitflow requires all the branches to be local in-order to get the correct version. This is not an issue when working on individual dev machines, but when you start using them with centralized build tool like Jenkins etc., downloading all the branches into the container becomes a challenge. As it takes lots of disk space and time (depends on how clean the graph is, i.e. people remove unwanted feature branches with discipline). My company build pipeline do not download all the branches and thus versioning breaks.

Expected Behavior

Let refer to a simple example, where master is tagged at 1.1.0

  • a commit on develop branch and build creates a version 1.2.0-alpha.#
  • a feature branch "version_test" created from develop, with commit and build should give version 1.2.0-version-test.1+##

Actual Behavior

A feature branch "version_test" created from develop, with commit and build gives version 1.1.0-version-test.1+##
The reason is the develop branch is not downloaded in to the build pipeline container, as it only gets master and "version_test" branch.

Possible Fix

If GitVersion is able to get the information from the remote repository instead dependent on branches available it would resolve the issue.

Steps to Reproduce

  1. create a simple repo with spring boot samples
  2. tag the master with 1.1.0
  3. create develop and make a commit , creating the version "Major": 1, "Minor": 2, "Patch": 0,
  4. create a feature branch "feature/version_test" and make a commit.
  5. gitversion will show a version "Major": 1, "Minor": 2, "Patch": 0,
  6. delete the develop branch from local
  7. gitversion will show a version "Major": 1, "Minor": 1, "Patch": 0,

Context

Since due to limited space for the build container, the build pipeline cannot download all the branches. This is limiting us to make the use of this wonderful tool. Only teams in our company that uses Mainline branch strategy are able to use this tool while projects that uses gitflow have to continue manually control their versions.

Your Environment

All environments

  • Version Used: 5.8.1
  • Operating System and version (Windows 10, Ubuntu 18.04): all
  • Link to your project: cannot due to confidentiality
  • Link to your CI build (if appropriate): NA
Lingua principale
C#
Stelle
3.1k
Fork
661
Merge medio
7h 4m
PR unite (30g)
77

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GitTools/GitVersion

Tutte le issue di GitTools/GitVersion

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.