Skip to content

Commit f95d336

Browse files
chore: change version (#82)
* chore: change version * chore: change gitignore * chore: add .github stuff
1 parent e73321d commit f95d336

9 files changed

+43
-28
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @MagaluCloud/terraform-cli-devs

.github/pull_request_template.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## What does this PR do?
2+
<!-- Provide a clear and concise description of the changes -->
3+
<!--Example: This PR adds a new endpoint to the API that allows users to retrieve their order history. It includes the necessary changes to the controller, service, and repository layers, as well as updates to the API documentation. -->
4+
5+
## How Has This Been Tested?
6+
<!-- Please describe the tests you ran to verify your changes and how you tested them. Include any relevant details and evidence. -->
7+
- **Unit Tests**: Describe the unit tests you have written and their outcomes.
8+
<!-- Example: Added unit tests for the new order history endpoint. All tests passed successfully. -->
9+
10+
- **Integration Tests**: Detail the integration tests performed and their results.
11+
<!-- Example: Performed integration tests with the payment service to ensure end-to-end functionality. All tests passed. -->
12+
13+
- **Manual Testing**: Explain the manual testing process, including steps taken and evidence such as screenshots or logs.
14+
<!-- Example: Manually tested the new endpoint using Postman. Verified that the correct order history is returned for different users. Attached screenshots of the Postman results. -->
15+
16+
## Checklist
17+
- [ ] I have run Pre commit `pre-commit run --all-files`
18+
- [ ] My code follows the style guidelines of this project
19+
- [ ] I have made corresponding changes to the documentation
20+
- [ ] I have added tests that prove my fix is effective or that my feature works
21+
22+
## Screenshots/Videos
23+
<!-- If applicable, add screenshots or videos to help explain your changes -->

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ terraform.tfstate
4747
terraform.tfstate.backup
4848
terraform.tfstate.d
4949
**/__debug_bin**
50+
terraform-provider-mgc

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ module github.com/MagaluCloud/terraform-provider-mgc
33
go 1.23.0
44

55
require (
6-
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5
7-
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5
6+
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d
7+
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d
88
github.com/hashicorp/terraform-plugin-framework v1.11.0
99
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
1010
github.com/hashicorp/terraform-plugin-log v0.9.0
1111
)
1212

1313
require (
14-
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5 // indirect
14+
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d // indirect
1515
github.com/davecgh/go-spew v1.1.1 // indirect
1616
github.com/geffersonFerraz/brazilian-words-sorter v1.1.0 // indirect
1717
github.com/getkin/kin-openapi v0.118.0 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8=
66
atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
77
atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs=
88
atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU=
9-
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5 h1:OIu6Ji2nCiYZeVAIFeW6Xx1x9J3hK+9Uq/trFGsv6IY=
10-
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5/go.mod h1:h0UDw9so9zAtRrh82BB9CiR7bKwhJ/osSmbSwZWYX8I=
11-
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5 h1:pAOmHdlNvO+P/PWuGZuxMCiDBgQ6aAB2rHB87u34/dA=
12-
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5/go.mod h1:6ZrWG4JZNTU+0bW6VZnMAd1teKf4ggnDLxBaHb5QxzY=
13-
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5 h1:8gFv20lRlSUpK1UCosn+WZOiNk2kgwY0O148hBhjTdM=
14-
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5/go.mod h1:XHyD9dr46r6oQxPq5dUV6pQYxaLvioTaxka7yUhB9Ms=
9+
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d h1:JvOaCHsyhWFmHpqW9b5C1iSDx/uplXGG4bNgGQnmy+s=
10+
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d/go.mod h1:h0UDw9so9zAtRrh82BB9CiR7bKwhJ/osSmbSwZWYX8I=
11+
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d h1:TEHM4frHlV/UaicuI90+W9Mm69MC59rj0xnMbDuaFSQ=
12+
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d/go.mod h1:6ZrWG4JZNTU+0bW6VZnMAd1teKf4ggnDLxBaHb5QxzY=
13+
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d h1:adl+0gUxEFHDMuHGFE5pEWb1Ks0rSb61OmkgSCfUd5I=
14+
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d/go.mod h1:XHyD9dr46r6oQxPq5dUV6pQYxaLvioTaxka7yUhB9Ms=
1515
github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs=
1616
github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8=
1717
github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII=

goreleaser_terraform.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ builds:
1010
- arm64
1111
binary: terraform-provider-mgc
1212
ldflags:
13-
- -s -w -X github.com/MagaluCloud/magalu/sdk.Version={{.Version}}"
13+
- -s -w -X main.Version={{.Version}}"
1414
flags:
1515
- -tags=embed release
1616
main: main.go
@@ -25,7 +25,7 @@ builds:
2525
- arm64
2626
binary: terraform-provider-mgc
2727
ldflags:
28-
- -s -w -X github.com/MagaluCloud/magalu/sdk.Version={{.Version}}"
28+
- -s -w -X main.Version={{.Version}}"
2929
flags:
3030
- -tags=embed release
3131
main: main.go
@@ -53,8 +53,8 @@ archives:
5353
checksum:
5454
extra_files:
5555
- glob: "terraform-registry-manifest.json"
56-
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_manifest.json"
57-
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
56+
name_template: "terraform-provider-mgc_{{ .Version }}_manifest.json"
57+
name_template: "terraform-provider-mgc_{{ .Version }}_SHA256SUMS"
5858
algorithm: sha256
5959
signs:
6060
- artifacts: checksum
@@ -74,7 +74,7 @@ signs:
7474
release:
7575
extra_files:
7676
- glob: "terraform-registry-manifest.json"
77-
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_manifest.json"
77+
name_template: "terraform-provider-mgc_{{ .Version }}_manifest.json"
7878
draft: true
7979
prerelease: true
8080
header: |

main.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-framework/providerserver"
1010
)
1111

12-
var (
13-
// these will be set by the goreleaser configuration
14-
// to appropriate values for the compiled binary.
15-
version string = "dev"
16-
commit string = "none"
17-
date string = "unknown"
18-
)
12+
var Version string = "dev"
1913

2014
func main() {
2115
var debug bool
@@ -28,7 +22,7 @@ func main() {
2822
Debug: debug,
2923
}
3024

31-
err := providerserver.Serve(context.Background(), mgc.New(version, commit, date), opts)
25+
err := providerserver.Serve(context.Background(), mgc.New(Version), opts)
3226

3327
if err != nil {
3428
log.Fatal(err.Error())

mgc/provider.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ const providerTypeName = "mgc"
2323

2424
type mgcProvider struct {
2525
version string
26-
commit string
27-
date string
2826
sdk *mgcSdk.Sdk
2927
}
3028

@@ -187,16 +185,14 @@ func (p *mgcProvider) DataSources(ctx context.Context) []func() datasource.DataS
187185
}
188186
}
189187

190-
func New(version string, commit string, date string) func() provider.Provider {
188+
func New(version string) func() provider.Provider {
191189
sdk := mgcSdk.NewSdk()
192-
mgcSdk.SetUserAgent("MgcTF")
190+
mgcSdk.SetUserAgent("MgcTF/" + version)
193191

194192
return func() provider.Provider {
195193
return &mgcProvider{
196194
sdk: sdk,
197195
version: version,
198-
commit: commit,
199-
date: date,
200196
}
201197
}
202198
}

terraform-provider-mgc

-37.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)