-
Notifications
You must be signed in to change notification settings - Fork 1
PythonTFE : Agents agentpools #31
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
Conversation
examples/agent.py
Outdated
|
|
||
| import os | ||
|
|
||
| import httpx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is httpx is required to be imported in example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
examples/agent.py
Outdated
| import os | ||
|
|
||
| import httpx | ||
| import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be imported on example file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
examples/agent.py
Outdated
| ) | ||
|
|
||
|
|
||
| def get_token_display(client: TFEClient) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
examples/agent.py
Outdated
| return "Error reading token" | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no tests in example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
examples/agent.py
Outdated
| print("🔄 Starting comprehensive agent workflow") | ||
|
|
||
| # Step 1: Setup - ensure we have an agent pool | ||
| agent_pools = list(client.agent_pools.list(org)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe client.agent_pools.list will return in list, why convert list to list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/tfe/models/run_task.py
Outdated
|
|
||
| from ..types import Pagination | ||
| from .agentpool import AgentPool | ||
| from .agent_pool import AgentPool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just use model/agent.py here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/tfe/resources/agent_pools.py
Outdated
| agent pools, including CRUD operations and workspace assignments. | ||
| Based on the Go TFE implementation: | ||
| https://github.com/hashicorp/go-tfe/blob/main/agent_pool.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 6-7 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/tfe/resources/run_task.py
Outdated
| RequiredNameError, | ||
| ) | ||
| from ..models.agentpool import AgentPool | ||
| from ..models.agent_pool import AgentPool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. We should import from new model file (agent.py)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/tfe/resources/agents.py
Outdated
| This module provides the Agents service for managing individual Terraform Enterprise/Cloud | ||
| agents within agent pools. | ||
| Based on the Go TFE implementation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same; remove these 2 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/tfe/models/agent.py
Outdated
| including all necessary option classes for CRUD operations. | ||
| Based on the Go TFE implementation: | ||
| https://github.com/hashicorp/go-tfe/blob/main/agent.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these lines of go-tfe ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
- Merged agent/agent_pool functionality with new configuration_version, apply, plan, run functionality - Combined imports and exports in both files - All 208 tests passing - All quality checks passing (ruff, mypy)
Description
Testing plan
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.
Rollback Plan
Changes to Security Controls
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.
If you have any questions, please contact your direct supervisor, GRC (#team-grc), or the PCI working group (#proj-pci-reboot). You can also find more information at PCI Compliance.