feat: add relative timestamps to preview deploy comments#98
Merged
Conversation
Preview deploymenthttps://6b994107.tinney-dev.pages.dev ( Previous previews
|
- store sha in metadata comment instead of parsing markdown link out of regex - cap previous-previews list at 10 entries to prevent unbounded growth - use Intl.RelativeTimeFormat for relative time strings - extract MARKER and MAX_PREVIOUS_ENTRIES constants - defensive per_page: 100 on listComments
4606bb2 to
775bac2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a relative timestamp (e.g.
just now,5 min ago,2 hr ago,3 days ago) to each preview URL line in the Cloudflare Pages preview comment. Each entry now reads asURL (SHA) · relative-time.The ISO timestamp is stored inline as a hidden HTML comment (
<!-- ts:... -->) so it survives across comment updates. On every new deploy, all previous-preview relative times are recomputed from their stored ISO timestamps so they stay accurate as the PR progresses.Testing
just nowand prior entries were re-rendered with correctly updated relative times while URLs/SHAs were preserved.pnpm format:check,pnpm lint,pnpm typecheckpass.