Skip to content

Commit 5bb3b3a

Browse files
authored
refactor: Simplify the module registration and remove the most boilerplate of the code (#61)
* refactor: remove boilerplate and simplify the way for registering modules - Introduced unit tests for the `scoreIconWeaveCandidate` function to validate scoring logic based on various input scenarios. - Added comprehensive tests for `ModuleManager` to ensure proper handling of module lifecycle, including enabling, disabling, and capability changes. - Enhanced registry tests to ensure consistency between module definitions and GSettings schema. - Updated runtime tests to reflect changes in module manifest structure and validation. - Improved schema tests to validate XML structure and ensure all module keys are accounted for. * feat: refactor dev tool UI components and improve modularity - Introduced new utility functions in devToolUi.ts for creating UI components such as action buttons, summary panels, and action rows. - Updated DockDevTool, GeneralDevTool, MeetingClockDevTool, TrayIconsDevTool, WeatherClockDevTool to utilize the new UI component functions, reducing code duplication and enhancing maintainability. - Refactored device detection logic in device.ts for improved clarity and encapsulation of functionality. - Added unit tests for app identity handling in appIdentity.test.ts to ensure correct behavior of app ID candidate generation. * chore: update code structure and remove redundant changes * fix: correct version name in metadata.json to match release version * refactor: simplify CI workflows and remove deprecated container image configuration * chore: update actions to latest versions in CI workflows
1 parent 333bea2 commit 5bb3b3a

105 files changed

Lines changed: 3624 additions & 5635 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
!Containerfile
3+
!package.json
4+
!yarn.lock
5+
!.yarnrc.yml
6+
!.yarn/releases/
7+
!.yarn/releases/**

.github/actions/package-extension/action.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/actions/setup-yarn/action.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 95 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,139 +5,156 @@ on:
55
merge_group:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
packages: write
11+
812
concurrency:
913
group: ci-${{ github.ref }}
1014
cancel-in-progress: true
1115

1216
jobs:
17+
ci-image:
18+
name: CI image
19+
runs-on: ubuntu-latest
20+
outputs:
21+
name: ${{ steps.image.outputs.name }}
22+
steps:
23+
- uses: actions/checkout@v7
24+
25+
- name: Log in to GHCR
26+
uses: docker/login-action@v4
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Resolve CI image
33+
id: image
34+
run: |
35+
IMAGE="$(bash scripts/ci-image-name.sh)"
36+
echo "name=$IMAGE" >> "$GITHUB_OUTPUT"
37+
38+
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
39+
echo "exists=true" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "exists=false" >> "$GITHUB_OUTPUT"
42+
fi
43+
44+
- uses: docker/setup-qemu-action@v4
45+
if: steps.image.outputs.exists != 'true'
46+
47+
- uses: docker/setup-buildx-action@v4
48+
if: steps.image.outputs.exists != 'true'
49+
50+
- name: Build and publish CI image
51+
if: steps.image.outputs.exists != 'true'
52+
uses: docker/build-push-action@v7
53+
with:
54+
context: .
55+
file: Containerfile
56+
platforms: linux/amd64,linux/arm64
57+
push: true
58+
tags: |
59+
${{ steps.image.outputs.name }}
60+
ghcr.io/luminusos/aurora-shell-ci:sha-${{ github.sha }}
61+
cache-from: type=gha
62+
cache-to: type=gha,mode=max
63+
1364
lint:
1465
name: Validate
1566
runs-on: ubuntu-latest
67+
needs: [ci-image]
68+
container:
69+
image: ${{ needs.ci-image.outputs.name }}
70+
credentials:
71+
username: ${{ github.actor }}
72+
password: ${{ secrets.GITHUB_TOKEN }}
1673
steps:
1774
- uses: actions/checkout@v7
1875

19-
- name: Setup Yarn
20-
uses: ./.github/actions/setup-yarn
21-
22-
- name: Install just
23-
uses: extractions/setup-just@v4
76+
- name: Install dependencies
77+
run: just deps
2478

2579
- name: Validate
2680
run: just validate
2781

2882
unit-tests:
2983
name: Unit & regression tests
3084
runs-on: ubuntu-latest
85+
needs: [ci-image]
86+
container:
87+
image: ${{ needs.ci-image.outputs.name }}
88+
credentials:
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GITHUB_TOKEN }}
3191
steps:
3292
- uses: actions/checkout@v7
3393

34-
- name: Setup Yarn
35-
uses: ./.github/actions/setup-yarn
94+
- name: Install dependencies
95+
run: just deps
3696

3797
- name: Run unit tests
38-
run: yarn test:unit
98+
run: just unit-test
3999

40100
build:
41101
name: Build
42102
runs-on: ubuntu-latest
43-
needs: [lint]
103+
needs: [ci-image, lint]
104+
container:
105+
image: ${{ needs.ci-image.outputs.name }}
106+
credentials:
107+
username: ${{ github.actor }}
108+
password: ${{ secrets.GITHUB_TOKEN }}
44109
steps:
45110
- uses: actions/checkout@v7
46111

47-
- name: Package extension
48-
uses: ./.github/actions/package-extension
112+
- name: Install dependencies
113+
run: just deps
114+
115+
- name: Build extension package
116+
run: just package
49117

50118
- name: Upload extension zip
51-
uses: actions/upload-artifact@v4
119+
uses: actions/upload-artifact@v7
52120
with:
53121
name: extension-zip
54122
path: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip
55123
retention-days: 1
56124

57125
integration-tests:
58-
name: Integration tests (GNOME ${{ matrix.gnome-version }})
126+
name: Integration tests
59127
runs-on: ubuntu-latest
60-
needs: [build, unit-tests]
61-
strategy:
62-
fail-fast: false
63-
matrix:
64-
include:
65-
- gnome-version: '50'
66-
container: 'fedora:44'
128+
needs: [ci-image, build, unit-tests]
67129
container:
68-
image: ${{ matrix.container }}
130+
image: ${{ needs.ci-image.outputs.name }}
131+
credentials:
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
69134
options: --privileged
70135
steps:
71136
- uses: actions/checkout@v7
72137

73138
- name: Download extension zip
74-
uses: actions/download-artifact@v4
139+
uses: actions/download-artifact@v8
75140
with:
76141
name: extension-zip
77142
path: dist/target/
78143

79-
- name: Install gnome-shell and test dependencies
80-
run: |
81-
dnf upgrade -y
82-
dnf install -y --setopt=install_weak_deps=False \
83-
gnome-shell \
84-
dbus-daemon \
85-
mesa-dri-drivers \
86-
xorg-x11-server-Xvfb \
87-
python3-dbusmock
88-
89144
- name: Run integration tests
90145
env:
146+
DISPLAY: ':0'
147+
GDK_DEBUG: no-portals
91148
LIBGL_ALWAYS_SOFTWARE: '1'
149+
WAYLAND_DISPLAY: gnome-shell-test-display
92150
XDG_RUNTIME_DIR: /tmp/xdg-runtime
93-
DISPLAY: ':0'
94-
WAYLAND_DISPLAY: 'gnome-shell-test-display'
95-
# gnome-shell-perf-helper is a GTK4 app that times out (~25 s) trying
96-
# to reach org.freedesktop.host.portal.Registry, which is not
97-
# available in a headless test environment. no-portals skips that
98-
# lookup so the helper connects directly to the Wayland display and
99-
# can exit gnome-shell cleanly.
100-
GDK_DEBUG: 'no-portals'
101151
run: |
102-
mkdir -p /tmp/xdg-runtime
103-
chmod 700 /tmp/xdg-runtime
104-
105-
# Start a system D-Bus so GNOME Shell can reach Gio.DBus.system.
152+
install -d -m 0700 "$XDG_RUNTIME_DIR"
106153
mkdir -p /run/dbus
107154
dbus-daemon --system --fork --nopidfile
108-
109-
# Mock org.freedesktop.login1 on the system bus. GNOME Shell 50's
110-
# LoginManagerSystemd and EndSessionDialog create a proxy for this
111-
# name synchronously at startup; without it the session crashes with
112-
# "Launch helper exited with unknown return code 1".
113155
python3 -m dbusmock --system --template logind &
156+
logind_pid=$!
157+
trap 'kill "$logind_pid" 2>/dev/null || true' EXIT
114158
sleep 1
115-
116-
PASS=0; FAIL=0
117-
for script in tests/shell/aurora*.js; do
118-
echo "==> $script"
119-
# dbus-update-activation-environment pushes display vars into the
120-
# session bus daemon so that D-Bus-activated services (e.g.
121-
# xdg-desktop-portal-gtk) inherit them and can connect to the
122-
# Wayland compositor. GDK_DEBUG=no-portals is also propagated so
123-
# that gnome-shell-perf-helper (GTK4) skips the portal registry
124-
# lookup that would otherwise time out in a headless environment.
125-
if dbus-run-session bash -c '
126-
dbus-update-activation-environment \
127-
DISPLAY WAYLAND_DISPLAY XDG_RUNTIME_DIR LIBGL_ALWAYS_SOFTWARE \
128-
GDK_DEBUG
129-
exec gnome-shell-test-tool \
130-
--headless \
131-
--extension dist/target/aurora-shell@luminusos.github.io.shell-extension.zip \
132-
"$1"
133-
' -- "$script"; then
134-
echo " PASS"
135-
PASS=$((PASS + 1))
136-
else
137-
echo " FAIL"
138-
FAIL=$((FAIL + 1))
139-
fi
140-
done
141-
echo ""
142-
echo "Results: $PASS passed, $FAIL failed"
143-
[ "$FAIL" -eq 0 ]
159+
bash scripts/run-shell-tests.sh \
160+
dist/target/aurora-shell@luminusos.github.io.shell-extension.zip

.github/workflows/pre-release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,28 @@ on:
66

77
permissions:
88
contents: write
9+
packages: write
910

1011
concurrency:
1112
group: pre-release-main
1213
cancel-in-progress: true
1314

1415
jobs:
16+
ci:
17+
uses: ./.github/workflows/ci.yml
18+
1519
pre-release:
1620
name: Create nightly pre-release
1721
runs-on: ubuntu-latest
22+
needs: [ci]
1823
steps:
1924
- uses: actions/checkout@v7
2025

21-
- name: Package extension
22-
uses: ./.github/actions/package-extension
26+
- name: Download extension zip
27+
uses: actions/download-artifact@v8
28+
with:
29+
name: extension-zip
30+
path: dist/target/
2331

2432
- name: Read version metadata
2533
id: metadata

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
packages: write
1011

1112
jobs:
1213
ci:
@@ -22,7 +23,7 @@ jobs:
2223
- uses: actions/checkout@v7
2324

2425
- name: Download extension zip
25-
uses: actions/download-artifact@v4
26+
uses: actions/download-artifact@v8
2627
with:
2728
name: extension-zip
2829
path: dist/target/

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ node_modules/
1212

1313
# Build output
1414
dist/
15-
dist-gjsify/
16-
dist-gjsify-probe/
1715

1816
# npm (legacy)
1917
package-lock.json
@@ -42,4 +40,4 @@ docs/
4240

4341
# IA Stuff
4442
.agents/
45-
skills-lock.json
43+
skills-lock.json

0 commit comments

Comments
 (0)