Releases clear the dev VersionSuffix in Directory.Build.props

Abierto
#5,922 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, github

Línea de trabajo

Start with Directory.Build.props and compare how the VersionSuffix condition is written with the behavior described for Craft's setMsBuildVersion in src/utils/versionPatterns.ts and readXmlTag in src/targets/nuget.ts. Check the proposed conditional element against Craft's version bump and version reading behavior, including the alternative of changing Craft. Done means non-Release builds retain the dev suffix after releases while Release builds and CI package versions remain unaffected.

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

Descripción

State: Needs Discussion

Every release now clears the dev version suffix that non-Release builds get. The 6.13.0 release commit (e80b26ecc) did this on main:

   <PropertyGroup Condition="'$(Configuration)' != 'Release' And '$(VersionSuffix)' == ''">
-    <VersionSuffix>dev</VersionSuffix>
+    <VersionSuffix></VersionSuffix>
   </PropertyGroup>

Since then, Debug builds of main are versioned 6.13.0 instead of 6.13.0-dev, so they look the same as the published release. Release builds aren't affected, and neither is anything CI packs or publishes.

Cause

Craft's MSBuild version bump clears every <VersionSuffix> in a file that has a <VersionPrefix>, so that MSBuild can't append it to the new version. See setMsBuildVersion in src/utils/versionPatterns.ts, added in getsentry/craft#955 on 2 November. It doesn't see that ours only applies outside Release builds. 7.0.0-rc.3 was cut before that change, which is why it kept the suffix. It will happen on every release from now on, including 7.0.0.

version7 still has dev. It was restored when main was merged into it in #5920. But the 7.0.0 release will clear it there, and craft then merges that into main.

Possible fix

Craft's regexes only match a bare <VersionSuffix> tag, both when it clears the suffix and when it reads the current version (readXmlTag in src/targets/nuget.ts). Moving the condition onto the element itself takes it out of craft's reach:

<VersionSuffix Condition="'$(Configuration)' != 'Release' And '$(VersionSuffix)' == ''">dev</VersionSuffix>

This depends on craft's regex rather than on documented behaviour. The alternative is asking craft to leave conditional suffixes alone.

#skip-changelog

Lenguaje dominante
C#
Estrellas
775
Forks
262
Merge medio
1 d 16 h
PR fusionados (30 d)
118

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-dotnet

Todos los issues de getsentry/sentry-dotnet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.