Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.5.0 #2211

Merged
merged 29 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ebfba5
Ignore test directories for coverage (#2158)
s-martin Dec 13, 2023
9dceb84
Adapt pbc.c to current json rpc spec (#1857)
sklemer1 Dec 14, 2023
0e6dbd6
Add docs for command line client for RPC (#2162)
s-martin Dec 19, 2023
9e65de4
Add Workflow Action to build and upload webapp bundle to Release (#2161)
AlvinSchiller Dec 19, 2023
0a5d429
Improve the run_rpc_tool script (#2166)
s-martin Dec 19, 2023
480ce20
Improve Docs: Fix GPIO and add WSL (#2173)
s-martin Dec 21, 2023
ca9b5f1
Cover Art with Cache (#2177)
pabera Dec 22, 2023
eaa7736
Improve docs (#2178)
s-martin Dec 25, 2023
c9b6cd7
Update Pulseaudio docs for Docker on Mac (#2176)
pabera Dec 25, 2023
3a904b5
Activate codeql analysis (#2182)
s-martin Dec 28, 2023
c713610
Reorder 'USER' command (#2199)
votti Jan 2, 2024
c4ee966
add workflow files to paths to trigger run (#2202)
AlvinSchiller Jan 3, 2024
03e64ff
New card actions: play, pause, prev, next, toggle, repeat, shuffle (#…
pabera Jan 4, 2024
6e9e4f7
Add swap file adjustment for webapp build (#2204)
AlvinSchiller Jan 15, 2024
03e6197
[New component] HiFiBerry Sound Card & OnOff SHIM (#2169)
pabera Jan 16, 2024
4f015dd
Create markdown docs from docstring in py files (#2181)
s-martin Jan 16, 2024
6f09764
deactivate kioskmode installation option on armv6 devices (#2217)
AlvinSchiller Jan 18, 2024
f6db160
Update docs (#2216)
AlvinSchiller Jan 24, 2024
1c0afa3
fix the messageboxes (#2223)
s-martin Jan 29, 2024
0aad2a9
Improve Bluetooth docs (#2174)
SKHSKHilber Jan 30, 2024
c306719
Playlists, Livestreams, Podcasts (#2200)
Jan 30, 2024
85587a6
Future3 add login motd with note about venv (#2225)
AlvinSchiller Feb 1, 2024
2bb9367
Minor fixes (#2234)
AlvinSchiller Feb 1, 2024
e1b46b6
Add NFCPy support (#2190)
powertomato Feb 4, 2024
b2a6517
included venv activation for python scripts (#2233)
AlvinSchiller Feb 4, 2024
1e1ae25
prevent installer rerun and remove update path (#2235)
AlvinSchiller Feb 4, 2024
32d57f5
Bump to v3.5.0
pabera Feb 4, 2024
2fe7055
NetworkManager Support (#2218)
AlvinSchiller Feb 4, 2024
20389e3
Allow default value for CoverArtCache path (#2237)
pabera Feb 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = test/*
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ indent_size = 4
[*.md]
trim_trailing_whitespace = false

[*.{js,yaml}]
[*.{js,yaml,yml}]
indent_size = 2
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ extend-exclude =
scratch*,
# Ignore dirs and files that have not been ported yet
*/jukebox/NvManager.py
# ignore GitHub Codespaces
# ignore Python venv's
.venv/*
# ignore node modules
*/node_modules/*
183 changes: 183 additions & 0 deletions .github/workflows/bundle_webapp_and_release_v3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Bundle Webapp and Release

on:
push:
branches:
- 'future3/main'
- 'future3/develop'

jobs:

check:
if: ${{ github.repository_owner == 'MiczFlor' }}
runs-on: ubuntu-latest

outputs:
tag_name: ${{ steps.vars.outputs.tag_name }}
release_type: ${{ steps.vars.outputs.release_type }}
check_abort: ${{ steps.vars.outputs.check_abort }}

steps:
- uses: actions/checkout@v3

- name: Set Output vars
id: vars
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
# Official SemVer Regex definition
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# Needed changes to the regex:
# - '?:' capture command needed to be removed as it wasn't working in shell
# - '\d' had to be replaced with [0-9]
#
# Release versions like 1.0.0, 3.5.0, 100.4.50000+metadata
REGEX_VERSION_RELEASE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
#
# Prerelease versions like 1.0.0-alpha, 3.5.0-whatsoever.12, 100.4.50000-identifier.12+metadata
REGEX_VERSION_PRERELEASE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"


# Get the version and calculate release type
VERSION=$(python ./src/jukebox/jukebox/version.py)
if echo "$VERSION" | grep -qoE "$REGEX_VERSION_RELEASE" ; then
RELEASE_TYPE=release
elif echo "$VERSION" | grep -qoE "$REGEX_VERSION_PRERELEASE" ; then
RELEASE_TYPE=prerelease
else
RELEASE_TYPE=none
fi

if [ "$BRANCH_NAME" == 'future3/main' -a "$RELEASE_TYPE" == 'release' ] || [ "$BRANCH_NAME" == 'future3/develop' -a "$RELEASE_TYPE" == 'prerelease' ] ; then
CHECK_ABORT=false
else
echo "::notice title=Abort due to not matching ${RELEASE_TYPE} version for branch!::'${VERSION}' on '${BRANCH_NAME}'"
CHECK_ABORT=true
fi

echo "::group::Output values"
echo "Version: ${VERSION}"
echo "RELEASE_TYPE: ${RELEASE_TYPE}"
echo "BRANCH_NAME: ${BRANCH_NAME}"
echo "CHECK_ABORT: ${CHECK_ABORT}"

echo "tag_name=v${VERSION}" >> $GITHUB_OUTPUT
echo "release_type=${RELEASE_TYPE}" >> $GITHUB_OUTPUT
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "check_abort=${CHECK_ABORT}" >> $GITHUB_OUTPUT
echo "::endgroup::"

build:
needs: [check]
if: ${{ needs.check.outputs.check_abort == 'false' }}
runs-on: ubuntu-latest

env:
WEBAPP_ROOT_PATH: ./src/webapp

outputs:
tag_name: ${{ needs.check.outputs.tag_name }}
release_type: ${{ needs.check.outputs.release_type }}
commit_sha: ${{ steps.vars.outputs.commit_sha }}
webapp_bundle_name: ${{ steps.vars.outputs.webapp_bundle_name }}
webapp_bundle_name_latest: ${{ steps.vars.outputs.webapp_bundle_name_latest }}

steps:
- uses: actions/checkout@v3

- name: Set Output vars
id: vars
env:
COMMIT_SHA: ${{ github.sha }}
run: |
echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
echo "webapp_bundle_name=webapp-build-${COMMIT_SHA:0:10}.tar.gz" >> $GITHUB_OUTPUT
echo "webapp_bundle_name_latest=webapp-build-latest.tar.gz" >> $GITHUB_OUTPUT

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: npm install
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
run: npm install
- name: npm build
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
env:
CI: false
run: npm run build

- name: Create Bundle
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
run: |
tar -czvf ${{ steps.vars.outputs.webapp_bundle_name }} build

- name: Artifact Upload
uses: actions/upload-artifact@v3
with:
name: ${{ steps.vars.outputs.webapp_bundle_name }}
path: ${{ env.WEBAPP_ROOT_PATH }}/${{ steps.vars.outputs.webapp_bundle_name }}
retention-days: 5

release:
needs: [build]
runs-on: ubuntu-latest

concurrency:
group: ${{ needs.build.outputs.tag_name }}

permissions:
contents: write

steps:
- name: Artifact Download
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.webapp_bundle_name }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
commit: ${{ needs.build.outputs.commit_sha }}
tag: ${{ needs.build.outputs.tag_name }}
body: "Automated Release for ${{ needs.build.outputs.tag_name }}"
makeLatest: 'false'
prerelease: ${{ needs.build.outputs.release_type == 'prerelease' }}
generateReleaseNotes: ${{ needs.build.outputs.release_type == 'release' }}
skipIfReleaseExists: false
allowUpdates: true
removeArtifacts: false
replacesArtifacts: false
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Release by tag
id: get_release
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.build.outputs.tag_name }}

- name: Upload Release Asset
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_name: ${{ needs.build.outputs.webapp_bundle_name }}
asset_path: ${{ needs.build.outputs.webapp_bundle_name }}
asset_content_type: application/gzip
overwrite: true

- name: Upload Release Asset as Latest
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_name: ${{ needs.build.outputs.webapp_bundle_name_latest }}
asset_path: ${{ needs.build.outputs.webapp_bundle_name }}
asset_content_type: application/gzip
overwrite: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "CodeQL v3"

on:
push:
branches: [ develop ]
branches: [ future3/develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [ future3/develop ]
schedule:
- cron: '16 18 * * 0'

Expand All @@ -35,22 +35,37 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
# Install necessary packages
sudo apt-get install libasound2-dev pulseaudio
python -m pip install --upgrade pip
pip install -r requirements.txt
# Set the `CODEQL-PYTHON` environment variable to the Python executable
# that includes the dependencies
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
setup-python-dependencies: false

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +79,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
4 changes: 2 additions & 2 deletions .github/workflows/pythonpackage_future3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
pip3 install -r src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt
pip3 install -r src/jukebox/components/rfid/hardware/rdm6300_serial/requirements.txt
pip3 install -r src/jukebox/components/rfid/hardware/rc522_spi/requirements.txt
- name: Run pytest
- name: Run pytest with coverage
run: |
./run_pytest.sh --cov --cov-report xml
./run_pytest.sh --cov --cov-report xml --cov-config=.coveragerc
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you expect by running it with coverage?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In coveralls.io you can check how much of the code is covered by our unit tests.
The Python GitHub Action runs the tests with coverage.

See the coveralls comment in this PR or other out related PRs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, do we look for more coverage? Should we update the Contribution info as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think generally it's useful to improve the coverage, but from my point of view we should focus on making future3 feature "complete" at this point.

But it probably wouldn't hurt to encourage people in CONTRIBUTING to add unit tests.

- name: Report to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/test_docker_debian_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,29 @@ on:
# run at 17:00 every sunday
- cron: '0 17 * * 0'
push:
branches:
- 'future3/**'
paths:
- '.github/workflows/test_docker_debian*.yml'
- 'installation/**'
- 'ci/**'
- 'resources/**'
- 'src/jukebox/jukebox/version.py'
- 'packages*.txt'
- 'requirements*.txt'
pull_request:
# The branches below must be a subset of the branches above
branches: [ future3/develop ]
branches:
- future3/develop
- future3/main
paths:
- '.github/workflows/test_docker_debian*.yml'
- 'installation/**'
- 'ci/**'
- 'resources/**'
- 'src/jukebox/jukebox/version.py'
- 'packages*.txt'
- 'requirements*.txt'

# let only one instance run the test so cache is not corrupted.
# cancel already running instances as only the last run will be relevant
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/shared/logs/*.log*
/shared/*.*
/shared/*
/src/webapp/public/cover-cache/*.*

# Application
/src/cli_client/pbc
Expand Down
2 changes: 1 addition & 1 deletion ci/installation/run_install_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export ENABLE_WEBAPP_PROD_DOWNLOAD=true
# n - setup rfid reader
# y - setup samba
# y - setup webapp
# n - setup kiosk mode
# - - install node (forced WebApp Download)
# n - setup kiosk mode
# n - reboot

"${LOCAL_INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
Expand Down
2 changes: 1 addition & 1 deletion ci/installation/run_install_faststartup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ LOCAL_INSTALL_SCRIPT_PATH="${LOCAL_INSTALL_SCRIPT_PATH%/}"
# n - setup rfid reader
# n - setup samba
# n - setup webapp
# - - setup kiosk mode (only with webapp = y)
# - - install node (only with webapp = y)
# - - setup kiosk mode (only with webapp = y)
# n - reboot

"${LOCAL_INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
Expand Down
2 changes: 1 addition & 1 deletion ci/installation/run_install_libzmq_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export BUILD_LIBZMQ_WITH_DRAFTS_ON_DEVICE=true
# n - setup rfid reader
# n - setup samba
# n - setup webapp
# - - setup kiosk mode (only with webapp = y)
# - - install node (only with webapp = y)
# - - setup kiosk mode (only with webapp = y)
# n - reboot

"${LOCAL_INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
Expand Down
4 changes: 2 additions & 2 deletions ci/installation/run_install_webapp_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ SCRIPT_DIR="$(dirname "$SOURCE")"
LOCAL_INSTALL_SCRIPT_PATH="${INSTALL_SCRIPT_PATH:-${SCRIPT_DIR}/../../installation}"
LOCAL_INSTALL_SCRIPT_PATH="${LOCAL_INSTALL_SCRIPT_PATH%/}"

export ENABLE_WEBAPP_PROD_DOWNLOAD=true
# Run installation (in interactive mode)
# y - start setup
# n - use static ip
Expand All @@ -23,8 +22,8 @@ export ENABLE_WEBAPP_PROD_DOWNLOAD=true
# n - setup rfid reader
# n - setup samba
# y - setup webapp
# n - install node
# y - setup kiosk mode
# - - install node (forced webapp download)
# n - reboot

"${LOCAL_INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
Expand All @@ -36,6 +35,7 @@ n
n
n
y
n
y
n
'
2 changes: 1 addition & 1 deletion ci/installation/run_install_webapp_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export ENABLE_WEBAPP_PROD_DOWNLOAD=false
# n - setup rfid reader
# n - setup samba
# y - setup webapp
# y - setup kiosk mode
# y - install node
# y - setup kiosk mode
# n - reboot

"${LOCAL_INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
tty: true
volumes:
- ../src/jukebox:/root/RPi-Jukebox-RFID/src/jukebox
- ../src/webapp/public/cover-cache:/root/RPi-Jukebox-RFID/src/webapp/build/cover-cache
- ../shared:/root/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf
command: python run_jukebox.py
Expand Down
Loading