[WIP] Upstream 16013 - Remove deprecated custom virtual environment feature#256
[WIP] Upstream 16013 - Remove deprecated custom virtual environment feature#256
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the deprecated “custom virtual environment” feature across the AWX backend and collection modules, aligning job isolation and dependency management exclusively with execution environments (EEs).
Changes:
- Removes
custom_virtualenvmodel fields/mixins, related API serialization/config exposure, and adds a migration to drop the DB columns. - Removes legacy management commands and settings (
CUSTOM_VENV_PATHS,BASE_VENV_PATH) plus associated UI settings metadata. - Updates AWX collection modules and docs to drop the deprecated custom venv options/migration guidance.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/execution_environments.md | Removes custom-venv migration section from EE documentation. |
| awx_collection/plugins/modules/project.py | Drops custom_virtualenv option/parameter handling from the project module. |
| awx_collection/plugins/modules/organization.py | Drops custom_virtualenv option/parameter handling from the organization module. |
| awx_collection/plugins/modules/job_template.py | Drops custom_virtualenv option/parameter handling from the job_template module. |
| awx_collection/plugins/modules/inventory_source.py | Drops custom_virtualenv option/parameter handling from the inventory_source module. |
| awx/ui/src/screens/Setting/shared/data.allSettings.json | Removes CUSTOM_VENV_PATHS from UI settings fixture data. |
| awx/ui/src/screens/Setting/shared/data.allSettingOptions.json | Removes CUSTOM_VENV_PATHS from UI settings options metadata. |
| awx/ui/src/screens/Setting/MiscSystem/MiscSystemDetail/MiscSystemDetail.test.js | Updates UI test fixture to no longer include CUSTOM_VENV_PATHS. |
| awx/settings/production.py | Removes deprecated BASE_VENV_PATH setting. |
| awx/settings/development.py | Removes deprecated BASE_VENV_PATH setting. |
| awx/settings/defaults.py | Removes deprecated CUSTOM_VENV_PATHS default setting. |
| awx/main/utils/common.py | Removes custom-venv discovery/freeze helpers and related imports/exports. |
| awx/main/tests/functional/models/test_notifications.py | Updates notification context expectations to remove custom_virtualenv. |
| awx/main/models/projects.py | Removes CustomVirtualEnvMixin from Project. |
| awx/main/models/organization.py | Removes CustomVirtualEnvMixin from Organization. |
| awx/main/models/notifications.py | Removes custom_virtualenv from notification allowed fields/stub. |
| awx/main/models/mixins.py | Removes CustomVirtualEnvMixin implementation and related imports. |
| awx/main/models/jobs.py | Removes CustomVirtualEnvMixin from JobTemplate and Job. |
| awx/main/models/inventory.py | Removes CustomVirtualEnvMixin from InventorySource and InventoryUpdate. |
| awx/main/models/init.py | Stops re-exporting CustomVirtualEnvMixin. |
| awx/main/migrations/0195_remove_custom_virtualenv.py | Adds migration to remove custom_virtualenv DB fields from relevant models. |
| awx/main/management/commands/list_custom_venvs.py | Removes deprecated management command. |
| awx/main/management/commands/export_custom_venv.py | Removes deprecated management command. |
| awx/main/management/commands/custom_venv_associations.py | Removes deprecated management command. |
| awx/main/conf.py | Unregisters CUSTOM_VENV_PATHS setting. |
| awx/main/access.py | Removes custom_virtualenv from the “non-sensitive changes” allowlist. |
| awx/api/views/root.py | Removes custom_virtualenvs from /api/v2/config/ output and related imports. |
| awx/api/templates/api/api_v2_config_view.md | Removes docs mention of custom_virtualenvs from config endpoint docs. |
| awx/api/serializers.py | Removes custom_virtualenv fields/read-only declarations across serializers. |
| awx/api/metadata.py | Removes custom_virtualenv from field type metadata handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| data.update( | ||
| dict( | ||
| project_base_dir=settings.PROJECTS_ROOT, | ||
| project_local_paths=Project.get_local_path_choices(), | ||
| custom_virtualenvs=get_custom_venv_choices(), | ||
| ) |
There was a problem hiding this comment.
Removing custom_virtualenvs from the /api/v2/config/ response is a breaking API change. The UI still references config.custom_virtualenvs (e.g., awx/ui/CONTRIBUTING.md, awx/ui/testUtils/enzymeHelpers.js), so those consumers/docs should be updated in the same PR (or keep returning the field as an empty list for backwards compatibility).
| class Meta: | ||
| model = Organization | ||
| fields = ('*', 'max_hosts', 'custom_virtualenv', 'default_environment') | ||
| read_only_fields = ('*', 'custom_virtualenv') | ||
| fields = ('*', 'max_hosts', 'default_environment') | ||
| read_only_fields = ('*',) |
There was a problem hiding this comment.
With custom_virtualenv removed from these serializers, several UI components still referencing *.custom_virtualenv become dead code and may render incorrect legacy warnings. Please update the UI to remove/replace custom_virtualenv usages (or provide a compatibility shim) to complete the feature removal end-to-end.
| 'scm_revision', | ||
| 'diff_mode', | ||
| 'job_slice_number', | ||
| 'job_slice_count', | ||
| 'custom_virtualenv', | ||
| 'approval_status', |
There was a problem hiding this comment.
custom_virtualenv was removed from the notification job context allowlist here, but the user docs still list it as a supported notification attribute (docs/docsite/rst/userguide/notification_parameters_supported.rst). Please update that documentation so custom notifications don't advertise a field that will no longer be present.
| default_environment: | ||
| description: | ||
| - Default Execution Environment name, ID, or named URL to use for jobs owned by the Organization. | ||
| type: str | ||
| custom_virtualenv: | ||
| description: | ||
| - Local absolute file path containing a custom Python virtualenv to use. | ||
| - Only compatible with older versions of AWX/Tower | ||
| - Deprecated, will be removed in the future | ||
| type: str | ||
|
|
There was a problem hiding this comment.
The module EXAMPLES still mention creating an organization using a default Python virtualenv ("foo-venv"), but this module no longer exposes any virtualenv/custom_virtualenv option. Please update/remove that example (or replace it with an execution environment example) to avoid misleading users.
| @@ -47,18 +47,3 @@ Jobs will use the first available execution environment in this list: | |||
| 7. Any other global EE | |||
|
|
|||
| If more than one EE fits a criteria (applies for 6 and 7), then the most recently created one will be used. | |||
There was a problem hiding this comment.
This doc removes the migration guidance for custom virtual environments, but there are still other documentation references to custom_virtualenv (e.g., docs/docsite/rst/userguide/notification_parameters_supported.rst lists it as a supported notification attribute). Please remove/update those remaining references to keep docs consistent with the feature removal.
| If more than one EE fits a criteria (applies for 6 and 7), then the most recently created one will be used. | |
| If more than one EE fits the criteria (applies to 6 and 7), the most recently created one will be used. |
Upstream Notes
Remove the deprecated custom virtual environment feature from AWX. This feature has been superseded by execution environments and is no longer needed. The removal includes all related models, API endpoints, management commands, configuration settings, and documentation references.
This change modernizes the codebase by eliminating legacy virtual environment management in favor of the standardized execution environment approach for job isolation and dependency management.
[WIP] - Still ensuring its fully removed from the UI