Skip to content

Commit b488e33

Browse files
its-mashMohammod Al Amin Ashik
andauthored
Feature/autostart system tray (#38)
Co-authored-by: Mohammod Al Amin Ashik <alamin.ashik@sitecore.com>
1 parent d355c68 commit b488e33

28 files changed

Lines changed: 1589 additions & 147 deletions

File tree

.github/GIT_HOOKS.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Git Hooks
2+
3+
This project uses Git hooks to maintain code quality and prevent CI failures.
4+
5+
## Pre-commit Hook
6+
7+
The pre-commit hook automatically runs before each commit to validate:
8+
9+
### **Rust Validation**
10+
- Formats Rust code with `cargo fmt`
11+
- Runs `cargo clippy --workspace -- -D warnings` to catch linting issues
12+
- Runs `cargo check --workspace` to verify compilation
13+
- Automatically adds formatted files to the commit
14+
15+
### **TypeScript Validation**
16+
- Runs `pnpm lint` to check code style and catch common errors
17+
- Runs `pnpm typecheck` to verify type correctness
18+
- Checks all TypeScript files in the workspace
19+
20+
## Setup
21+
22+
The hook is automatically set up when you:
23+
1. Clone the repository
24+
2. Run `pnpm install` (triggers `prepare` script)
25+
26+
### Manual Setup
27+
28+
If the hook isn't working, run:
29+
30+
```bash
31+
# Make hook executable (Linux/Mac)
32+
chmod +x .git/hooks/pre-commit
33+
34+
# Windows (PowerShell)
35+
icacls ".git\hooks\pre-commit" /grant Everyone:RX
36+
```
37+
38+
## Testing the Hook
39+
40+
To test the validation without committing:
41+
42+
```bash
43+
# Run both checks
44+
pnpm validate
45+
46+
# Or individually
47+
cargo clippy --workspace -- -D warnings
48+
cargo check --workspace
49+
pnpm lint
50+
pnpm typecheck
51+
```
52+
53+
## Bypassing the Hook (Not Recommended)
54+
55+
In rare cases where you need to bypass validation:
56+
57+
```bash
58+
git commit --no-verify -m "your message"
59+
```
60+
61+
**Note**: Only use `--no-verify` when absolutely necessary, as it skips important validations that prevent CI failures.
62+
63+
## Troubleshooting
64+
65+
### Hook not running
66+
- Ensure `.git/hooks/pre-commit` exists
67+
- Check it's executable: `ls -la .git/hooks/pre-commit`
68+
- Try manual setup commands above
69+
70+
### Hook fails on Windows
71+
- The hook uses bash scripting (requires Git Bash or WSL)
72+
- Alternatively, use the PowerShell version: `.git/hooks/pre-commit.ps1`
73+
- Configure Git to use PowerShell hooks:
74+
```powershell
75+
git config core.hooksPath .git/hooks
76+
```
77+
78+
### Slow validation
79+
- The hook only validates files in your commit (staged changes)
80+
- If you have many Rust crates, consider using `cargo check -p <crate-name>`
81+
- TypeScript check runs on entire workspace (necessary for type consistency)
82+
83+
## CI Integration
84+
85+
These same checks run in CI:
86+
- GitHub Actions runs `cargo check` and `pnpm typecheck`
87+
- Pre-commit hooks help catch issues early before pushing

.github/actions/install-linux-deps/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ runs:
1616
- name: Cache apt packages (base)
1717
uses: awalsh128/cache-apt-pkgs-action@latest
1818
with:
19-
packages: build-essential pkg-config libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
20-
version: 1.0
19+
packages: build-essential pkg-config libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev libfuse2
20+
version: 1.1
2121

2222
- name: Cache apt packages (E2E)
2323
if: ${{ inputs.e2e == 'true' }}
2424
uses: awalsh128/cache-apt-pkgs-action@latest
2525
with:
26-
packages: webkit2gtk-driver xvfb gnome-keyring gsettings-desktop-schemas dbus-x11 at-spi2-core libglib2.0-bin
27-
version: 1.2
26+
packages: webkit2gtk-driver xvfb gnome-keyring gsettings-desktop-schemas dbus-x11 at-spi2-core libglib2.0-bin libwayland-server0 libwayland-client0
27+
version: 1.3
2828

2929
# Compile gsettings schemas (required after restore from cache)
3030
- name: Compile gsettings schemas

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ jobs:
242242
- run: pnpm build
243243
env:
244244
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
245+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
245246

246247
# ─────────────────────────────────────────────────────────────
247248
# Test Results Report (separate checks per test type and OS)

.github/workflows/e2e-desktop.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
secrets:
1313
TAURI_SIGNING_PRIVATE_KEY:
1414
required: false
15+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD:
16+
required: false
1517

1618
env:
1719
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
@@ -95,11 +97,20 @@ jobs:
9597
9698
- run: pnpm install --frozen-lockfile
9799

98-
- name: Build app
99-
run: pnpm build
100+
- name: Build app (Linux)
101+
if: matrix.os == 'ubuntu-latest'
102+
run: pnpm --filter @mcpmux/desktop exec tauri build --bundles deb,rpm,updater
100103
env:
101104
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
102105
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
106+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
107+
108+
- name: Build app (Windows)
109+
if: matrix.os == 'windows-latest'
110+
run: pnpm build
111+
env:
112+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
113+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
103114

104115
- name: Run desktop E2E tests (Linux)
105116
if: matrix.os == 'ubuntu-latest'

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
- run: pnpm build
5858
env:
5959
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
60+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
6061
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
6162

6263
- name: Upload artifacts

Cargo.lock

Lines changed: 112 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)