Skip to content

Commit ee9a6f3

Browse files
Improve AppIndicator and D-Bus diagnostics in CI setup
Adds a debug script for AppIndicator issues, enhances D-Bus session validation, and improves AppIndicator service checks in the virtual desktop setup and post-CI scripts. These changes provide better diagnostics and reliability for CI environments using MATE/XFCE with AppIndicator support.
1 parent 5399878 commit ee9a6f3

File tree

4 files changed

+109
-6
lines changed

4 files changed

+109
-6
lines changed

actions/setup_virtual_desktop/action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,18 @@ runs:
133133
echo "::group::Test AppIndicator"
134134
# Test ayatana-appindicator (only on MATE/XFCE which have indicator support)
135135
if [[ "$ENVIRONMENT" == "mate" ]] || [[ "$ENVIRONMENT" == "xfce" ]]; then
136-
python3 "${GITHUB_ACTION_PATH}/test_appindicator.py" &
137-
APPIND_PID=$!
138-
${SCREENSHOT_PATH} --output-path=05-appindicator.png --delay=1000
139-
kill $APPIND_PID 2>/dev/null || true
136+
echo "::group::AppIndicator Debug Info"
137+
bash "${GITHUB_ACTION_PATH}/debug_indicators.sh"
138+
echo "::endgroup::"
139+
140+
echo "Testing AppIndicator support..."
141+
if python3 "${GITHUB_ACTION_PATH}/test_appindicator.py"; then
142+
echo "AppIndicator test completed successfully"
143+
${SCREENSHOT_PATH} --output-path=05-appindicator.png --delay=500
144+
else
145+
echo "::error::AppIndicator test failed"
146+
exit 1
147+
fi
140148
else
141149
echo "Skipping AppIndicator test (not supported on ${ENVIRONMENT})"
142150
fi
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# Debug script to check AppIndicator environment
3+
4+
echo "=== AppIndicator Debug Information ==="
5+
echo ""
6+
7+
echo "1. Checking if indicator service is running:"
8+
ps aux | grep -E "(ayatana-indicator|indicator-application)" | grep -v grep || echo " No indicator service found"
9+
echo ""
10+
11+
echo "2. Checking D-Bus session:"
12+
echo " DBUS_SESSION_BUS_ADDRESS: ${DBUS_SESSION_BUS_ADDRESS:-NOT SET}"
13+
echo ""
14+
15+
echo "3. Checking if indicator service is on D-Bus:"
16+
dbus-send --session --dest=org.freedesktop.DBus --print-reply /org/freedesktop/DBus \
17+
org.freedesktop.DBus.ListNames 2>/dev/null | grep -i indicator || echo " No indicator service registered on D-Bus"
18+
echo ""
19+
20+
echo "4. Checking GObject Introspection typelibs:"
21+
if [ -f "/usr/lib/x86_64-linux-gnu/girepository-1.0/AyatanaAppIndicator3-0.1.typelib" ]; then
22+
echo " ✓ AyatanaAppIndicator3-0.1.typelib found"
23+
else
24+
echo " ✗ AyatanaAppIndicator3-0.1.typelib NOT found"
25+
fi
26+
echo ""
27+
28+
echo "5. Checking panel processes:"
29+
ps aux | grep -E "(mate-panel|xfce4-panel)" | grep -v grep || echo " No panel found"
30+
echo ""
31+
32+
echo "6. Checking DISPLAY:"
33+
echo " DISPLAY: ${DISPLAY:-NOT SET}"
34+
echo ""
35+
36+
echo "7. Testing simple indicator registration:"
37+
python3 -c "
38+
import gi
39+
gi.require_version('AyatanaAppIndicator3', '0.1')
40+
from gi.repository import AyatanaAppIndicator3 as AppIndicator
41+
print(' ✓ Python can import AyatanaAppIndicator3')
42+
indicator = AppIndicator.Indicator.new('test', 'mail-message-new', AppIndicator.IndicatorCategory.APPLICATION_STATUS)
43+
print(' ✓ Created indicator object')
44+
indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE)
45+
print(' ✓ Set indicator status to ACTIVE')
46+
" 2>&1 || echo " ✗ Failed to create indicator"
47+
48+
echo ""
49+
echo "=== End Debug Information ==="

actions/setup_virtual_desktop/post-ci.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ fi
1212

1313
echo "✓ DISPLAY is set to: $DISPLAY"
1414

15+
# Check D-Bus session address is set
16+
echo ""
17+
echo "Checking D-Bus session..."
18+
if [[ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
19+
echo "✗ DBUS_SESSION_BUS_ADDRESS is not set"
20+
exit 1
21+
fi
22+
23+
echo "✓ DBUS_SESSION_BUS_ADDRESS is set to: $DBUS_SESSION_BUS_ADDRESS"
24+
25+
# Verify D-Bus is working
26+
if dbus-send --session --dest=org.freedesktop.DBus --print-reply /org/freedesktop/DBus \
27+
org.freedesktop.DBus.ListNames >/dev/null 2>&1; then
28+
echo "✓ D-Bus session is responding"
29+
else
30+
echo "✗ D-Bus session is not responding"
31+
exit 1
32+
fi
33+
1534
# Check if X server is responding
1635
if xdpyinfo > /dev/null 2>&1; then
1736
echo "✓ X server is responding"
@@ -77,5 +96,24 @@ if [[ "$PANEL_FOUND" = false ]]; then
7796
exit 1
7897
fi
7998

99+
# Check for AppIndicator service (MATE/XFCE only)
100+
echo ""
101+
echo "Checking for AppIndicator service..."
102+
if pgrep -f "ayatana-indicator-application-service" > /dev/null 2>&1; then
103+
echo "✓ AppIndicator service is running"
104+
105+
# Verify it's registered on D-Bus
106+
if dbus-send --session --dest=org.freedesktop.DBus --print-reply /org/freedesktop/DBus \
107+
org.freedesktop.DBus.ListNames 2>/dev/null | grep -q "com.canonical.indicator.application"; then
108+
echo "✓ AppIndicator service is registered on D-Bus"
109+
else
110+
echo "⚠ AppIndicator service running but not registered on D-Bus"
111+
fi
112+
elif pgrep -x "mate-session" > /dev/null 2>&1 || pgrep -x "xfce4-session" > /dev/null 2>&1; then
113+
echo "⚠ MATE/XFCE session detected but AppIndicator service not running"
114+
else
115+
echo "ℹ AppIndicator service not expected (not MATE/XFCE environment)"
116+
fi
117+
80118
echo ""
81119
echo "Virtual desktop validation successful!"

actions/setup_virtual_desktop/setup_desktop.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,17 @@ echo "DISPLAY=:${DISPLAY_NUM}" >> "$GITHUB_ENV"
204204

205205
# Start D-Bus session (required for notifications and accessibility)
206206
echo -e "${BLUE}Starting D-Bus session...${RESET}"
207-
if ! pgrep -x "dbus-daemon" > /dev/null; then
208-
eval "$(dbus-launch --sh-syntax)"
207+
208+
# Always start a new D-Bus session for this workflow
209+
# Don't try to reuse existing dbus-daemon as it may not have the correct session address
210+
eval "$(dbus-launch --sh-syntax)"
211+
212+
if [[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
213+
echo -e "${GREEN}✓ D-Bus session started${RESET}"
209214
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> "$GITHUB_ENV"
215+
else
216+
echo -e "${RED}Error: Failed to start D-Bus session${RESET}" >&2
217+
exit 1
210218
fi
211219

212220
# Start AT-SPI bus to fix accessibility warnings

0 commit comments

Comments
 (0)