Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove beta comments and skipBeta from List Runs Options #472

Merged
merged 7 commits into from Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
# Unreleased Changes

## Enhancements
* Remove beta messaging and cleanup for `RunListOptions` struct by @mjyocca [#472](https://github.com/hashicorp/go-tfe/pull/472)
mjyocca marked this conversation as resolved.
Show resolved Hide resolved

# v1.8.0

## Enhancements
Expand Down
24 changes: 13 additions & 11 deletions run.go
Expand Up @@ -205,24 +205,26 @@ const (
type RunListOptions struct {
ListOptions

// Optional: Username of user who created the run
// **Note: This API is still in BETA and is subject to change.**
Name string `url:"search[name],omitempty"`
// Optional: Searches runs that matches the supplied VCS username.
User string `url:"search[user],omitempty"`

// Optional: Commit SHA for runs triggered via a vcs event
// **Note: This API is still in BETA and is subject to change.**
// Optional: Searches runs that matches the supplied commit sha.
Commit string `url:"search[commit],omitempty"`

// Optional: Current status of the run
// **Note: This API is still in BETA and is subject to change.**
// Optional: Searches runs that matches the supplied VCS username, commit sha, run_id, and run message.
// The presence of search[commit] or search[user] takes priority over this parameter and will be omitted.
Search string `url:"search[basic],omitempty"`

// Optional: Current status of the run.
// Options are listed at https://www.terraform.io/cloud-docs/api-docs/run#run-states
Status string `url:"filter[status],omitempty"`

// Optional: Source that triggered the run
// **Note: This API is still in BETA and is subject to change.**
// Optional: Source that triggered the run.
// Options are listed at https://www.terraform.io/cloud-docs/api-docs/run#run-sources
Source string `url:"filter[source],omitempty"`

// Optional: Operation type for the run
// **Note: This API is still in BETA and is subject to change.**
// Optional: Operation type for the run.
// Options are listed at https://www.terraform.io/cloud-docs/api-docs/run#run-operations
Operation string `url:"filter[operation],omitempty"`

// Optional: A list of relations to include. See available resources:
Expand Down
5 changes: 2 additions & 3 deletions run_integration_test.go
Expand Up @@ -141,7 +141,7 @@ func TestRunsListQueryParams(t *testing.T) {
},
{
description: "with name parameter",
options: &RunListOptions{Name: currentUser.Username, Include: []RunIncludeOpt{RunWorkspace}},
options: &RunListOptions{User: currentUser.Username, Include: []RunIncludeOpt{RunWorkspace}},
assertion: func(tc testCase, rl *RunList, err error) {
found := []string{}
for _, r := range rl.Items {
Expand All @@ -153,7 +153,7 @@ func TestRunsListQueryParams(t *testing.T) {
},
{
description: "with name & commit parameter",
options: &RunListOptions{Name: randomString(t), Commit: randomString(t), Include: []RunIncludeOpt{RunWorkspace}},
options: &RunListOptions{User: randomString(t), Commit: randomString(t), Include: []RunIncludeOpt{RunWorkspace}},
assertion: func(tc testCase, rl *RunList, err error) {
require.NoError(t, err)
assert.Equal(t, 0, len(rl.Items))
Expand All @@ -163,7 +163,6 @@ func TestRunsListQueryParams(t *testing.T) {

for _, testCase := range testCases {
t.Run(testCase.description, func(t *testing.T) {
skipIfBeta(t)
runs, err := client.Runs.List(ctx, workspaceTest.ID, testCase.options)
testCase.assertion(testCase, runs, err)
})
Expand Down