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

Add support for listing Runs in an organization #1059

Merged
merged 6 commits into from
Feb 19, 2025
Merged

Conversation

arybolovlev
Copy link
Contributor

@arybolovlev arybolovlev commented Feb 18, 2025

Description

This PR adds support for listing Runs in an organization.

Testing plan

  1. Create a new organization.
  2. Create a new workspace within the new organization.
  3. Optionally to validate filters create a new agent pool and attach it to the new workspace.
  4. Initialize 2 or more runs.
  5. List runs for the organization. Optionally filter by workspace or agent pool name.

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ TFE_ADDRESS="https://app.terraform.io/" TFE_TOKEN="xLIrzcOP64xzKg.atlasv1.XXX" go test -run TestRunsListForOrganization -v

=== RUN   TestRunsListForOrganization
=== RUN   TestRunsListForOrganization/without_list_options
=== RUN   TestRunsListForOrganization/without_list_options_and_include_as_nil
=== RUN   TestRunsListForOrganization/with_list_options
=== RUN   TestRunsListForOrganization/with_workspace_included
=== RUN   TestRunsListForOrganization/without_a_valid_organization_name
=== RUN   TestRunsListForOrganization/with_filter_by_agent_pool
=== RUN   TestRunsListForOrganization/with_filter_by_workspace
--- PASS: TestRunsListForOrganization (5.76s)
    --- PASS: TestRunsListForOrganization/without_list_options (0.19s)
    --- PASS: TestRunsListForOrganization/without_list_options_and_include_as_nil (0.19s)
    --- PASS: TestRunsListForOrganization/with_list_options (0.14s)
    --- PASS: TestRunsListForOrganization/with_workspace_included (0.21s)
    --- PASS: TestRunsListForOrganization/without_a_valid_organization_name (0.00s)
    --- PASS: TestRunsListForOrganization/with_filter_by_agent_pool (0.18s)
    --- PASS: TestRunsListForOrganization/with_filter_by_workspace (0.23s)
PASS
ok      github.com/hashicorp/go-tfe     6.079s

@arybolovlev arybolovlev requested a review from a team as a code owner February 18, 2025 09:28
@datadog-terraform-cloud-hashicorp
Copy link

datadog-terraform-cloud-hashicorp bot commented Feb 18, 2025

Datadog Report

Branch report: add-org-runs-list
Commit report: 2ea0355
Test service: hashicorp/go-tfe

✅ 0 Failed, 1430 Passed, 167 Skipped, 19m 1.92s Total Time
⬆️ Test Sessions change in coverage: 1 increased (+0.1%)

brandonc
brandonc previously approved these changes Feb 18, 2025
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

This is a good, highly conventional change and I appreciate the extra effort that took. We'll be able to merge this if you were to add a CHANGELOG entry.

@arybolovlev
Copy link
Contributor Author

This is a good, highly conventional change and I appreciate the extra effort that took. We'll be able to merge this if you were to add a CHANGELOG entry.

Thank you for your quick and accurate review, @brandonc! I have addressed your comments.

@brandonc brandonc merged commit 27686c4 into main Feb 19, 2025
7 checks passed
@brandonc brandonc deleted the add-org-runs-list branch February 19, 2025 15:39
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants