Skip to content

Conversation

@RoxyFarhad
Copy link
Collaborator

@RoxyFarhad RoxyFarhad commented Dec 18, 2025

This PR introduces a new naming convention to support multiple environment deployments:

  • Environment Label (environment-label): The pre-defined deployment target you specify when triggering the workflow (dev, staging, prod-multitenant). This is what you select from the dropdown in GitHub Actions.
  • Environment Name (env-name): The actual environment names defined in your environments.yaml file (dev.aws, dev.azure, staging, etc.). These are the specific deployment configurations that map to the environment label.

Why we need this distinction:

  • One-to-Many Mapping: A single environment label can now map to multiple environment names (e.g., dev → dev.aws, dev.azure), enabling parallel deployments to different cloud providers
  • Non-explicit Mapping: If an environment has an env-name that is the same as the deployment target (i.e. an env-name of dev and a deployment target dev) it will automatically deploy to that environment.

This supports the desired config change of having different environments that map to a single "environment":

schema_version: "v1" # This is used to validate the file structure and is not used by the agentex CLI
environments:
  dev-aws:
    environment: "dev"
    kubernetes:
      namespace: "sgp-000-hello-acp"
    auth:
      principal:
        user_id: ...
        account_id: ...
    helm_overrides:
      ...
  dev-azure:
    environment: "dev"
    kubernetes:
      namespace: "sgp-000-hello-acp"
    auth:
      principal:
        user_id: ...
        account_id: ...
    helm_overrides:
      ...

Backwards compatability:

  • This introduces new helper methods that are used in the deployment pipelines and doesn't change any existing methods. This is purely an additive change so it will not break any older code, or anyone using these helper function sin older SDKs.

Tests against internal scale agents:

  • New Process (NB. all agents that did not deploy was not because of this new code)
  • Old Process - N.B. the deployment failed because the agent doesn't have the correct creds setup but the deployment to the cluster works correctly.

N.B. There was a large diff generated by linter for some reason

@socket-security
Copy link

socket-security bot commented Dec 18, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedagentex-sdk@​0.6.7 ⏵ 0.8.0100 +14100100100100

View full report

description="Helm repository name for the environment"

kubernetes: AgentKubernetesConfig | None = Field(default=None, description="Kubernetes deployment configuration")
environment: str | None = Field(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is the only change in the file

return self.environments[env_name]


def get_configs_for_env(self, env: str) -> List[AgentEnvironmentConfig]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new method added

)


class TestAgentEnvironmentsConfig:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added a tests file for this new functionality

@RoxyFarhad RoxyFarhad force-pushed the RF/support-multiple-envs branch from 5927953 to f2e47c5 Compare December 18, 2025 12:10
from .deployment_history_list_response import DeploymentHistoryListResponse as DeploymentHistoryListResponse
from .task_retrieve_by_name_params import TaskRetrieveByNameParams as TaskRetrieveByNameParams
from .message_list_paginated_params import MessageListPaginatedParams as MessageListPaginatedParams
from .deployment_history_list_params import DeploymentHistoryListParams as DeploymentHistoryListParams
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixing linter error

@RoxyFarhad RoxyFarhad force-pushed the RF/support-multiple-envs branch from e2aa69e to 5259f20 Compare December 18, 2025 12:29

return TrackerResource(self)

@cached_property
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a valid linter error that was being ignored but that we should support in the SDK

@RoxyFarhad RoxyFarhad force-pushed the RF/support-multiple-envs branch from 2f8c94b to 7881ec2 Compare December 18, 2025 17:39
@RoxyFarhad RoxyFarhad force-pushed the RF/support-multiple-envs branch from c55c9e4 to 0c3a8c2 Compare December 19, 2025 12:43
return self.environments[env_name]


def get_configs_for_env(self, env_target: str) -> dict[str, AgentEnvironmentConfig]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New Addition

)


# if environment mappings are set, you cannot have a top-level env_name that maps to an `environment: value`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure if this is worth removing?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a reasonable sanity check to keep especially as we migrate to this new format

missing_envs: List[str] = []
environment_mappings = [env.environment for env in environments_config.environments.values() if env.environment]
top_level_envs = [env for env in environments_config.environments]
all_envs = set(environment_mappings + top_level_envs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this shouldn't be a breaking change because we are still adding the same [env for env in environments_config.environments] in the check but we have just moved it above.

@@ -1,6 +0,0 @@
name: Test AgentEx Tutorials
Copy link
Collaborator Author

@RoxyFarhad RoxyFarhad Dec 22, 2025

Choose a reason for hiding this comment

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

This was a drive-by removal: Removing this because its not used and just errors on every workflow

@RoxyFarhad RoxyFarhad requested a review from a team December 22, 2025 12:26
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