Have role make deployed IOC a git repo, and commit any changes on deployment. Add role for performing rollbacks to previous deployments#190
Open
jwlodek wants to merge 4 commits intoNSLS2:mainfrom
Conversation
…loyment. Add role for performing rollbacks to previous deployments
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes deployed IOC directories self-contained git repositories so each deployment can be tracked/compared over time, and introduces a new Ansible role to roll back an IOC deployment by resetting the repository to a previous commit.
Changes:
- Initialize a git repository (if needed) in the IOC deploy directory and attempt to commit deployment changes.
- Add a new
rollback_deploymentrole that verifies repo state and performsgit reset --hardto roll back N commits. - Document rollback role variables and provide defaults for IOC directory layout.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
roles/deploy_ioc/tasks/deploy-ioc.yml |
Adds git init/add/commit steps to record deployment deltas in the IOC directory. |
roles/rollback_deployment/tasks/main.yml |
Implements rollback flow: repo checks, clean-tree requirement, commit-count gate, hard reset. |
roles/rollback_deployment/defaults/main.yml |
Adds default base paths and rollback step count. |
roles/rollback_deployment/README.md |
Documents role purpose and inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Right now, I think deployment basically ignores autosave files. I think the git change tracking is a nice idea, but maybe we should ignore autosave files. On the other hand, adding/removing PVs with autosave from new deployments could possibly get complicated. |
thopkins32
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All deployments will now be git repositories so that changes are tracked from deployment to deployment. This will also allow for easier rollbacks to previous deployments. A helper role to perform rollbacks is also added.