Skip to content

Commit db673f1

Browse files
authored
Merge pull request #1280 from hashicorp/TF-33455-go-tfe-GH-Issue-1274-Add-Size-field-for-StateVersion
Size field for StateVersion struct
2 parents 2782bc1 + 09bece8 commit db673f1

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
## Enhancements
66
* Adds the `SpeculativeEnabled` field to the `StackCreateOptions` and `StackUpdateOptions` structs by @arunatibm [1279](https://github.com/hashicorp/go-tfe/pull/1279)
77
* Adds `Name` and `Provider` fields to `RegistryModuleCreateWithVCSConnectionOptions` to support explicit module naming for monorepos with non-standard repository names, by @jillirami [#1277](https://github.com/hashicorp/go-tfe/pull/1277)
8+
* Adds the `Size` field to `StateVersion` by @Shaunakone [#1280](https://github.com/hashicorp/go-tfe/pull/1280)
9+
810

911
# v1.100.0
1012

state_version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ type StateVersion struct {
101101
JSONUploadURL string `jsonapi:"attr,hosted-json-state-upload-url"`
102102
JSONDownloadURL string `jsonapi:"attr,hosted-json-state-download-url"`
103103
Serial int64 `jsonapi:"attr,serial"`
104+
Size int64 `jsonapi:"attr,size"`
104105
VCSCommitSHA string `jsonapi:"attr,vcs-commit-sha"`
105106
VCSCommitURL string `jsonapi:"attr,vcs-commit-url"`
106107
BillableRUMCount *uint32 `jsonapi:"attr,billable-rum-count"`

state_version_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ func TestStateVersionsUpload(t *testing.T) {
159159
assert.NotEmpty(t, sv.DownloadURL)
160160
assert.Equal(t, StateVersionFinalized, sv.Status)
161161
})
162-
163162
t.Run("cannot provide base64 state parameter when uploading", func(t *testing.T) {
164163
ctx := context.Background()
165164
_, err = client.StateVersions.Upload(ctx, wTest.ID, StateVersionUploadOptions{
@@ -548,6 +547,7 @@ func TestStateVersionsRead(t *testing.T) {
548547

549548
require.NotNil(t, sv.BillableRUMCount)
550549
assert.Greater(t, *sv.BillableRUMCount, uint32(0))
550+
assert.Greater(t, sv.Size, int64(0))
551551
})
552552

553553
t.Run("when the state version does not exist", func(t *testing.T) {

0 commit comments

Comments
 (0)