Skip to content

Commit 6afde5d

Browse files
committed
Merge dev into fix/nonfatal-missing-key-commands
2 parents 7cd5bd0 + 8e3ab4a commit 6afde5d

File tree

131 files changed

+13372
-3598
lines changed

Some content is hidden

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

131 files changed

+13372
-3598
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### What does this PR do?
2+
3+
### How did you verify your code works?

.github/workflows/pr-standards.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: PR Standards
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
check-standards:
9+
if: |
10+
github.event.pull_request.user.login != 'actions-user' &&
11+
github.event.pull_request.user.login != 'opencode' &&
12+
github.event.pull_request.user.login != 'rekram1-node' &&
13+
github.event.pull_request.user.login != 'thdxr' &&
14+
github.event.pull_request.user.login != 'kommander' &&
15+
github.event.pull_request.user.login != 'jayair' &&
16+
github.event.pull_request.user.login != 'fwang' &&
17+
github.event.pull_request.user.login != 'adamdotdevin' &&
18+
github.event.pull_request.user.login != 'iamdavidhill' &&
19+
github.event.pull_request.user.login != 'opencode-agent[bot]'
20+
runs-on: ubuntu-latest
21+
permissions:
22+
pull-requests: write
23+
steps:
24+
- name: Check PR standards
25+
uses: actions/github-script@v7
26+
with:
27+
script: |
28+
const pr = context.payload.pull_request;
29+
const title = pr.title;
30+
31+
async function addLabel(label) {
32+
await github.rest.issues.addLabels({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
issue_number: pr.number,
36+
labels: [label]
37+
});
38+
}
39+
40+
async function removeLabel(label) {
41+
try {
42+
await github.rest.issues.removeLabel({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
issue_number: pr.number,
46+
name: label
47+
});
48+
} catch (e) {
49+
// Label wasn't present, ignore
50+
}
51+
}
52+
53+
async function comment(marker, body) {
54+
const markerText = `<!-- pr-standards:${marker} -->`;
55+
const { data: comments } = await github.rest.issues.listComments({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
issue_number: pr.number
59+
});
60+
61+
const existing = comments.find(c => c.body.includes(markerText));
62+
if (existing) return;
63+
64+
await github.rest.issues.createComment({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
issue_number: pr.number,
68+
body: markerText + '\n' + body
69+
});
70+
}
71+
72+
// Step 1: Check title format
73+
// Matches: feat:, feat(scope):, feat (scope):, etc.
74+
const titlePattern = /^(feat|fix|docs|chore|refactor|test)\s*(\([a-zA-Z0-9-]+\))?\s*:/;
75+
const hasValidTitle = titlePattern.test(title);
76+
77+
if (!hasValidTitle) {
78+
await addLabel('needs:title');
79+
await comment('title', `Hey! Your PR title \`${title}\` doesn't follow conventional commit format.
80+
81+
Please update it to start with one of:
82+
- \`feat:\` or \`feat(scope):\` new feature
83+
- \`fix:\` or \`fix(scope):\` bug fix
84+
- \`docs:\` or \`docs(scope):\` documentation changes
85+
- \`chore:\` or \`chore(scope):\` maintenance tasks
86+
- \`refactor:\` or \`refactor(scope):\` code refactoring
87+
- \`test:\` or \`test(scope):\` adding or updating tests
88+
89+
Where \`scope\` is the package name (e.g., \`app\`, \`desktop\`, \`opencode\`).
90+
91+
See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#pr-titles) for details.`);
92+
return;
93+
}
94+
95+
await removeLabel('needs:title');
96+
97+
// Step 2: Check for linked issue (skip for docs/refactor PRs)
98+
const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
99+
if (skipIssueCheck) {
100+
await removeLabel('needs:issue');
101+
console.log('Skipping issue check for docs/refactor PR');
102+
return;
103+
}
104+
const query = `
105+
query($owner: String!, $repo: String!, $number: Int!) {
106+
repository(owner: $owner, name: $repo) {
107+
pullRequest(number: $number) {
108+
issuesReferences(first: 1) {
109+
totalCount
110+
}
111+
}
112+
}
113+
}
114+
`;
115+
116+
const result = await github.graphql(query, {
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
number: pr.number
120+
});
121+
122+
const linkedIssues = result.repository.pullRequest.issuesReferences.totalCount;
123+
124+
if (linkedIssues === 0) {
125+
await addLabel('needs:issue');
126+
await comment('issue', `Thanks for your contribution!
127+
128+
This PR doesn't have a linked issue. All PRs must reference an existing issue.
129+
130+
Please:
131+
1. Open an issue describing the bug/feature (if one doesn't exist)
132+
2. Add \`Fixes #<number>\` or \`Closes #<number>\` to this PR description
133+
134+
See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#issue-first-policy) for details.`);
135+
return;
136+
}
137+
138+
await removeLabel('needs:issue');
139+
console.log('PR meets all standards');

.github/workflows/publish.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,22 @@ jobs:
177177
cargo tauri --version
178178
179179
- name: Build and upload artifacts
180-
timeout-minutes: 20
181-
uses: tauri-apps/tauri-action@390cbe447412ced1303d35abe75287949e43437a
180+
uses: Wandalen/wretry.action@v3
181+
timeout-minutes: 60
182+
with:
183+
attempt_limit: 3
184+
attempt_delay: 10000
185+
action: tauri-apps/tauri-action@390cbe447412ced1303d35abe75287949e43437a
186+
with: |
187+
projectPath: packages/desktop
188+
uploadWorkflowArtifacts: true
189+
tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }}
190+
args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose
191+
updaterJsonPreferNsis: true
192+
releaseId: ${{ needs.publish.outputs.release }}
193+
tagName: ${{ needs.publish.outputs.tag }}
194+
releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext]
195+
releaseDraft: true
182196
env:
183197
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184198
TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: true
@@ -190,16 +204,6 @@ jobs:
190204
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
191205
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
192206
APPLE_API_KEY_PATH: ${{ runner.temp }}/apple-api-key.p8
193-
with:
194-
projectPath: packages/desktop
195-
uploadWorkflowArtifacts: true
196-
tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }}
197-
args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose
198-
updaterJsonPreferNsis: true
199-
releaseId: ${{ needs.publish.outputs.release }}
200-
tagName: ${{ needs.publish.outputs.tag }}
201-
releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext]
202-
releaseDraft: true
203207

204208
publish-release:
205209
needs:

CONTRIBUTING.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,63 @@ With that said, you may want to try these methods, as they might work for you.
149149

150150
## Pull Request Expectations
151151

152-
- Try to keep pull requests small and focused.
153-
- Link relevant issue(s) in the description
152+
### Issue First Policy
153+
154+
**All PRs must reference an existing issue.** Before opening a PR, open an issue describing the bug or feature. This helps maintainers triage and prevents duplicate work. PRs without a linked issue may be closed without review.
155+
156+
- Use `Fixes #123` or `Closes #123` in your PR description to link the issue
157+
- For small fixes, a brief issue is fine - just enough context for maintainers to understand the problem
158+
159+
### General Requirements
160+
161+
- Keep pull requests small and focused
154162
- Explain the issue and why your change fixes it
155-
- Avoid having verbose LLM generated PR descriptions
156-
- Before adding new functions or functionality, ensure that such behavior doesn't already exist elsewhere in the codebase.
163+
- Before adding new functionality, ensure it doesn't already exist elsewhere in the codebase
164+
165+
### UI Changes
166+
167+
If your PR includes UI changes, please include screenshots or videos showing the before and after. This helps maintainers review faster and gives you quicker feedback.
168+
169+
### Logic Changes
170+
171+
For non-UI changes (bug fixes, new features, refactors), explain **how you verified it works**:
172+
173+
- What did you test?
174+
- How can a reviewer reproduce/confirm the fix?
175+
176+
### No AI-Generated Walls of Text
177+
178+
Long, AI-generated PR descriptions and issues are not acceptable and may be ignored. Respect the maintainers' time:
179+
180+
- Write short, focused descriptions
181+
- Explain what changed and why in your own words
182+
- If you can't explain it briefly, your PR might be too large
183+
184+
### PR Titles
185+
186+
PR titles should follow conventional commit standards:
187+
188+
- `feat:` new feature or functionality
189+
- `fix:` bug fix
190+
- `docs:` documentation or README changes
191+
- `chore:` maintenance tasks, dependency updates, etc.
192+
- `refactor:` code refactoring without changing behavior
193+
- `test:` adding or updating tests
194+
195+
You can optionally include a scope to indicate which package is affected:
196+
197+
- `feat(app):` feature in the app package
198+
- `fix(desktop):` bug fix in the desktop package
199+
- `chore(opencode):` maintenance in the opencode package
200+
201+
Examples:
202+
203+
- `docs: update contributing guidelines`
204+
- `fix: resolve crash on startup`
205+
- `feat: add dark mode support`
206+
- `feat(app): add dark mode support`
207+
- `fix(desktop): resolve crash on startup`
208+
- `chore: bump dependency versions`
157209

158210
### Style Preferences
159211

STATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,4 @@
194194
| 2026-01-05 | 1,738,171 (+65,515) | 1,353,043 (+13,160) | 3,091,214 (+78,675) |
195195
| 2026-01-06 | 1,960,988 (+222,817) | 1,377,377 (+24,334) | 3,338,365 (+247,151) |
196196
| 2026-01-07 | 2,123,239 (+162,251) | 1,398,648 (+21,271) | 3,521,887 (+183,522) |
197+
| 2026-01-08 | 2,272,630 (+149,391) | 1,432,480 (+33,832) | 3,705,110 (+183,223) |

STYLE_GUIDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Style Guide
22

33
- Try to keep things in one function unless composable or reusable
4-
- AVOID unnecessary destructuring of variables
4+
- AVOID unnecessary destructuring of variables. instead of doing `const { a, b }
5+
= obj` just reference it as obj.a and obj.b. this preserves context
56
- AVOID `try`/`catch` where possible
67
- AVOID `else` statements
78
- AVOID using `any` type

0 commit comments

Comments
 (0)