Skip to content

Commit f5b99ca

Browse files
committed
Merge remote-tracking branch 'origin/master' into rm-tracking-cookie
2 parents bb20dc6 + 7b579fe commit f5b99ca

File tree

125 files changed

+5112
-715
lines changed

Some content is hidden

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

125 files changed

+5112
-715
lines changed

.github/workflows/make-and-test.yml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Make all packages and run their tests
1+
name: Test
22

33
# newer commits in the same PR abort running ones for the same workflow
44
concurrency:
@@ -43,7 +43,7 @@ jobs:
4343
- name: Check doc links
4444
run: cd src/scripts && python3 check_doc_urls.py || sleep 5 || python3 check_doc_urls.py
4545

46-
build:
46+
test:
4747
runs-on: ubuntu-latest
4848

4949
services:
@@ -94,7 +94,7 @@ jobs:
9494
- name: Download and install Valkey
9595
run: |
9696
VALKEY_VERSION=8.1.2
97-
curl -LO https://download.valkey.io/releases/valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
97+
curl -LOq https://download.valkey.io/releases/valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
9898
tar -xzf valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
9999
sudo cp valkey-${VALKEY_VERSION}-jammy-x86_64/bin/valkey-server /usr/local/bin/
100100
@@ -106,6 +106,52 @@ jobs:
106106
pip install ipykernel
107107
python -m ipykernel install --prefix=./jupyter-local --name python3-local --display-name "Python 3 (Local)"
108108
109-
- run: cd src && npm install -g pnpm
110-
- run: cd src && pnpm run make
111-
- run: source venv/bin/activate && cd src && pnpm run test-github-ci
109+
110+
- name: install pnpm
111+
uses: pnpm/action-setup@v4
112+
with:
113+
version: 10
114+
run_install: false
115+
116+
- name: build
117+
run: cd src && pnpm run make
118+
119+
# This runs all the tests with text output and jest-junit reporters to generate junit.xml reports
120+
# That test-github-ci target runs workspaces.py for testing, which in turn runs the depchecks
121+
- name: test
122+
run: source venv/bin/activate && cd src && pnpm run test-github-ci --report
123+
124+
- name: upload test results
125+
uses: actions/upload-artifact@v4 # upload test results
126+
if: ${{ !cancelled() }} # run this step even if previous step failed
127+
with:
128+
name: "test-results-node-${{ matrix.node-version }}-pg-${{ matrix.pg-version }}"
129+
path: 'src/packages/*/junit.xml'
130+
131+
report:
132+
runs-on: ubuntu-latest
133+
134+
needs: [test]
135+
136+
if: ${{ !cancelled() }}
137+
138+
steps:
139+
- name: Checkout code
140+
uses: actions/checkout@v4
141+
142+
- name: Download all test artifacts
143+
uses: actions/download-artifact@v4
144+
with:
145+
pattern: "test-results-*"
146+
merge-multiple: true
147+
path: test-results/
148+
149+
- name: Test Report
150+
uses: dorny/test-reporter@v2
151+
with:
152+
name: CoCalc Jest Tests
153+
path: 'test-results/**/junit.xml'
154+
reporter: jest-junit
155+
use-actions-summary: 'true'
156+
fail-on-error: false
157+

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,8 @@ src/packages/frontend/i18n/trans/*.compiled.json
159159
**/*.db
160160
**/project-env.sh
161161
**/*.bash_history
162+
163+
src/.claude/settings.local.json
164+
165+
# test reports by jest-junit
166+
junit.xml

src/.claude/settings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(gh pr view:*)",
6+
"Bash(gh:*)",
7+
"Bash(git add:*)",
8+
"Bash(git commit:*)",
9+
"Bash(grep:*)",
10+
"Bash(node:*)",
11+
"Bash(npm show:*)",
12+
"Bash(npx tsc:*)",
13+
"Bash(pnpm build:*)",
14+
"Bash(pnpm ts-build:*)",
15+
"Bash(pnpm tsc:*)",
16+
"Bash(prettier -w:*)",
17+
"WebFetch(domain:cocalc.com)",
18+
"WebFetch(domain:doc.cocalc.com)",
19+
"WebFetch(domain:docs.anthropic.com)",
20+
"WebFetch(domain:github.com)"
21+
],
22+
"deny": []
23+
}
24+
}

src/CLAUDE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# CLAUDE.md
1+
# CLAUDE.md and GEMINI.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file provides guidance to Claude Code (claude.ai/code) and also Gemini CLI (https://github.com/google-gemini/gemini-cli) when working with code in this repository.
44

55
# CoCalc Source Repository
66

@@ -43,7 +43,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4343

4444
### Development
4545

46-
- After code changes, run `pretter -w [filename]` to ensure consistent styling
46+
- **IMPORTANT**: Always run `prettier -w [filename]` immediately after editing any .ts, .tsx, .md, or .json file to ensure consistent styling
4747
- After TypeScript or `*.tsx` changes, run `pnpm build` in the relevant package directory
4848

4949
## Architecture Overview
@@ -87,6 +87,7 @@ CoCalc is organized as a monorepo with key packages:
8787
- **Database Queries**: Structured query system with typed interfaces
8888
- **Event Emitters**: Inter-service communication within backend
8989
- **REST-like APIs**: Some HTTP endpoints for specific operations
90+
- **API Schema**: API endpoints in `packages/next/pages/api/v2/` use Zod schemas in `packages/next/lib/api/schema/` for validation. These schemas must be kept in harmony with the TypeScript types sent from frontend applications using `apiPost` (in `packages/next/lib/api/post.ts`) or `api` (in `packages/frontend/client/api.ts`). When adding new fields to API requests, both the frontend types and the API schema validation must be updated.
9091

9192
### Key Technologies
9293

src/GEMINI.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

src/packages/backend/conat/persist.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ import { initContext } from "@cocalc/conat/persist/context";
1414
import { compress, decompress } from "zstd-napi";
1515
import { syncFiles } from "@cocalc/backend/data";
1616
import ensureContainingDirectoryExists from "@cocalc/backend/misc/ensure-containing-directory-exists";
17+
import { statSync, copyFileSync } from "node:fs";
1718

1819
initContext({
1920
betterSqlite3,
2021
compress,
2122
decompress,
2223
syncFiles,
2324
ensureContainingDirectoryExists,
25+
statSync,
26+
copyFileSync,
2427
});
2528

2629
export { pstream } from "@cocalc/conat/persist/storage";

0 commit comments

Comments
 (0)