Skip to content

Conversation

glennsarti
Copy link
Contributor

@glennsarti glennsarti commented Aug 1, 2024

Description

This commit updates the Org. entitlements for the new Private Run Tasks feature. This commit also updates the Run Task options struct for CRUD operations to pass through the agent pool relationship

Testing plan

Handled by integration test changes.

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.

?   	github.com/hashicorp/go-tfe/examples/backing_data	[no test files]
?   	github.com/hashicorp/go-tfe/examples/configuration_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/organizations	[no test files]
?   	github.com/hashicorp/go-tfe/examples/registry_modules	[no test files]
?   	github.com/hashicorp/go-tfe/examples/run_errors	[no test files]
?   	github.com/hashicorp/go-tfe/examples/state_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/users	[no test files]
?   	github.com/hashicorp/go-tfe/examples/workspaces	[no test files]
?   	github.com/hashicorp/go-tfe/mocks	[no test files]
=== RUN   TestRunTasksCreate
=== RUN   TestRunTasksCreate/with_an_agent_pool            <------- Test passed, not skipped
=== RUN   TestRunTasksCreate/add_run_task_to_organization
=== RUN   TestRunTasksCreate/add_run_task_to_organization/ensure_org_is_deserialized_properly
--- PASS: TestRunTasksCreate (4.56s)
    --- PASS: TestRunTasksCreate/with_an_agent_pool (0.57s)
    --- PASS: TestRunTasksCreate/add_run_task_to_organization (0.50s)
        --- PASS: TestRunTasksCreate/add_run_task_to_organization/ensure_org_is_deserialized_properly (0.00s)
=== RUN   TestRunTasksCreateWithoutGlobalEntitlement
=== RUN   TestRunTasksCreateWithoutGlobalEntitlement/add_run_task_to_organization
--- PASS: TestRunTasksCreateWithoutGlobalEntitlement (3.38s)
    --- PASS: TestRunTasksCreateWithoutGlobalEntitlement/add_run_task_to_organization (0.36s)
=== RUN   TestRunTasksList
=== RUN   TestRunTasksList/with_no_params
--- PASS: TestRunTasksList (5.87s)
    --- PASS: TestRunTasksList/with_no_params (0.40s)
=== RUN   TestRunTasksRead
=== RUN   TestRunTasksRead/by_ID
=== RUN   TestRunTasksRead/with_options
--- PASS: TestRunTasksRead (8.41s)
    --- PASS: TestRunTasksRead/by_ID (0.41s)
    --- PASS: TestRunTasksRead/with_options (3.48s)
=== RUN   TestRunTasksUpdate
=== RUN   TestRunTasksUpdate/rename_task
=== RUN   TestRunTasksUpdate/toggle_enabled
=== RUN   TestRunTasksUpdate/update_description
=== RUN   TestRunTasksUpdate/with_an_agent_pool.            <------- Test passed, not skipped
--- PASS: TestRunTasksUpdate (7.16s)
    --- PASS: TestRunTasksUpdate/rename_task (0.78s)
    --- PASS: TestRunTasksUpdate/toggle_enabled (0.80s)
    --- PASS: TestRunTasksUpdate/update_description (0.72s)
    --- PASS: TestRunTasksUpdate/with_an_agent_pool (0.56s)
=== RUN   TestRunTasksDelete
=== RUN   TestRunTasksDelete/with_valid_options
=== RUN   TestRunTasksDelete/when_the_run_task_does_not_exist
=== RUN   TestRunTasksDelete/when_the_run_task_ID_is_invalid
--- PASS: TestRunTasksDelete (4.95s)
    --- PASS: TestRunTasksDelete/with_valid_options (0.62s)
    --- PASS: TestRunTasksDelete/when_the_run_task_does_not_exist (0.30s)
    --- PASS: TestRunTasksDelete/when_the_run_task_ID_is_invalid (0.00s)
=== RUN   TestRunTasksAttachToWorkspace
=== RUN   TestRunTasksAttachToWorkspace/to_a_valid_workspace
--- PASS: TestRunTasksAttachToWorkspace (5.77s)
    --- PASS: TestRunTasksAttachToWorkspace/to_a_valid_workspace (0.71s)
=== RUN   TestRunTasksIntegration_Validate
=== RUN   TestRunTasksIntegration_Validate/with_an_empty_status
=== RUN   TestRunTasksIntegration_Validate/without_valid_Status_options
=== RUN   TestRunTasksIntegration_Validate/with_valid_Status_options
--- PASS: TestRunTasksIntegration_Validate (0.00s)
    --- PASS: TestRunTasksIntegration_Validate/with_an_empty_status (0.00s)
    --- PASS: TestRunTasksIntegration_Validate/without_valid_Status_options (0.00s)
    --- PASS: TestRunTasksIntegration_Validate/with_valid_Status_options (0.00s)
=== RUN   TestRunTasksIntegration_ValidateCallback
=== RUN   TestRunTasksIntegration_ValidateCallback/with_invalid_callbackURL
=== RUN   TestRunTasksIntegration_ValidateCallback/with_invalid_accessToken
--- PASS: TestRunTasksIntegration_ValidateCallback (0.00s)
    --- PASS: TestRunTasksIntegration_ValidateCallback/with_invalid_callbackURL (0.00s)
    --- PASS: TestRunTasksIntegration_ValidateCallback/with_invalid_accessToken (0.00s)
=== RUN   TestRunTasksIntegration_Callback
--- PASS: TestRunTasksIntegration_Callback (0.01s)
PASS
ok  	github.com/hashicorp/go-tfe	40.928s

@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch from 3ba7a80 to 5ce883c Compare August 1, 2024 02:52
@glennsarti glennsarti self-assigned this Aug 1, 2024
@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch 3 times, most recently from 7bc320e to a0d0245 Compare August 5, 2024 01:13
@glennsarti glennsarti changed the title Update Org and Run Tasks for Private Run Tasks [DO NOT MERGE] Update Org and Run Tasks for Private Run Tasks Aug 5, 2024
@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch from a0d0245 to 7f3a1d1 Compare April 4, 2025 04:26
@datadog-terraform-cloud-hashicorp
Copy link

datadog-terraform-cloud-hashicorp bot commented Apr 4, 2025

Datadog Report

Branch report: gs/add-private-run-tasks
Commit report: f562409
Test service: hashicorp/go-tfe

✅ 0 Failed, 1451 Passed, 176 Skipped, 17m 18.62s Total Time
➡️ Test Sessions change in coverage: 1 no change

@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch from 7f3a1d1 to 4119cc2 Compare April 23, 2025 03:06
@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch from 4119cc2 to 18a6072 Compare June 12, 2025 02:01
@glennsarti glennsarti marked this pull request as ready for review June 12, 2025 02:01
@glennsarti glennsarti requested a review from a team as a code owner June 12, 2025 02:01
@glennsarti glennsarti changed the title [DO NOT MERGE] Update Org and Run Tasks for Private Run Tasks Update Org and Run Tasks for Private Run Tasks Jun 12, 2025
@glennsarti glennsarti requested a review from a team June 12, 2025 02:03
This commit updates the Org. entitlements for the new Private Run Tasks feature.
This commit also updates the Run Task options struct for CRUD operations to
pass through the agent pool relationship
@glennsarti glennsarti force-pushed the gs/add-private-run-tasks branch from 18a6072 to 158da44 Compare June 16, 2025 01:25
Comment on lines +84 to +88
// Unfortunately when we create a Run Task it automatically verifies that the URL by sending a test payload. But
// this means with an agent pool, we need an agent pool to exist, and an agent created with request forwarding enabled.
// This is too much to create for this one test suite. So instead, we really only need to assert that; when the options include an
// agent pool, then we expect HCP Terraform to process the agent pool. So, if we send it a nonsense agent pool ID, then we
// expect an error to be returned saying that the ID was nonsense.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@sebasslash sebasslash mentioned this pull request Jun 16, 2025
@glennsarti glennsarti merged commit d445cae into main Jun 16, 2025
8 checks passed
@glennsarti glennsarti deleted the gs/add-private-run-tasks branch June 16, 2025 23:53
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.

3 participants