Skip to content

Martin/qos/fix key plan modifiers#234

Draft
surminus wants to merge 2 commits intomainfrom
martin/qos/fix-key-plan-modifiers
Draft

Martin/qos/fix key plan modifiers#234
surminus wants to merge 2 commits intomainfrom
martin/qos/fix-key-plan-modifiers

Conversation

@surminus
Copy link
Copy Markdown
Contributor

opening a draft for tests to run

martin-ably and others added 2 commits April 14, 2026 09:42
…I responses

This should result in the TF provider being a little more resistant to
upstream field changes.
The `status` and `created` fields on ably_api_key are purely computed,
server-owned values. They were using DefaultInt64Attribute(0) as a plan
modifier, which is meant for Optional+Computed fields where you want a
sensible default when the user doesn't provide a value.

This worked before 787fffc because the old modifier logic had an early
return when PlanValue was unknown, which is exactly what happens for a
computed field on create. The reconciliation commit rewrote the modifier
to remove that guard, so it now actively sets the plan value to 0. The
API then returns the real timestamp, and Terraform sees 0 vs 1776... and
throws "Provider produced inconsistent result after apply".

Replacing with int64planmodifier.UseStateForUnknown(), which is the
correct modifier for computed-only fields. On create it leaves the value
as unknown (Terraform accepts any value filling in an unknown), and on
update it carries forward the existing state. This is the same pattern
already used for the `key` field on the same resource.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf630db7-839f-4519-bf46-420f19358f91

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch martin/qos/fix-key-plan-modifiers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants