apache / apache/buildstream-plugins

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

Abierto Apto para principiantes
#110 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
8
Forks
16
Merge medio
36 min
PR fusionados (30 d)
2

Descripción

**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):
``` project.con
name: project
min-version: 2.6
element-path: elements
ref-storage: project.refs
aliases:
my:
plugins:
- origin: pip
package-name: buildstream-plugins
sources:
- git
```

```elements/target.bst
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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, python
Área
build-system
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
88/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.