Skip to content

feat: add datalab integration#3841

Open
sbx0r wants to merge 13 commits intoscaleway:mainfrom
cloudaura-io:feat/datalab-integration
Open

feat: add datalab integration#3841
sbx0r wants to merge 13 commits intoscaleway:mainfrom
cloudaura-io:feat/datalab-integration

Conversation

@sbx0r
Copy link
Copy Markdown

@sbx0r sbx0r commented Mar 26, 2026

What's inside:

  • scaleway_datalab resource - create, read, update, and delete Datalab instances
  • scaleway_datalab data source - look up a single Datalab by ID or name
  • scaleway_datalabs data source - list and filter Datalabs by name or tags
  • Acceptance tests with cassette recordings for all resources and data sources
  • Test sweeper for cleanup
  • Shared FlattenFrameworkStringValue and FlattenFrameworkStringList helpers for null-safe state handling
  • FrameworkValidateEnum helper for Plugin Framework schema validation

Caution

blocked by scaleway/scaleway-sdk-go#3002.

@sbx0r sbx0r requested a review from remyleone as a code owner March 26, 2026 12:27
@sbx0r sbx0r changed the title Feat/datalab integration feat: add datalab integration Mar 26, 2026
@sbx0r sbx0r force-pushed the feat/datalab-integration branch from ab0ce3f to 15964bd Compare March 26, 2026 12:33

func (d *DatalabDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a description here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added


func (d *DatalabsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a description here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added

listReq.Page = &page
listReq.PageSize = &pageSize

listResp, listErr := d.api.ListDatalabs(listReq, scw.WithContext(ctx))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you have a scw.WithAllPages(ctx) to use.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

replaced


func (r *DatalabResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a description here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added

"description": schema.StringAttribute{
Optional: true,
Computed: true,
Default: stringdefault.StaticString(""),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is it required?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

you're right. removed it

resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), regional.NewIDString(region, id))...)
}

func (r *DatalabResource) resolveRegion(regionAttr types.String) (scw.Region, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this be extracted in a dedicated function for all resources? I would not like to have to repeat this function for each resource.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

extracted

return "", errors.New("region is required; set it on the resource or configure a default region on the provider")
}

func (r *DatalabResource) resolveProjectID(projectIDAttr types.String) (string, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this be extracted in a dedicated function for all resources? I would not like to have to repeat this function for each resource.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

extracted.

Thanks for your review

@sbx0r sbx0r force-pushed the feat/datalab-integration branch from c8de803 to 5113f70 Compare April 1, 2026 09:12
@sbx0r sbx0r requested a review from remyleone April 1, 2026 09:13
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