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

Ouverte
#198 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
82/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
backend, testing

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Go
Étoiles
0
Forks
1
Merge moyen
8 h 14 min
PR mergées (30 j)
3

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Spackle

Toutes les issues de TMHSDigital/Spackle

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.