Add --manage-repos parameter for forge deploy-dev#570
Conversation
|
@jeremylenz I extracted your conflicts idea from this PR and modified it a bit -- #610 |
2547caf to
eb72d3b
Compare
|
Updated this PR to include only the |
|
eb72d3b to
b836a57
Compare
b836a57 to
c68a398
Compare
| help: GitHub username to add as additional remote for git checkouts | ||
| action: store | ||
| foreman_development_preserve_branches: | ||
| parameter: --preserve-branches |
There was a problem hiding this comment.
Down in https://github.com/theforeman/foremanctl/pull/570/changes#diff-298320288bbee9edf592c4fb437fe1e71276c3a877b2e3290a2fa26dbd6b9916R157 this uses manage_repo naming but does it on a per plugin basis. What do you think about calling this something like that? e.g. --manage-repos=False
As you aren't simply "preserving branches" you are actually disabling management of the repositories by the tool.
If your intent was just to simply avoid it over-writing the checkout, then I think you'd want to actually set https://github.com/theforeman/foremanctl/blob/master/development/roles/git_repository/tasks/main.yml#L6 in which case it would preserve.
Also, we maybe drop https://github.com/theforeman/foremanctl/blob/master/development/roles/git_repository/tasks/main.yml#L5C18-L5C41 ? or set it to omit unless that variable is set so that it doesn't enforce check out of a particular version.
There was a problem hiding this comment.
My understanding is the Ansible git module can overwrite local commits, and discard uncommitted changes. So skipping the task still seems safest to me.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c68a398 to
373a57d
Compare
Why are you introducing these changes? (Problem description, related links)
When iterating on Foreman or plugin code during development,
forge deploy-devclones and checks out the default branch for each repository, discarding any local branches or changes. There is no way to disable this behavior for subsequent deploys.What are the changes introduced in this pull request?
--manage-reposCLI parameter forforge deploy-devthat controls whether git repositories are cloned and checked out. Set tofalseto skip repository management for both Foreman and plugins.--manage-repos=false, the global setting takes precedence but individual pluginmanage_repoconfig is still respected when the global flag is not set.How to test this pull request
Steps to reproduce:
forge deploy-devto do an initial deployforge deploy-dev --manage-repos=falseand verify repositories are not touchedChecklist