Skip to content

Adds CreatedAt to AgentPool#1159

Merged
ctrombley merged 4 commits intomainfrom
agentPool/CreatedAt
Aug 22, 2025
Merged

Adds CreatedAt to AgentPool#1159
ctrombley merged 4 commits intomainfrom
agentPool/CreatedAt

Conversation

@ctrombley
Copy link
Copy Markdown
Collaborator

Description

This PR adds CreatedAt field to AgentPool struct, originally by @jpadrianoGo (#1150).

Testing plan

  1. Generate the required environment variables for go test, TFE_ADDRESS and TFE_TOKEN
  2. Run TFE_ADDRESS="https://example" TFE_TOKEN="example" go test ./... -v -run TestAgentPoolsReadCreatedAt. The new tests should pass.
  3. CreatedAt is read for AgentPool.
{
  "data": {
    "id": "apool-***",
    "type": "agent-pools",
    "attributes": {
      "name": "cool-pool",
      "created-at": "2025-06-01T03:35:11.339Z",
      "agent-count": 0,
      "organization-scoped": true
    },
    "relationships": {
      "organization": {
        "data": {
          "id": "orgTest",
          "type": "organizations"
        }
      },
      "agents": {
        "links": {
          "related": "/api/v2/agent-pools/apool-***/agents"
        }
      },
      "authentication-tokens": {
        "links": {
          "related": "/api/v2/agent-pools/apool-***/authentication-tokens"
        }
      },
      "oauth-clients": {
        "links": {
          "related": "/api/v2/organizations/orgTest/oauth-clients?filter[agent_pool]=apool-***"
        }
      },
      "workspaces": {
        "data": []
      },
      "allowed-workspaces": {
        "data": []
      }
    },
    "links": {
      "self": "/api/v2/agent-pools/apool-***"
    }
  }
}

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://example" TFE_TOKEN="example"go test ./... -v -run TestAgentPoolsReadCreatedAt

=== RUN   TestAgentPoolsReadCreatedAt
--- PASS: TestAgentPoolsReadCreatedAt (3.00s)
PASS
ok      github.com/hashicorp/go-tfe     3.067s

@ctrombley ctrombley self-assigned this Jul 15, 2025
@ctrombley ctrombley requested a review from a team as a code owner July 15, 2025 19:54
Maed223
Maed223 previously approved these changes Jul 15, 2025
Maed223
Maed223 previously approved these changes Jul 15, 2025
@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

Datadog Report

Branch report: agentPool/CreatedAt
Commit report: cf79ce7
Test service: hashicorp/go-tfe

✅ 0 Failed, 1473 Passed, 186 Skipped, 32m 3.1s Total Time
➡️ Test Sessions change in coverage: 1 no change

@ctrombley ctrombley force-pushed the agentPool/CreatedAt branch from ff013c8 to 6d25729 Compare August 20, 2025 15:19
@ctrombley ctrombley force-pushed the agentPool/CreatedAt branch from 6d25729 to db70a9b Compare August 20, 2025 15:38
Copy link
Copy Markdown
Contributor

@Maed223 Maed223 left a comment

Choose a reason for hiding this comment

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

Nice and simple 👍

@ctrombley ctrombley merged commit f28c909 into main Aug 22, 2025
8 checks passed
@ctrombley ctrombley deleted the agentPool/CreatedAt branch August 22, 2025 16:37
@github-actions
Copy link
Copy Markdown

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.

@jpadrianoGo
Copy link
Copy Markdown
Contributor

Thank you @ctrombley and @Maed223

mutahhir pushed a commit that referenced this pull request Sep 2, 2025
* Adds CreatedAt to AgentPool

* Updated changelog

---------

Co-authored-by: jpadrianoGo <james.patrick.adriano@gmail.com>
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.

3 participants