Skip to content

feat: Add ArchivedAt field to Organization struct#4179

Merged
gmlewis merged 2 commits intogoogle:masterfrom
MichaelSp:feat/organization-archived-at
Apr 24, 2026
Merged

feat: Add ArchivedAt field to Organization struct#4179
gmlewis merged 2 commits intogoogle:masterfrom
MichaelSp:feat/organization-archived-at

Conversation

@MichaelSp
Copy link
Copy Markdown
Contributor

Summary

The GitHub REST API has supported organization archiving since September 2023. The GET /orgs/{org} endpoint returns an archived_at timestamp field that is non-null when the org has been archived, but the Organization struct does not map this field.

This PR adds ArchivedAt *Timestamp to the Organization struct so callers can detect archived organizations without resorting to a raw HTTP request and a hand-rolled struct.

Changes

  • github/orgs.go: add ArchivedAt *Timestamp \json:"archived_at,omitempty"`toOrganization`
  • github/github-accessors.go: generated GetArchivedAt() accessor
  • github/github-accessors_test.go: generated TestOrganization_GetArchivedAt test

All files generated via go generate ./github/....

References

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 24, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.70%. Comparing base (0f881f5) to head (ca1dadf).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4179      +/-   ##
==========================================
+ Coverage   93.20%   93.70%   +0.50%     
==========================================
  Files         210      210              
  Lines       24622    19745    -4877     
==========================================
- Hits        22948    18502    -4446     
+ Misses       1478     1047     -431     
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Run `go generate ./...` to add ArchivedAt to TestOrganization_String,
fixing the check-generated CI check.
@gmlewis gmlewis changed the title feat: add ArchivedAt field to Organization struct feat: Add ArchivedAt field to Organization struct Apr 24, 2026
Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @MichaelSp!
LGTM.
Merging.

@gmlewis gmlewis merged commit f12c950 into google:master Apr 24, 2026
10 checks passed
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.

2 participants