Note
This describes contributing for version 2.x. For Version 3 please see https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/future3/main/CONTRIBUTING.md
Contributors have played a bigger role over time to keep Phoniebox on the edge of innovation :)
We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
Development is done on the git branch develop
. How to move to that branch, see below.
- Make sure you have a GitHub account.
- Open an issue if one does not already exist.
- Clearly describe the issue including steps to reproduce when it is a bug.
- Make sure you fill in the earliest version that you know has the issue.
- Use the online line install script to get the box installed.
- By default this will get you to the
master
branch. You will move to thedevelop
branch, do this:
cd /home/pi/RPi-Jukebox-RFID
git checkout develop
git fetch origin
git reset --hard origin/develop
git pull
The preferred way of code contributions are pull requests (follow this link for a small howto). And ideally pull requests using the "running code" on the develop
branch of your Phoniebox. Alternatively, feel free to post tweaks, suggestions and snippets in the "issues" section.
Please check also our Code of Conduct.
- Create a topic branch from where you want to base your work.
- This is usually the
develop
branch. - Only target release branches (i.e.
master
) if you are certain your fix must be on that branch. - To quickly create a topic branch based on master, run
git checkout -b fix/master/my_contribution master
. Please avoid working directly on themaster
branch.
- This is usually the
- Make commits of logical and atomic units.
- Check for unnecessary whitespace with
git diff --check
before committing.
Added shuffle mode and RFID controls for it (issue #130) #140
Adds a shuffle mode for MPD to be triggered by RFID card.
The shuffle mode stays permanently active until deactivation (also after shutdown and reboot).
That is why i decided to automatically set random off (if currently active) during shutdown
and reboot.
Scenario: You use your toddlers phoniebox as party jukebox in the evening and shuffle over
folders with your music and forget to deactivate the shuffle mode.
Next morning your toddler gets crazy because his preferred fairytale plays the chapters in
random mode => Therefore the automatism
Update: This time without the need to create an extra random.txt file.and uptodate with the
master branch.
For changes of a trivial nature, it is not always necessary to create a new issue.
In this case, it is appropriate to start the first line of a
commit with one of (docs)
, (maint)
, or (packaging)
instead of a ticket
number.
For commits that address trivial repository maintenance tasks or packaging
issues, start the first line of the commit with (maint)
or (packaging)
,
respectively.
- Push your changes to a topic branch in your fork of the repository.
- Submit a pull request to the repository.
- The core team looks at Pull Requests on a regular basis.
- After feedback has been given we expect responses within two weeks. After two weeks we may close the pull request if it isn't showing any activity.
By running tests in advance and by engaging with peer review for prospective changes, your contributions have a high probability of becoming long lived parts of the the project. After being merged, the code will run through a series of testings. These Tests can reveal incompatibilities that are difficult to detect in advance.
If the code change results in a test failure, we will make our best effort to correct the error. If a fix cannot be determined and committed within 24 hours of its discovery, the commit(s) responsible may be reverted, at the discretion of the committer and Phonie maintainers. The original contributor will be notified of the revert.
- Changes resulting in test failures will be reverted if they cannot be resolved within one business day.
- All code has to run under the stable and legacy version of Raspberry Pi OS (please check if currently even an older version is still supported).
- For GPIO all code should work with RPi.GPIO. gpiozero is currently not intended to use.
- Files & folder names
- all lower case
- separate words with dashes
-
(less keystrokes, better autocomplete recognition, in HTML links dashes can not be confused) not camel/PascalCaps or underscores - be descriptive in your wording (e.g.
raspberry
, notjuicy-red-thing
) - move from general to specific (e.g.
food-fruit-raspberry
, notraspberry-food-fruit
) - unique and clear product IDs (e.g. MAX7219)
- the product ID should be written as is (no lowercase)
- the product ID should come last in a descriptive name (e.g. dot-matrix-module-MAX7219)
- be consistent and look at existing examples before you invent something new
README.md
- written in capital letters, so it's easier to spot
- every new folder of a component deserves a
README.md
file
Inside the root folder or the repo, these folders are important:
scripts
- this folder should contain only actively used scripts (controlling playout, rfid tiggers, etc.)
- some possible services and features might live in the components directory (see below)
- if one or more scripts are needed for the activation of a component (like daemons), they should be copied to the
scripts
directory during installation / activation - WHY? By copying, changes will NOT affect the github repo and make it easier for users to modify their components
components
- contains sub- und subsubfolders for additional features, services, hardware
- subfolders are for categories (e.g. displays, soundcards) and are plural, even if there is only one
- subsubfolders are specific hardware, services, features, protocols, etc.