Developing for FreedomBox
WorkFlow index
* Preparation:
- Salsa:
- Create account
- Fork project repository to your own namespace.
- Complete (optional for the moment):
- SSH Keys for better security.
- GPG Keys to sign commits.
* Contribution:
- Issue selection (see HACKING.md and CONTRIBUTING.md).
- Refresh code baseline:
- Clone to local (See HACKING.md. 1st time only).
- Refresh local master from upstream.
- Create new issue branch.
- Rebase local issue branch.
- Create issue-branch from another one's commit.
- Code.
- Test unit.
- Code.
- Refactor.
- Yapf, Sort and Flake8.
- Test functional.
- Release:
- Commit
- Push to Salsa (to origin(your fork) , not to upstream Freedom-team's repo).
- Check CI.
- Request merge.
- Close:
- Delete issue branch:
- local
- Salsa
- Delete issue branch:
Preparation
- Salsa:
- Create account
- Fork project repository to your own namespace.
- Complete (optional for the moment):
- SSH Keys for better security.
- Keygen
- Upload SSH pubKey to your profile in Salsa.
- Configure ssh to use your-salsa-guest-account instead of your local username and your ssh key instead of asking you for your password:
$ cat ~/.ssh/config host salsa HostName salsa.debian.org IdentityFile ~/.ssh/id_ed25519 User <your-salsa-guest-account>
- Configure git to use the ssh config for para your-salsa-guest-account/freedombox.git:
$ git remote add upstream https://salsa.debian.org/freedombox-team/freedombox.git $ git remote set-url origin git@salsa:/your-salsa-guest-account/freedombox.git $ git remote set-url --push origin git@salsa:/your-salsa-guest-account/freedombox.git $ git remote -v origin git@salsa:/your-salsa-guest-account/freedombox.git (fetch) origin git@salsa:/your-salsa-guest-account/freedombox.git (push) upstream https://salsa.debian.org/freedombox-team/freedombox.git (fetch) upstream https://salsa.debian.org/freedombox-team/freedombox.git (push)
GPG Keys to sign commits.
- Create key on PC
$ gpg --full-gen-key # Default algorythm, length=4096, eternal, name, email, passphrase
- Register pubKey in Salsa
$ gpg --list-secret-keys --keyid-format LONG <your.email@domain.name> # find the 16 character long id, like <6E93A11BABA66613> $ gpg --armor --export <6E93A11BABA66613>
Copy blob and paste it to Salsa. - Configure git in local repo to use your-salsa-guest-account for email instead of your PC user's:
$ git config --local user.email "<your-guest-account@salsa.etc>" $ git config -l # lists the configuration $ cat {repo}/.git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = git@salsa:/your-salsa-guest-account/freedombox.git fetch = +refs/heads/*:refs/remotes/origin/* pushurl = git@salsa:/your-salsa-guest-account/freedombox.git [branch "master"] remote = origin merge = refs/heads/master [remote "upstream"] url = https://salsa.debian.org/freedombox-team/freedombox.git fetch = +refs/heads/*:refs/remotes/upstream/* [user] signingkey = <6E93A11BABA66613>
- Create key on PC
- SSH Keys for better security.
Contribution
Issue selection
See HACKING.md and CONTRIBUTING.md).
Refresh code baseline
Clone to local (see HACKING.md. 1st time only).
- Refresh local master from upstream:
Get rid of pending changes (See git stash) and
$ git checkout master # changes to your local master branch. $ git fetch upstream master # downloads latest upstream master branch. $ git rebase upstream/master # rebasess your local master with the upstream changes. $ git push origin master # uploads the changes to the master branch of your fork in Salsa.
You should see in Salsa the master branch of your fork updated. Most visual in Repository-> Graph.
- Create new issue branch.
$ git branch <your-issue-branch> # Check... $ git branch
- Rebase local issue branch
# with up to date local master branch... $ git checkout <your-issue-branch>. $ git rebase master
- Create issue-branch from another one's merge request:
taking from GitLab (Salsa): $ git fetch upstream merge-requests/<MRid>/head:<BranchName>
taking from GitHub : $ git fetch upstream pull/<pullId>/head:<BranchName>
Code
- Test unit.
- Code.
- Refactor.
- Yapf, Sort and Flake8.
- Test functional.
Release
- Commit
- Push to Salsa (to origin=your fork, not to upstream Freedom-team's repo):
If you are appending commits: $ git push origin <your-issue-branch>
If you are changing history (rebase, ammends, etc): $ git push origin <your-issue-branch> --force.
- Check CI:
Go to Repository->Branches.
- Circle with a blue sector means CI is in progress.
- Circled red x means it failed.
- Green Checkmark means it passed.
- CI first shows a diagram with phases and their status. Clicking on them takes you to the logs.
Request merge: Salsa has a button in Repository->Branches.
Close
After your merge request got accepted you can...
- delete issue branch:
local: $ git branch -d <old-branch-name>
Salsa: Salsa has a trash-bin button in Repository->Branches.
