git source: bst show --format %{source-info} crashes with BUG 'NoneType' object has no attribute 'rsplit' on untracked source

Aperta Adatta ai principianti
#110 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, python
Ambito
build-system

Direzione di ricerca

Start in buildstream_plugins/sources/git.py at _guess_version around line 1084, then reproduce the issue with the provided untracked git source and bst show target.bst --format '%{source-info}'. Ensure source-info renders when the source has no ref, with version=None or omitted, and that bst show no longer crashes.

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

Descrizione

Environment

  • BuildStream 2.7.0
  • buildstream-plugins 2.5.0 (git source)
  • Python 3.11

Steps to reproduce
Create a project with an element having a git source WITHOUT a ref(never tracked):

name: project
min-version: 2.6
element-path: elements
ref-storage: project.refs
aliases:
  my: <repo_name>
plugins:
- origin: pip
  package-name: buildstream-plugins
  sources:
  - git
kind: import
sources:
  - kind: git
    url: my:one/.git
    track: master

Run:
bst show target.bst --format '%{source-info}'

Actual result

BUG 'NoneType' object has no attribute 'rsplit'
  buildstream_plugins/sources/git.py, line 1084, in _guess_version
  main_split = string.rsplit("-g", 1)

Expected result
source-info should render (version=None or omit) without crashing —
bst show must not fail because one source is not yet tracked.

Lingua principale
Python
Stelle
8
Fork
16
Merge medio
36m
PR unite (30g)
2

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 apache/buildstream-plugins

Tutte le issue di apache/buildstream-plugins

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.