Baseline "expires" date takes effect at UTC midnight, not on the local day

Abierto
#198 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend, testing

Línea de trabajo

Read internal/finding/baseline.go around expired and check how the engine clock is supplied in internal/engine/run.go and internal/engine/scaffold.go. Choose and document one expiry time zone in docs/ci.md, then add a fixed-clock test in a non-UTC zone for the boundary. Run make test-short (or .\make.ps1 test-short on Windows) and make lint; done when the test pins the chosen rule and the docs explain it.

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

Descripción

bug good first issue severity: low

Summary

A baseline entry's expiry date is parsed as midnight UTC and compared with the current instant, so west of UTC the entry stops accepting on the evening before the date written. The docs name no time zone.

Where

  • internal/finding/baseline.go:50-55 (expired)
  • internal/engine/run.go:122, internal/engine/scaffold.go:34 (engine clock)
  • docs/ci.md:182 ("from that day on it accepts nothing")

Details

expired parses the date with time.Parse(time.DateOnly, e.Expires) and returns !now.Before(d); now is time.Now by default.

Impact

At UTC-8 an entry expires at 16:00 on the previous day, so a local scan or pre-commit hook fails the gate a day early; east of UTC it keeps accepting for the first hours of the expiry day. CI runners in UTC behave as documented, so the same baseline can pass in CI and fail locally on the same evening.

Suggested fix

Decide the rule and state it. Either compare calendar days in one zone (now.UTC().Format(time.DateOnly) >= e.Expires, and say "UTC" in docs/ci.md), or parse the date in the local zone with time.ParseInLocation.

Acceptance criteria

  • The rule is one of the two above and docs/ci.md states it
  • A test with a fixed clock in a non-UTC zone pins the boundary

Related: #81

Getting started

  • Relevant files: docs/ci.md, internal/engine/run.go, internal/finding/baseline.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/finding/baseline.go|BaselineEntry.expired

Lenguaje dominante
Go
Estrellas
0
Forks
1
Merge medio
8 h 14 min
PR fusionados (30 d)
3

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 TMHSDigital/Spackle

Todos los issues de TMHSDigital/Spackle

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.