Skip to content

Derive the connection data source schema from the resource - #131

Closed
prochac wants to merge 0 commit into
BetterStackHQ:mainfrom
prochac:refactor/connection-schema-derivation
Closed

Derive the connection data source schema from the resource#131
prochac wants to merge 0 commit into
BetterStackHQ:mainfrom
prochac:refactor/connection-schema-derivation

Conversation

@prochac

@prochac prochac commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on #130, merge that first. Until #130 lands, the diff and commit list
below also contain its commit. Once it merges I'll rebase this branch onto main
and force-push, leaving a single commit here.

#130 fixes the panic from #129 at the point where it blows up. This PR removes the
condition that made it possible.

The data source hand-maintained a second copy of the resource's schema and the two
had drifted. That drift is what let the shared copier reach for password on a
schema that never declared it. The data source now derives its schema from
connectionSchema, password is named once in connectionLookupOmits, and a test
pins that the copier and the schema agree, so the next attribute added to the
resource can't silently go missing from the data source.

With value preservation in one place, this also fixes a second bug: the API returns
data_region and valid_until normalized, and a data_region even when none was
configured. Both are ForceNew and neither is Computed, so any API value written
to state recreates the connection on every apply. The configured values are now
always kept, not just when set. password is unchanged in effect; only create
returns it.

πŸ€– Generated with Claude Code

@prochac
prochac force-pushed the refactor/connection-schema-derivation branch from cf2707c to 39b3494 Compare August 17, 2026 11:14
@paweljw paweljw closed this Aug 18, 2026
@paweljw
paweljw force-pushed the refactor/connection-schema-derivation branch from 39b3494 to 8926247 Compare August 18, 2026 08:55
@paweljw

paweljw commented Aug 18, 2026

Copy link
Copy Markdown
Member

merged externally - it made it's way onto main. thank you!

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