Skip to content

Conversation

@tomatobet
Copy link

Add a resource and a datasource to manage public cloud projects

@tomatobet tomatobet requested review from unshade and yyewolf November 13, 2025 14:10
@tomatobet tomatobet self-assigned this Nov 13, 2025
@tomatobet tomatobet added the awaiting api changes This issue is awaiting changes from the API label Nov 13, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
20.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@yyewolf yyewolf marked this pull request as draft November 13, 2025 14:11
@github-actions
Copy link
Contributor

Pure Unit test coverage

File Coverage
All files 2%
internal/apis/client.go 0%
internal/apis/project/implementation/client.go 0%
internal/apis/project/implementation/client.go 0%
internal/services/project/project_data_source.go 0%
internal/services/project/project_data_source.go 0%
internal/services/project/project_resource.go 0%
internal/services/project/project_resource.go 0%
internal/services/project/project_resource.go 0%
internal/services/project/register.go 0%
main.go 0%

Minimum allowed coverage is 0%

Generated by 🐒 cobertura-action against 0ab76ea

@github-actions
Copy link
Contributor

Global test coverage

File Coverage
All files 38%
internal/apis/client.go 38%
internal/apis/project/implementation/client.go 0%
internal/apis/project/implementation/client.go 0%
internal/services/project/project_data_source.go 78%
internal/services/project/project_resource.go 50%
internal/services/project/project_resource.go 0%
main.go 86%

Minimum allowed coverage is 10%

Generated by 🐒 cobertura-action against 0ab76ea

@github-actions
Copy link
Contributor

📊 Test Reports Available

🔍 Unit Test Results: View Detailed Report

🔍 Acceptance Mocked Test Results: View Detailed Report

📦 Download archive test reports to see details

Comment on lines +27 to +31
data "infomaniak_project" "create_project" {
public_cloud_id = var.infomaniak.cloud_id
id = var.infomaniak.project_id
}
*/
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can delete this if it not used

token = var.infomaniak.token
}

resource "infomaniak_project" "create_project" {
Copy link
Member

Choose a reason for hiding this comment

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

maybe rename the resource name "infomaniak_public_cloud_project". "infomaniak_project" is not very explicit

Kaas kaas.Api
Domain domain.Api
DBaas dbaas.Api
Project project.Api
Copy link
Member

Choose a reason for hiding this comment

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

Same for variables and package, maybe something where we understand it is a public cloud project

r.client = client
}

func (r *projectDataSource) Schema(ctx context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
Copy link
Member

Choose a reason for hiding this comment

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

Now we put schemas inside separates files named xxx_schema.go. You can see an example on dbaas PR

r.client = client
}

func (r *projectResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, we now put schema in a separate file

@unshade
Copy link
Member

unshade commented Nov 13, 2025

Really nice PR, it's really cool to be able to manage public cloud projects directly from terraform !

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

Labels

awaiting api changes This issue is awaiting changes from the API held back

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants