TPT-4576: add 'When' field to AccountMaintenance struct - #1015
Merged
zliang-akamai merged 3 commits intoJul 29, 2026
Merged
Conversation
zliang-akamai
requested review from
jriddle-linode and
mawilk90
and removed request for
a team
July 28, 2026 19:05
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reintroduces the When timestamp on AccountMaintenance responses, ensuring the client can parse the API’s when field and that unit fixtures/tests validate the behavior.
Changes:
- Added
When *time.TimetoAccountMaintenanceand wired it into the customUnmarshalJSON. - Updated the unit fixture JSON to include the
whenfield for each maintenance record. - Extended the unit test to assert
Whenis present and correctly parsed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
account_maintenance.go |
Adds When and parses it from the API payload via parseabletime. |
test/unit/fixtures/account_maintenance_list.json |
Adds when values to fixture data used by unit tests. |
test/unit/account_maintenance_test.go |
Validates When is unmarshaled and matches expected RFC3339 timestamps. |
Comments suppressed due to low confidence (1)
test/unit/account_maintenance_test.go:58
assert.NotNildoes not stop the test, somaintenances[1].When.Format(...)can still panic ifWhenis nil. Guard theFormatcall (or switch torequire.NotNil).
assert.NotNil(t, maintenances[1].When)
assert.Equal(t, "2025-03-25T11:00:00Z", maintenances[1].When.Format(time.RFC3339))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ezilber-akamai
approved these changes
Jul 28, 2026
zliang-akamai
force-pushed
the
zhiwei/account-maintenance-add-when
branch
from
July 28, 2026 19:17
8b58fde to
792c2c4
Compare
mawilk90
approved these changes
Jul 29, 2026
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
Add
Whenback in AccountMaintenance.✔️ How to Test
Unit testing only, see CI for the result.