fix(tier-check): count an SDK release in the 24h before a spec release as tracking it (#458)

Lockstep SDKs publish in the hours before the spec release is tagged
(for 2026-07-28: python-sdk 3h early, go-sdk 3.5h, typescript-sdk the
evening before), so "first SDK release at or after the spec" read them
as not having released and would fail them 30 days later. Allow a 24h
lead.
This commit is contained in:
Max 2026-08-17 11:35:02 +01:00 • committed by GitHub
commit 74edef34d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,10 @@
import { Octokit } from '@octokit/rest';
import { SpecTrackingResult } from '../types';
// Lockstep SDKs publish in the hours before the spec release is tagged;
// a release up to this long before it counts as the release for that spec.
const LEAD_MS = 24 * 60 * 60 * 1000;
export async function checkSpecTracking(
octokit: Octokit,
owner: string,
@ -38,7 +42,7 @@ export async function checkSpecTracking(
// Reverse so oldest-first, then find the FIRST SDK release after the spec
const oldestFirst = [...nonDraftSdkReleases].reverse();
const firstSdkAfterSpec = oldestFirst.find(
(r) => new Date(r.published_at!) >= specDate
(r) => new Date(r.published_at!).getTime() >= specDate.getTime() - LEAD_MS
);
if (!firstSdkAfterSpec) {