Skip to content

Explain canonical project import IDs - #101

Merged
IlyaasK merged 1 commit into
mainfrom
hypeship/project-import-canonical-id-hint
Jul 29, 2026
Merged

Explain canonical project import IDs#101
IlyaasK merged 1 commit into
mainfrom
hypeship/project-import-canonical-id-hint

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • identify both Kernel's canonical project ID and Terraform's current state ID
  • explain recovery when a project was imported by name
  • preserve the existing identity-mismatch guard instead of silently retargeting state
  • cover the imported-name lookup and complete diagnostic in focused tests

Why

Kernel project GET accepts an ID or name, but Terraform import requires a stable
canonical ID. Importing by name can therefore resolve successfully and then hit
the provider's identity-mismatch guard. The diagnostic now reports the canonical
ID and explains how to import it.

This is a provider-only usability change. It does not require an API or SDK
change and does not expand the project resource contract.

Terraform semantics

  • no remote mutation is added
  • no state ID is rewritten automatically
  • the existing Read diagnostic path preserves prior state
  • canonical-ID imports continue to settle through Read

Tests run

  • gofmt -l cmd internal
  • go test -short -timeout=2m ./internal/resources/project
  • go test -race -short -timeout=2m ./internal/resources/project
  • go test -short -timeout=2m ./...
  • go vet ./...
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • git diff --check origin/main...HEAD

Acceptance tests were not run because the change only affects a deterministic
local diagnostic and adds no live API behavior.

Intentionally unchanged

  • no API or SDK changes
  • no permissive name-based import support
  • no automatic state removal or identity migration
  • no runtime or session operations

@IlyaasK
IlyaasK marked this pull request as ready for review July 13, 2026 14:19
@IlyaasK
IlyaasK force-pushed the hypeship/api-key-data-source branch from 8aee855 to 5b55393 Compare July 13, 2026 14:32
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch 2 times, most recently from 4da6ba5 to a869ccc Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/api-key-data-source branch from 3f5505e to d88ea70 Compare July 20, 2026 19:38
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch from a869ccc to 1530b0b Compare July 20, 2026 19:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1530b0b. Configure here.

Comment thread internal/resources/project/resource.go
@IlyaasK
IlyaasK force-pushed the hypeship/api-key-data-source branch from d88ea70 to f5cd0ba Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch from 1530b0b to b555444 Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/api-key-data-source branch from f5cd0ba to bdfc3de Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch 2 times, most recently from a9f9b05 to 5bff054 Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/api-key-data-source branch from 099bdff to f3c4de0 Compare July 21, 2026 20:15
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch from 5bff054 to 3eadb5e Compare July 21, 2026 20:15
@IlyaasK
IlyaasK requested a review from Sayan- July 23, 2026 13:36
Make project read identity mismatches tell users how to recover from a name-based import without silently changing Terraform state. Exercise the imported-name lookup and canonical-ID guidance in the focused read test.
@IlyaasK
IlyaasK removed the request for review from Sayan- July 27, 2026 18:24
@IlyaasK
IlyaasK changed the base branch from hypeship/api-key-data-source to main July 27, 2026 18:24
@IlyaasK
IlyaasK force-pushed the hypeship/project-import-canonical-id-hint branch from 3eadb5e to 2a1b98a Compare July 27, 2026 18:25
@IlyaasK
IlyaasK requested a review from Sayan- July 27, 2026 18:30
@IlyaasK
IlyaasK merged commit e4a3e79 into main Jul 29, 2026
2 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