Skip to content

Commit f608cd1

Browse files
committed
add justfile instead of Makefile, add ignores to test coverage
Signed-off-by: phernandez <[email protected]>
1 parent 2162ad5 commit f608cd1

File tree

22 files changed

+224
-375
lines changed

22 files changed

+224
-375
lines changed

.claude/commands/commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Each command is implemented as a Markdown file containing structured prompts tha
5454
## Tooling Integration
5555

5656
Commands leverage existing project tooling:
57-
- `make check` - Quality checks
58-
- `make test` - Test suite
59-
- `make update-deps` - Dependency updates
57+
- `just check` - Quality checks
58+
- `just test` - Test suite
59+
- `just update-deps` - Dependency updates
6060
- `uv` - Package management
6161
- `git` - Version control
6262
- GitHub Actions - CI/CD pipeline

.claude/commands/release/beta.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ You are an expert release manager for the Basic Memory project. When the user ru
2020
3. Get the latest beta tag to determine next version if not provided
2121

2222
### Step 2: Quality Assurance
23-
1. Run `make check` to ensure code quality
23+
1. Run `just check` to ensure code quality
2424
2. If any checks fail, report issues and stop
25-
3. Run `make update-deps` to ensure latest dependencies
25+
3. Run `just update-deps` to ensure latest dependencies
2626
4. Commit any dependency updates with proper message
2727

2828
### Step 3: Version Determination
@@ -62,7 +62,7 @@ Monitor release: https://github.com/basicmachines-co/basic-memory/actions
6262
```
6363

6464
## Context
65-
- Use the existing Makefile targets (`make check`, `make update-deps`)
65+
- Use the existing justfile targets (`just check`, `just update-deps`)
6666
- Follow semantic versioning for beta releases
6767
- Maintain release notes in CHANGELOG.md
6868
- Use conventional commit messages

.claude/commands/release/release-check.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ You are an expert QA engineer for the Basic Memory project. When the user runs `
2828
### Step 2: Code Quality Gates
2929
1. **Test Suite Validation**
3030
```bash
31-
make test
31+
just test
3232
```
3333
- All tests must pass
3434
- Check test coverage (target: 95%+)
3535
- Validate no skipped critical tests
3636

3737
2. **Code Quality Checks**
3838
```bash
39-
make lint
40-
make type-check
39+
just lint
40+
just type-check
4141
```
4242
- No linting errors
4343
- No type checking errors

.claude/commands/release/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You are an expert release manager for the Basic Memory project. When the user ru
2121
4. Confirm no existing tag with this version
2222

2323
### Step 2: Comprehensive Quality Checks
24-
1. Run `make check` (lint, format, type-check, full test suite)
24+
1. Run `just check` (lint, format, type-check, full test suite)
2525
2. Verify test coverage meets minimum requirements (95%+)
2626
3. Check that CHANGELOG.md contains entry for this version
2727
4. Validate all high-priority issues are closed

.github/workflows/claude.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
issues: read
2626
id-token: write
2727
steps:
28-
- name: Check organization membership
28+
- name: Check user permissions
2929
id: check_membership
3030
uses: actions/github-script@v7
3131
with:
@@ -41,29 +41,62 @@ jobs:
4141
actor = context.payload.issue.user.login;
4242
}
4343
44-
console.log(`Checking membership for user: ${actor}`);
44+
console.log(`Checking permissions for user: ${actor}`);
4545
46+
// List of explicitly allowed users (organization members)
47+
const allowedUsers = [
48+
'phernandez',
49+
'groksrc',
50+
'nellins',
51+
'bm-claudeai'
52+
];
53+
54+
if (allowedUsers.includes(actor)) {
55+
console.log(`User ${actor} is in the allowed list`);
56+
core.setOutput('is_member', true);
57+
return;
58+
}
59+
60+
// Fallback: Check if user has repository permissions
4661
try {
47-
const membership = await github.rest.orgs.getMembershipForUser({
48-
org: 'basicmachines-co',
62+
const collaboration = await github.rest.repos.getCollaboratorPermissionLevel({
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
4965
username: actor
5066
});
5167
52-
console.log(`Membership status: ${membership.data.state}`);
68+
const permission = collaboration.data.permission;
69+
console.log(`User ${actor} has permission level: ${permission}`);
5370
54-
// Allow if user is a member (public or private) or admin
55-
const allowed = membership.data.state === 'active' &&
56-
(membership.data.role === 'member' || membership.data.role === 'admin');
71+
// Allow if user has push access or higher (write, maintain, admin)
72+
const allowed = ['write', 'maintain', 'admin'].includes(permission);
5773
5874
core.setOutput('is_member', allowed);
5975
6076
if (!allowed) {
61-
core.notice(`User ${actor} is not a member of basicmachines-co organization`);
77+
core.notice(`User ${actor} does not have sufficient repository permissions (has: ${permission})`);
6278
}
6379
} catch (error) {
64-
console.log(`Error checking membership: ${error.message}`);
65-
core.setOutput('is_member', false);
66-
core.notice(`User ${actor} is not a member of basicmachines-co organization`);
80+
console.log(`Error checking permissions: ${error.message}`);
81+
82+
// Final fallback: Check if user is a public member of the organization
83+
try {
84+
const membership = await github.rest.orgs.getMembershipForUser({
85+
org: 'basicmachines-co',
86+
username: actor
87+
});
88+
89+
const allowed = membership.data.state === 'active';
90+
core.setOutput('is_member', allowed);
91+
92+
if (!allowed) {
93+
core.notice(`User ${actor} is not a public member of basicmachines-co organization`);
94+
}
95+
} catch (membershipError) {
96+
console.log(`Error checking organization membership: ${membershipError.message}`);
97+
core.setOutput('is_member', false);
98+
core.notice(`User ${actor} does not have access to this repository`);
99+
}
67100
}
68101
69102
- name: Checkout repository
@@ -78,4 +111,4 @@ jobs:
78111
uses: anthropics/claude-code-action@beta
79112
with:
80113
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
81-
allowed_tools: Bash(uv run pytest),Bash(uv run ruff check . --fix),Bash(uv run ruff format .),Bash(uv run pyright),Bash(make test),Bash(make lint),Bash(make format),Bash(make type-check),Bash(make check),Read,Write,Edit,MultiEdit,Glob,Grep,LS
114+
allowed_tools: Bash(uv run pytest),Bash(uv run ruff check . --fix),Bash(uv run ruff format .),Bash(uv run pyright),Bash(just test),Bash(just lint),Bash(just format),Bash(just type-check),Bash(just check),Read,Write,Edit,MultiEdit,Glob,Grep,LS

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
run: |
3636
pip install uv
3737
38+
- name: Install just
39+
run: |
40+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
41+
3842
- name: Create virtual env
3943
run: |
4044
uv venv
@@ -45,9 +49,9 @@ jobs:
4549
4650
- name: Run type checks
4751
run: |
48-
uv run make type-check
52+
just type-check
4953
5054
- name: Run tests
5155
run: |
5256
uv pip install pytest pytest-cov
53-
uv run make test
57+
just test

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ See the [README.md](README.md) file for a project overview.
1414

1515
### Build and Test Commands
1616

17-
- Install: `make install` or `pip install -e ".[dev]"`
18-
- Run tests: `uv run pytest -p pytest_mock -v` or `make test`
17+
- Install: `just install` or `pip install -e ".[dev]"`
18+
- Run tests: `uv run pytest -p pytest_mock -v` or `just test`
1919
- Single test: `pytest tests/path/to/test_file.py::test_function_name`
20-
- Lint: `make lint` or `ruff check . --fix`
21-
- Type check: `make type-check` or `uv run pyright`
22-
- Format: `make format` or `uv run ruff format .`
23-
- Run all code checks: `make check` (runs lint, format, type-check, test)
24-
- Create db migration: `make migration m="Your migration message"`
25-
- Run development MCP Inspector: `make run-inspector`
20+
- Lint: `just lint` or `ruff check . --fix`
21+
- Type check: `just type-check` or `uv run pyright`
22+
- Format: `just format` or `uv run ruff format .`
23+
- Run all code checks: `just check` (runs lint, format, type-check, test)
24+
- Create db migration: `just migration "Your migration message"`
25+
- Run development MCP Inspector: `just run-inspector`
2626

2727
### Code Style Guidelines
2828

CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ project and how to get started as a developer.
1515

1616
2. **Install Dependencies**:
1717
```bash
18-
# Using make (recommended)
19-
make install
18+
# Using just (recommended)
19+
just install
2020

2121
# Or using uv
2222
uv install -e ".[dev]"
@@ -25,10 +25,12 @@ project and how to get started as a developer.
2525
pip install -e ".[dev]"
2626
```
2727

28+
> **Note**: Basic Memory uses [just](https://just.systems) as a modern command runner. Install with `brew install just` or `cargo install just`.
29+
2830
3. **Run the Tests**:
2931
```bash
3032
# Run all tests
31-
make test
33+
just test
3234
# or
3335
uv run pytest -p pytest_mock -v
3436

@@ -49,16 +51,16 @@ project and how to get started as a developer.
4951
4. **Check Code Quality**:
5052
```bash
5153
# Run all checks at once
52-
make check
54+
just check
5355

5456
# Or run individual checks
55-
make lint # Run linting
56-
make format # Format code
57-
make type-check # Type checking
57+
just lint # Run linting
58+
just format # Format code
59+
just type-check # Type checking
5860
```
5961
5. **Test Your Changes**: Ensure all tests pass locally and maintain 100% test coverage.
6062
```bash
61-
make test
63+
just test
6264
```
6365
6. **Submit a PR**: Submit a pull request with a detailed description of your changes.
6466

Makefile

Lines changed: 0 additions & 59 deletions
This file was deleted.

justfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Basic Memory - Modern Command Runner
2+
3+
# Install dependencies
4+
install:
5+
pip install -e ".[dev]"
6+
7+
# Run unit tests in parallel
8+
test-unit:
9+
uv run pytest -p pytest_mock -v -n auto
10+
11+
# Run integration tests in parallel
12+
test-int:
13+
uv run pytest -p pytest_mock -v --no-cov -n auto test-int
14+
15+
# Run all tests
16+
test: test-unit test-int
17+
18+
# Lint and fix code
19+
lint:
20+
ruff check . --fix
21+
22+
# Type check code
23+
type-check:
24+
uv run pyright
25+
26+
# Clean build artifacts and cache files
27+
clean:
28+
find . -type f -name '*.pyc' -delete
29+
find . -type d -name '__pycache__' -exec rm -r {} +
30+
rm -rf installer/build/ installer/dist/ dist/
31+
rm -f rw.*.dmg .coverage.*
32+
33+
# Format code with ruff
34+
format:
35+
uv run ruff format .
36+
37+
# Run MCP inspector tool
38+
run-inspector:
39+
npx @modelcontextprotocol/inspector
40+
41+
# Build macOS installer
42+
installer-mac:
43+
cd installer && chmod +x make_icons.sh && ./make_icons.sh
44+
cd installer && uv run python setup.py bdist_mac
45+
46+
# Build Windows installer
47+
installer-win:
48+
cd installer && uv run python setup.py bdist_win32
49+
50+
# Update all dependencies to latest versions
51+
update-deps:
52+
uv sync --upgrade
53+
54+
# Run all code quality checks and tests
55+
check: lint format type-check test
56+
57+
# Generate Alembic migration with descriptive message
58+
migration message:
59+
cd src/basic_memory/alembic && alembic revision --autogenerate -m "{{message}}"
60+
61+
# List all available recipes
62+
default:
63+
@just --list

0 commit comments

Comments
 (0)