[PE] Display And Handle Varied Version Options For The Preview Environment Control And UI System
Overview
In the context of the Preview environment control and UI system, it is essential to provide users with various options for selecting the version of code to be used in a preview environment. This article outlines the requirements for handling different version options for the vets-api, vets-website, and content build components.
Version Options for vets-api
The primary selection mechanism for vets-api will be the semantic version. However, some developers may want to utilize a commit SHA or a branch name. As a result, the control app API needs to collect and store both the version field and an additional field detailing if the version field contains a SHA, semver, or branch name.
Control Plane Requirements
The control plane needs to have the ability to translate the SHA and branch name into a semver for deployment. When a branch is used, an option is required to have "auto update" the environment if newer code is committed on the branch.
UI Requirements
The UI needs to have the user select branch, SHA, or semver, including the "auto update" checkbox. The currently deployed version will also need to be displayed.
Acceptance Criteria
- UI supports setting SHA or semver or branch for vets-api
- UI supports setting SHA and branch for vets-website
- UI supports setting "auto update" when the vets-api branch option is selected
- UI supports setting "auto update" when the vets-website branch option is selected
- Control plane supports SHA, semver, and branch in the REST API as appropriate
- Control plane converts to semver when passing to the GitHub workflows for vets-api and SHA when passing in vets-website
- Current SHA/semver are displayed for deployed environments
Version Options for vets-website
The primary selection method for vets-website is currently the commit SHA and does not currently support semantic versioning. As a result, only commit SHA and branch need to be supported as part of milestone 3.
Control Plane Requirements
Similar to vets-api, the control app needs to convert the branch to a SHA, and have the "auto update" setting if we are on a branch.
UI Requirements
The UI similarly needs to allow selecting SHA or branch, and the auto update, and display the exact SHA when branch is selected.
Acceptance Criteria
- UI supports setting SHA or branch for vets-website
- UI supports setting "auto update" when the vets-website branch option is selected
Version Options for content build
As part of milestone 3, content build will only support matching the current dev environment. As a result, the existing version system where a simply "dev" is defaulted is sufficient.
Acceptance Criteria
- UI supports setting "dev" for content build
Implementation Plan
To implement the required version options, the following steps need to be taken:
- Update the control app API to collect and store both the version field and an additional field detailing if the version field contains a SHA, semver, or name.
- Implement the ability to translate the SHA and branch name into a semver for deployment in the control plane.
- Update the UI to allow users to select branch, SHA, or semver, including the "auto update" checkbox.
- Display the currently deployed version in the UI.
- Update the control plane to support SHA, semver, and branch in the REST API as appropriate.
- Implement the conversion of branch to SHA and semver in the control plane.
- Update the UI to display the exact SHA when branch is selected.
Conclusion
Frequently Asked Questions
In this article, we will address some of the frequently asked questions related to the display and handling of varied version options for the Preview environment control and UI system.
Q: What are the primary selection mechanisms for vets-api and vets-website?
A: The primary selection mechanism for vets-api is the semantic version, while the primary selection method for vets-website is currently the commit SHA.
Q: Why do we need to support SHA, semver, and branch for vets-api?
A: Some developers may want to utilize a commit SHA or a branch name for vets-api, in addition to the semantic version. This requires the control app API to collect and store both the version field and an additional field detailing if the version field contains a SHA, semver, or branch name.
Q: How does the control plane handle SHA and branch names for vets-api and vets-website?
A: The control plane needs to have the ability to translate the SHA and branch name into a semver for deployment. When a branch is used, an option is required to have "auto update" the environment if newer code is committed on the branch.
Q: What are the UI requirements for vets-api and vets-website?
A: The UI needs to have the user select branch, SHA, or semver, including the "auto update" checkbox. The currently deployed version will also need to be displayed.
Q: How does the control plane support SHA, semver, and branch in the REST API?
A: The control plane needs to support SHA, semver, and branch in the REST API as appropriate. This includes converting the branch to a SHA and semver for deployment.
Q: What is the current SHA/semver displayed for deployed environments?
A: The current SHA/semver are displayed for deployed environments.
Q: Why is content build only supporting matching the current dev environment?
A: As part of milestone 3, content build will only support matching the current dev environment. As a result, the existing version system where a simply "dev" is defaulted is sufficient.
Q: What are the acceptance criteria for the implementation of varied version options?
A: The acceptance criteria include:
- UI supports setting SHA or semver or branch for vets-api
- UI supports setting SHA and branch for vets-website
- UI supports setting "auto update" when the vets-api branch option is selected
- UI supports setting "auto update" when the vets-website branch option is selected
- Control plane supports SHA, semver, and branch in the REST API as appropriate
- Control plane converts to semver when passing to the GitHub workflows for vets-api and SHA when passing in vets-website
- Current SHA/semver are displayed for deployed environments
Conclusion
In conclusion, the display and handling of varied version options for the Preview environment control and UI system requires careful consideration of the primary selection mechanisms, control plane requirements, and UI requirements. By addressing the frequently asked questions outlined above, we can ensure a smooth implementation of the required version options and enhance the Preview environment control and UI system to meet the needs of users.