Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Enhancements
* Adds `ProjectRemoteState` field to `Workspace` to support state sharing at the project level, by @hs26gill [#1248](https://github.com/hashicorp/go-tfe/pull/1248)
* Adds 'Migration' field to `StackCreateOptions` and `CreationSource` to stack struct to provide insights re: stack creation [#1266](https://github.com/hashicorp/go-tfe/pull/1266)

# v1.98.0

Expand Down
2 changes: 2 additions & 0 deletions stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type Stack struct {
DownstreamCount int `jsonapi:"attr,downstream-count"`
InputsCount int `jsonapi:"attr,inputs-count"`
OutputsCount int `jsonapi:"attr,outputs-count"`
CreationSource string `jsonapi:"attr,creation-source"`

// Relationships
Project *Project `jsonapi:"relation,project"`
Expand Down Expand Up @@ -159,6 +160,7 @@ type StackListOptions struct {
type StackCreateOptions struct {
Type string `jsonapi:"primary,stacks"`
Name string `jsonapi:"attr,name"`
Migration *bool `jsonapi:"attr,migration,omitempty"`
Description *string `jsonapi:"attr,description,omitempty"`
VCSRepo *StackVCSRepoOptions `jsonapi:"attr,vcs-repo"`
Project *Project `jsonapi:"relation,project"`
Expand Down
3 changes: 3 additions & 0 deletions stack_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestStackCreateAndList(t *testing.T) {
Project: &Project{
ID: orgTest.DefaultProject.ID,
},
Migration: Bool(true),
})

require.NoError(t, err)
Expand All @@ -64,6 +65,8 @@ func TestStackCreateAndList(t *testing.T) {
require.NoError(t, err)

assert.Len(t, stackList.Items, 2)
assert.Equal(t, stack1.CreationSource, "migration-api")
assert.Equal(t, stack2.CreationSource, "api")
})

t.Run("List with project filter", func(t *testing.T) {
Expand Down
Loading