8000 Add Source to Workspace by jpadrianoGo · Pull Request #1124 · hashicorp/go-tfe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Source to Workspace #1124

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jpadrianoGo
Copy link
Contributor
@jpadrianoGo jpadrianoGo commented Jun 10, 2025

Description

This PR adds Source field to Workspace struct.

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 TestWorkspacesReadSource. The new tests should pass.
  3. Source is read for Workspaces.

{"data":{"id":"ws-","type":"workspaces","attributes":{"allow-destroy-plan":true,"auto-apply":false,"auto-apply-run-trigger":false,"auto-destroy-activity-duration":null,"auto-destroy-at":null,"auto-destroy-status":null,"inherits-project-auto-destroy":true,"created-at":"2025-06-03T08:42:47.572Z","environment":"default","locked":false,"name":"wsTest","queue-all-runs":false,"speculative-enabled":true,"structured-run-output-enabled":true,"terraform-version":"1.12.1","working-directory":null,"global-remote-state":false,"updated-at":"2025-06-03T08:42:47.572Z","resource-count":0,"apply-duration-average":null,"plan-duration-average":null,"policy-check-failures":null,"run-failures":null,"workspace-kpis-runs-count":null,"unarchived-workspace-change-requests-count":0,"latest-change-at":"2025-06-03T08:42:47.572Z","operations":true,"execution-mode":"remote","vcs-repo":null,"vcs-repo-identifier":null,"permissions":{"can-update":true,"can-destroy":true,"can-queue-run":true,"can-read-run":true,"can-read-variable":true,"can-update-variable":true,"can-read-state-versions":true,"can-read-state-outputs":true,"can-create-state-versions":true,"can-queue-apply":true,"can-lock":true,"can-unlock":true,"can-force-unlock":true,"can-read-settings":true,"can-manage-tags":true,"can-manage-run-tasks":true,"can-force-delete":true,"can-manage-assessments":true,"can-manage-ephemeral-workspaces":false,"can-read-assessment-results":true,"can-read-change-requests":false,"can-update-change-requests":false,"can-queue-destroy":true},"actions":{"is-destroyable":true},"description":null,"file-triggers-enabled":true,"trigger-prefixes":[],"trigger-patterns":[],"assessments-enabled":false,"last-assessment-result-at":null,"locked-reason":"","source":"tfe-api","source-name":null,"tag-names":[],"setting-overwrites":{"execution-mode":false,"agent-pool":false}},"relationships":{"organization":{"data":{"id":"orgTest","type":"organizations"}},"current-run":{"data":null},"latest-run":{"data":null},"outputs":{"data":[]},"remote-state-consumers":{"links":{"related":"/api/v2/workspaces/ws-/relationships/remote-state-consumers"}},"current-state-version":{"data":null},"current-configuration-version":{"data":null},"agent-pool":{"data":null},"readme":{"data":null},"project":{"data":{"id":"prj-***","type":"projects"}},"current-assessment-result":{"data":null},"vars":{"data":[]}},"links":{"self":"/api/v2/organizations/orgTest/workspaces/wsTest","self-html":"/app/orgTest/workspaces/wsTest"}}}

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 TestWorkspacesReadSource

=== RUN   TestWorkspacesReadSource
--- PASS: TestWorkspacesReadSource (3.86s)
PASS
ok      github.com/hashicorp/go-tfe     3.910s

@jpadrianoGo jpadrianoGo requested a review from a team as a code owner June 10, 2025 04:34
@jpadrianoGo jpadrianoGo changed the title Added Source to Workspace Add Source to Workspace Jun 10, 2025
@jpadrianoGo jpadrianoGo force-pushed the workspace/source branch 4 times, most recently from 25a064e to f7891b5 Compare June 18, 2025 21:38
Sign 56C6 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.

1 participant
0