Skip to content

Add project UTC offset support for rendered timestamps and expiration messages#36142

Merged
pelikhan merged 9 commits into
mainfrom
copilot/add-optional-utc-field
May 31, 2026
Merged

Add project UTC offset support for rendered timestamps and expiration messages#36142
pelikhan merged 9 commits into
mainfrom
copilot/add-optional-utc-field

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

This adds a project-level UTC offset setting so rendered times use a consistent home offset instead of the runner’s local clock. The offset can come from .github/workflows/aw.json or an enterprise default variable, with repo config taking precedence.

  • Config surface

    • Add optional utc to .github/workflows/aw.json
    • Validate the value as a numeric UTC offset during repo config load
    • Extend repo config schema to document and accept the new field
  • Enterprise default

    • Add GH_AW_DEFAULT_UTC as the enterprise-level fallback
    • Wire it into gh aw env via default_utc
  • Rendering behavior

    • Resolve the project UTC offset at CLI startup
    • Apply it to rendered time.Time values across console/table output
    • Apply the same offset in JavaScript expiration rendering, including expiration footer lines and expired issue, pull request, and discussion closing messages
    • Display timestamps using numeric UTC offsets only
  • Precedence

    • Use aw.json.utc when present
    • Fall back to GH_AW_DEFAULT_UTC otherwise
    • Leave existing formatting unchanged when neither is configured

Example:

// .github/workflows/aw.json
{
  "utc": "-08:00"
}
# gh aw env defaults file
default_utc: +00:00

Copilot AI and others added 3 commits May 31, 2026 16:29
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add project timezone support for rendered times Add project timezone support for rendered CLI timestamps May 31, 2026
Copilot AI requested a review from pelikhan May 31, 2026 16:44
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot apply timezone in JavaScript as well for expiration message.

Copilot AI and others added 2 commits May 31, 2026 17:07
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot apply timezone in JavaScript as well for expiration message.

Fixed in 746cc5d. JavaScript expiration footers and expired issue/PR/discussion closing messages now honor the configured project timezone, with .github/workflows/aw.json taking precedence over GH_AW_DEFAULT_UTC.

Copilot AI changed the title Add project timezone support for rendered CLI timestamps Add project timezone support for rendered timestamps and expiration messages May 31, 2026
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot do not use named timezones, only numbers. Avoid any geopolitical reference in source code

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot do not use named timezones, only numbers. Avoid any geopolitical reference in source code

Addressed in 0d3e7ba. The project time override now uses numeric UTC offsets only (for example -08:00), and the Go/JavaScript rendering and validation paths no longer rely on named timezones.

Copilot AI changed the title Add project timezone support for rendered timestamps and expiration messages Add project UTC offset support for rendered timestamps and expiration messages May 31, 2026
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot set gh-aw (this repo) utc to pacific time

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot set gh-aw (this repo) utc to pacific time

Done in e06cc21. This repo’s / .github/workflows/aw.json now sets "utc": "-08:00" so gh-aw uses a Pacific numeric UTC offset for its own rendered timestamps and expiration messaging.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot ensure that expiration JavaScript parsing is still operational.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot ensure that expiration JavaScript parsing is still operational.

Done in 50310dd. Added a focused JS regression test that generates an expiration line with repo utc: "-08:00" and verifies extractExpirationDate() still parses the original ISO expiration timestamp correctly.

@pelikhan pelikhan marked this pull request as ready for review May 31, 2026 18:12
Copilot AI review requested due to automatic review settings May 31, 2026 18:12
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot use skill to merge main

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot use skill to merge main

Merged latest main into this branch using the skill-driven workflow in commit 7f44360.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions github-actions Bot mentioned this pull request May 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Request a fresh review run.

Generated by 👨‍🍳 PR Sous Chef · gpt54 13.2M ·

@pelikhan pelikhan merged commit ecca252 into main May 31, 2026
@pelikhan pelikhan deleted the copilot/add-optional-utc-field branch May 31, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants