Skip to content

Extract git repo management to a separate role#374

Merged
ehelms merged 5 commits intotheforeman:masterfrom
adamruzicka:git-repo
Feb 19, 2026
Merged

Extract git repo management to a separate role#374
ehelms merged 5 commits intotheforeman:masterfrom
adamruzicka:git-repo

Conversation

@adamruzicka
Copy link
Contributor

This consolidates the behaviour in one place (currently there are two uses, #373 will add another four, if accepted). The default behavour should be the same as before, but this should allow us to do some extra things.

The extras:

./forge deploy-dev \
    --foreman-development-github-username adamruzicka \
    -e deploy_git_repository_remote_name=upstream \
    -e deploy_git_repository_secondary_remote_name=origin

On the machine

$ cd ~/foreman; git remote -v
origin	git@github.com:adamruzicka/foreman.git (fetch)
origin	git@github.com:adamruzicka/foreman.git (push)
upstream	https://github.com/theforeman/foreman (fetch)
upstream	https://github.com/theforeman/foreman (push)

When deploying stuff myself I usually use upstream remote for the theforeman repositories and origin for my fork. If I occasionally add someone else's remote, then I use their handle. The current way of theforeman repositories being origin and my forks being adamruzicka throws me off for two reasons - muscle memory is strong and my github handle is way too long.

@adamruzicka adamruzicka force-pushed the git-repo branch 2 times, most recently from 1ab99f7 to 6c22577 Compare February 16, 2026 08:17
| `git_repository_destination_dir` | Path to the directory where the repository will be cloned to | Yes |
| `git_repository_secondary_remote_owner` | Name of the owner of the secondary remote to be added to the local clone | No, secondary remote will not be added if left blank |
| `git_repository_secondary_remote_name` | Name of the remote of the secondary repository | No, defaults to `{{ git_repository_secondary_remote_owner }}` |
| `git_repository_user` | The owner of the git checkout | Yes |
Copy link
Member

Choose a reason for hiding this comment

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

Maybe mention that this is the system user?

@ehelms ehelms merged commit 68a5acf into theforeman:master Feb 19, 2026
10 checks passed
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

Comments