Skip to content

TPT-4727: Fix backups attempted update on non-editable last_successful - #748

Merged
lgarber-akamai merged 1 commit into
linode:devfrom
lgarber-akamai:fix/backups-update
Oct 7, 2026
Merged

lgarber-akamai merged 1 commit into
linode:devfrom
lgarber-akamai:fix/backups-update

Conversation

@lgarber-akamai

Copy link
Copy Markdown
Contributor

📝 Description

This pull request resolves a bug that caused last_successful (read-only) to be sent along with the rest of the PUT request body when updating the backups enrollment for a Linode.

This pull request fixes this by migrating the backups field to a JSONObject with a dedicated InstanceBackupsOptions schema used for updates. To my knowledge this change is backwards compatible.

This was causing the following error in CI:

FAILED test/integration/models/linode/test_linode.py::test_update_linode_maintenance_policy - linode_api4.errors.ApiError: PUT /v4beta/linode/instances/107206511: [400] backups.last_successful: last_successful is not an editable field.

✔️ How to Test

Integration Testing

make test-int TEST_COMMAND=models/linode/test_linode.py::test_update_linode_maintenance_policy

@lgarber-akamai lgarber-akamai added the bugfix for any bug fixes in the changelog. label Oct 6, 2026
@lgarber-akamai
lgarber-akamai requested review from a team as code owners October 6, 2026 17:35
@lgarber-akamai
lgarber-akamai requested review from jriddle-linode and mawilk90 and removed request for a team October 6, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused change uses the existing serialization mechanism, has regression coverage, and has no unresolved findings.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Linode instance updates sending read-only backup fields, such as last_successful, in PUT requests.

Changes:

  • Adds structured backup models with a dedicated update schema.
  • Preserves explicit null values for unset backup schedules.
  • Extends fixtures and regression tests for backup parsing and serialization.
File Description
test/​unit/​objects/​linode_test.py Tests backup models and disabled-backup serialization.
test/​fixtures/​linode_instances.json Adds read-only backup fields to fixture data.
linode_api4/​objects/​linode.py Introduces backup models and limits serialized update fields.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yec-akamai yec-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests passed locally!

@lgarber-akamai
lgarber-akamai merged commit fbab7ef into linode:dev Oct 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix for any bug fixes in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants