Skip to content

Commit 9907d01

Browse files
authored
Merge branch 'SteamClientHomebrew:main' into ruststats-extension
2 parents 8a90cba + 3ec44dd commit 9907d01

27 files changed

Lines changed: 287 additions & 274 deletions

.github/workflows/ci.yml

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,6 @@ jobs:
2525
persist-credentials: true
2626
fetch-depth: 0
2727

28-
- name: Install Database SDK
29-
id: install-db-sdk
30-
run: |
31-
sudo apt-get update
32-
sudo apt-get install apt-transport-https ca-certificates gnupg curl
33-
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
34-
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
35-
sudo apt-get update && sudo apt-get install google-cloud-cli
36-
37-
# Create a directory to cache the SDK installation
38-
mkdir -p ~/.google-cloud-sdk
39-
cp -r /usr/lib/google-cloud-sdk/* ~/.google-cloud-sdk/
40-
echo "sdk-path=$(realpath ~/.google-cloud-sdk)" >> $GITHUB_OUTPUT
41-
42-
- name: Cache Database SDK
43-
uses: actions/cache@v3
44-
with:
45-
path: ~/.google-cloud-sdk
46-
key: ${{ runner.os }}-google-cloud-sdk-${{ hashFiles('**/google-cloud-sdk/**') }}
47-
restore-keys: |
48-
${{ runner.os }}-google-cloud-sdk-
49-
5028
- name: Upload Build Scripts
5129
uses: actions/upload-artifact@v4
5230
with:
@@ -63,26 +41,14 @@ jobs:
6341
6442
echo "submodule-matrix=$(cat submodules.json)" >> $GITHUB_OUTPUT
6543
66-
- name: Update README stats
67-
run: |
68-
STAT_OUTPUT=$(bash ./scripts/_stat.sh)
69-
70-
# Replace everything from "## Repository Manifest" to end of file
71-
BEFORE=$(sed '/^## Repository Manifest$/,$d' README.md)
72-
printf '%s\n%s\n' "$BEFORE" "$STAT_OUTPUT" > README.md
73-
7444
- name: Commit Metadata
7545
if: github.event_name != 'pull_request' && github.event.repository.fork == false
7646
run: |
7747
git config --global user.name 'github-actions[bot]'
7848
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
49+
git add metadata.json
7950
80-
# Stage the changes
81-
git add metadata.json README.md
82-
83-
# Commit only if there are changes
8451
if git commit -m "chore: Add plugin metadata"; then
85-
# Push only if the commit succeeded
8652
git push
8753
else
8854
echo "::debug::No changes to commit."
@@ -110,26 +76,13 @@ jobs:
11076
with:
11177
node-version: "20"
11278

113-
- name: Restore Database SDK from Cache
114-
uses: actions/cache@v3
79+
- name: Set up SSH
80+
uses: webfactory/ssh-agent@v0.9.0
11581
with:
116-
path: ~/.google-cloud-sdk
117-
key: ${{ runner.os }}-google-cloud-sdk-${{ hashFiles('**/google-cloud-sdk/**') }}
118-
restore-keys: |
119-
${{ runner.os }}-google-cloud-sdk-
120-
121-
- name: Setup Database SDK Path
122-
run: |
123-
echo "PATH=$PATH:~/.google-cloud-sdk/bin" >> $GITHUB_ENV
124-
gcloud --version
82+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
12583

126-
- name: Authenticate to Database
127-
env:
128-
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
129-
run: |
130-
echo "${GCP_SERVICE_ACCOUNT_KEY}" > gcloud-key.json
131-
gcloud auth activate-service-account --key-file=gcloud-key.json
132-
gcloud config set project steam-brew
84+
- name: Add server to known hosts
85+
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
13386

13487
- name: Download Build Scripts
13588
uses: actions/download-artifact@v4
@@ -156,8 +109,10 @@ jobs:
156109
id: prepare-distribution
157110
run: bash ./scripts/build/prepare-dist.sh --silent
158111

159-
- name: Upload to database
112+
- name: Upload to server
160113
run: bash ./scripts/build/upload-dist.sh ${{ env.PLUGIN_NAME }}
114+
env:
115+
SSH_HOST: ${{ secrets.SSH_HOST }}
161116

162117
- name: Upload Plugin Artifact
163118
uses: actions/upload-artifact@v4
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, ready_for_review, reopened]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40+
plugins: 'code-review@claude-code-plugins'
41+
prompt: 'Review this PR following the instructions in CLAUDE.md.'
42+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
43+
# or https://code.claude.com/docs/en/cli-reference for available options
44+

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+
# prompt: 'Update the pull request description to include a summary of changes.'
45+
46+
# Optional: Add claude_args to customize behavior and configuration
47+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+
# or https://code.claude.com/docs/en/cli-reference for available options
49+
# claude_args: '--allowed-tools Bash(gh pr:*)'
50+

.github/workflows/comment.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Mass comment
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
message:
6+
description: "Comment to post on all open PRs"
7+
required: true
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Comment on all open PRs
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
gh pr list --state open --limit 1000 --json number --jq '.[].number' | \
19+
while read num; do
20+
gh pr comment "$num" --body "${{ github.event.inputs.message }}"
21+
done

.gitmodules

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
[submodule "plugins/adamraichu.auto-accept-custom-launch-args"]
55
path = plugins/adamraichu.auto-accept-custom-launch-args
66
url = https://github.com/AdamRaichu/auto-accept-custom-launch-args
7-
[submodule "plugins/steamdb"]
8-
path = plugins/steamdb
9-
url = https://github.com/BossSloth/Steam-SteamDB-extension
10-
[submodule "plugins/augmented-steam"]
11-
path = plugins/augmented-steam
12-
url = https://github.com/BossSloth/AugmentedSteam-Extension-Plugin
137
[submodule "plugins/millennium-faceit-stats"]
148
path = plugins/millennium-faceit-stats
159
url = https://github.com/alowave/millennium-faceit-stats
@@ -39,10 +33,10 @@
3933
url = https://github.com/luthor112/steam-collections-plus.git
4034
[submodule "plugins/non-steam-playtimes"]
4135
path = plugins/non-steam-playtimes
42-
url = https://github.com/apteryxxyz/steam-non-steam-playtimes
36+
url = https://github.com/k0d13/steam-non-steam-playtimes
4337
[submodule "plugins/fullscreen-notifications-fix"]
4438
path = plugins/fullscreen-notifications-fix
45-
url = https://github.com/apteryxxyz/steam-plugin-fullscreen-notifications-fix
39+
url = https://github.com/k0d13/steam-fullscreen-notifications-fix
4640
[submodule "plugins/csstats-extension"]
4741
path = plugins/csstats-extension
4842
url = https://github.com/TOR968/csstats-extension.git

CLAUDE.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Millennium Plugin Database
2+
3+
This repository contains community plugins for [Millennium](https://steambrew.app/), a Steam client modding platform. Each subdirectory under `plugins/` is an independent plugin. Plugins are added as git submodules.
4+
5+
## Cloning Plugin Source for Review
6+
7+
Plugins in this repo are git submodules pointing to external repositories. The submodule files may not be checked out in CI. To review plugin code:
8+
9+
1. Look at the PR diff to find the submodule entry being added or updated (check `.gitmodules` and the submodule path under `plugins/`).
10+
2. Use `git` or `gh` to determine the plugin's source repository URL and commit SHA from the PR diff.
11+
3. Clone the plugin repository yourself and check out the correct commit:
12+
```bash
13+
git clone <repo-url> /tmp/plugin-review
14+
cd /tmp/plugin-review
15+
git checkout <commit-sha>
16+
```
17+
4. Review the plugin source code from there.
18+
19+
Do NOT skip the review because submodule files aren't available locally. Always clone and inspect the actual plugin code.
20+
21+
## PR Review Instructions
22+
23+
When reviewing pull requests that add or update plugins, perform the following checks thoroughly. Be direct and specific in your feedback.
24+
25+
### Security Review
26+
27+
- Audit all network requests (fetch, XMLHttpRequest, WebSocket) for data exfiltration, SSRF, or connections to suspicious/hardcoded external endpoints.
28+
- Check for unsafe use of `eval()`, `Function()`, `innerHTML`, `dangerouslySetInnerHTML`, or any other code injection vectors.
29+
- Look for credential/token leakage -- secrets hardcoded in source, logged to console, or sent to third parties.
30+
- Inspect `callable` RPC declarations and their backend counterparts for input validation issues.
31+
- Flag any use of `document.cookie`, `localStorage`/`sessionStorage` access that reads data unrelated to the plugin's own scope.
32+
- Check for prototype pollution, unsafe deserialization, or any DOM-based injection risks.
33+
- Review file system access patterns in Lua backends for path traversal or arbitrary file read/write.
34+
35+
### Bug Review (Priority)
36+
37+
This is the most important part of the review. Drill deep into logic and correctness:
38+
39+
- Trace every code path -- look for unhandled edge cases, off-by-one errors, null/undefined dereferences, race conditions, and incorrect async/await usage.
40+
- Check for missing cleanup: event listeners not removed, intervals/timeouts not cleared, subscriptions not unsubscribed. These cause memory leaks and ghost behavior in a long-running Steam client.
41+
- Verify state management correctness: stale closures, missing dependency arrays in `useEffect`/`useMemo`/`useCallback`, state updates on unmounted components.
42+
- Check error handling: uncaught promise rejections, missing try/catch around `callable` RPC calls, network requests without error handling.
43+
- Look for incorrect type coercion, string/number confusion, and comparisons that should use strict equality.
44+
- Verify that `plugin.json` schema is correct: required fields present (`name`, `common_name`, `description`, `version`), version format is valid, `backendType` matches actual backend usage.
45+
- Check for hardcoded Steam AppIDs, user IDs, or other magic values that should be dynamic.
46+
- Look for infinite loops, infinite re-renders, or expensive operations inside render cycles.
47+
48+
### Breaking Changes
49+
50+
Always flag the following as breaking changes when they occur in plugin updates:
51+
52+
- Changes to `plugin.json` fields: `name`, `backendType`, `data` schema changes (renamed/removed keys).
53+
- Removed or renamed `callable` backend function signatures.
54+
- Changed settings storage keys (causes users to lose their settings on update).
55+
- Bumped minimum Millennium version requirements.
56+
- Removed features or changed default behavior.
57+
58+
Clearly label these as **Breaking Change** in your review.
59+
60+
### UI/Component Standards
61+
62+
Plugins must use the component library from `@steambrew/client` and Steam's built-in components. Review settings panels and UI for compliance:
63+
64+
**Settings panels** are defined in `definePlugin()`'s return object via the `content` prop (in the plugin's `index.tsx`):
65+
```tsx
66+
export default definePlugin(() => {
67+
return {
68+
title: "Plugin Name",
69+
icon: <IconsModule.Something />,
70+
content: <SettingsPanel />,
71+
};
72+
});
73+
```
74+
75+
**Required component usage:**
76+
- Use `Field` for settings rows (with `label`, `description`, and `bottomSeparator` props).
77+
- Use `Toggle`, `TextField`, `Dropdown`, `Slider` for input controls inside `Field`.
78+
- Use `DialogButton` or `Button` for actions.
79+
- Use `showModal`/`ModalRoot`/`ConfirmModal` for dialogs.
80+
- Use `showContextMenu`/`Menu`/`MenuItem` for context menus.
81+
- Use `Focusable` for keyboard/controller navigation support.
82+
- Use `Spinner` for loading states.
83+
84+
**Flag these anti-patterns:**
85+
- Raw HTML elements (`<input>`, `<select>`, `<button>`, `<table>`) used where a `@steambrew/client` or Steam component exists.
86+
- Direct DOM manipulation (`document.createElement`, `element.innerHTML`, `element.appendChild`) for UI that could be React components.
87+
- Inline `style` attributes or `<style>` tags for layout/styling that Steam's existing CSS classes handle. Custom styles are acceptable only when Steam provides no equivalent.
88+
- Using `window.SP_REACT.createElement` directly instead of JSX.
89+
- Building settings UI outside of the `definePlugin` `content` pattern without good reason.
90+
91+
**Acceptable exceptions:**
92+
- DOM manipulation for injecting into parts of Steam's UI that aren't exposed via React (e.g., patching existing Steam pages via `Millennium.findElement`).
93+
- Custom CSS for genuinely novel UI that has no Steam equivalent.
94+
- Plugins that don't have user-facing settings don't need a settings panel.
95+
96+
### Backend Language Policy
97+
98+
Python backends are no longer accepted. All plugins must use Lua for their backend (`"backendType": "lua"` in `plugin.json`).
99+
100+
- Reject any plugin with `"backendType": "python"` or that ships `.py` files as part of the plugin backend.
101+
- Python helper scripts used only for development (build scripts, code generation, tooling) are acceptable and should NOT be flagged -- these are not shipped with the plugin.
102+
- If a PR updates an existing plugin that currently uses Python, it must migrate to Lua. Do not approve Python backend additions or modifications.
103+
104+
### General Quality
105+
106+
- Check that the plugin does what its description claims.
107+
- Flag dead code, unused imports, and unreachable branches.
108+
- Note overly complex code that could be simplified.
109+
- Verify consistent error messaging (user-facing errors should be helpful, not raw stack traces).

0 commit comments

Comments
 (0)