Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
AmputatorBot/justfile at main · jvdburgh/AmputatorBot · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
jvdburgh
AmputatorBot
Repository navigation
Code
Issues
4
(4)
Pull requests
2
(2)
Actions
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
AmputatorBot
/
justfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
160 lines (129 loc) · 5.42 KB
main
Breadcrumbs
AmputatorBot
/
justfile
Copy path
Top
File metadata and controls
Code
Blame
160 lines (129 loc) · 5.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# AmputatorBot root tasks — fan out to per-project justfiles.
# Local Postgres URL — override on the CLI:
# just DATABASE_URL=postgres://other... db-migrate
export
DATABASE_URL
:=
env_var_or_default
(
"
DATABASE_URL"
,
"
postgres://amputatorbot:amputatorbot@localhost:5432/amputatorbot"
)
# Default: list recipes
default
:
@
just --list
# Run all checks across all projects (CI equivalent locally)
check
:
backend-check
devvit-check
website-check
# Format every project
fmt
:
backend-fmt
devvit-fmt
website-fmt
# Lint every project
lint
:
backend-lint
devvit-lint
website-lint
# Run all tests
test
:
backend-test
devvit-test
website-test
# --- backend ---
backend-check
:
cd backend
&&
just check
backend-fmt
:
cd backend
&&
just fmt
backend-lint
:
cd backend
&&
just lint
backend-test
:
cd backend
&&
just test
backend-dev
:
cd backend
&&
just dev
# --- devvit-app ---
devvit-check
:
cd devvit-app
&&
just check
devvit-fmt
:
cd devvit-app
&&
just fmt
devvit-lint
:
cd devvit-app
&&
just lint
devvit-test
:
cd devvit-app
&&
just test
devvit-dev
:
cd devvit-app
&&
just dev
# --- website ---
website-check
:
cd website
&&
just check
website-fmt
:
cd website
&&
just fmt
website-lint
:
cd website
&&
just lint
website-test
:
cd website
&&
just test
website-dev
:
cd website
&&
just dev
# --- local database (Postgres 17 via docker compose) ---
# Boot Postgres in the background. Idempotent; safe to re-run.
db-up
:
docker compose up -d postgres
@
echo
"
Waiting for Postgres to accept connections..."
@
until docker exec amputatorbot-postgres pg_isready -U amputatorbot -d amputatorbot >
/
dev
/
null
2
>&
1
; do sleep
1
; done
@
echo
"
Postgres ready at $DATABASE_URL"
# Stop and remove the Postgres container (keeps the data volume).
db-down
:
docker compose stop postgres
# Wipe the Postgres data volume — full reset.
db-nuke
:
docker compose down -v
# Apply pending sqlx migrations. The backend also auto-migrates on startup,
# so this is mainly useful when you want a fresh schema without running the server.
db-migrate
:
cd backend
&&
sqlx migrate run
# Seed the `links` table from a CSV export of the legacy URLConversions table.
#
# Default is the 10k-row sample committed to the repo. Pass any CSV with the
# same column order to override (e.g. your full ~1.7M-row export):
#
# just db-seed # 10k sample
# just db-seed path=/Users/jvdb/Downloads/URLConversions_full.csv
#
# Rows whose original_url or canonical_url exceed the 2048-char cap are
# filtered out (would otherwise violate the table's CHECK constraints). The
# recipe streams the CSV into a constraint-free staging table inside a
# transaction, then INSERTs only the rows that fit. Reports imported vs.
# skipped at the end so you can see what the cap cost you.
db-seed
path
=
"
backend/tests/fixtures/urlconversions/10000_conversions_unfiltered.csv"
:
#!/usr/bin/env bash
set
-euo pipefail
echo
"
Seeding links from {{path}} (filtering URLs > 2048 chars)...
"
#
`\copy ... FROM '<path>'` reads on the psql side. Since psql runs in
#
the container, the file must be in the container — `docker cp` it in,
#
then drop it after. Cleans up even if psql fails (trap on EXIT).
trap
'
docker exec amputatorbot-postgres rm -f /tmp/seed.csv 2>/dev/null || true
'
EXIT
docker cp
"
{{path}}
"
amputatorbot-postgres:/tmp/seed.csv
docker
exec
-i amputatorbot-postgres psql -U amputatorbot -d amputatorbot -v ON_ERROR_STOP=1
<<
'
SQL
'
BEGIN;
-- `LIKE ... INCLUDING DEFAULTS` copies the column defaults but NOT the
-- CHECK constraints, so the staging table is constraint-free and accepts
-- any URL length. The length filter is enforced by the INSERT below.
CREATE TEMP TABLE links_staging (LIKE links INCLUDING DEFAULTS);
\copy links_staging(entry_id, entry_type, handled_utc, original_url, canonical_url, canonical_type, note) FROM '/tmp/seed.csv' WITH (FORMAT csv, HEADER true, NULL '')
INSERT INTO links
SELECT * FROM links_staging
WHERE length(original_url) <= 2048
AND (canonical_url IS NULL OR length(canonical_url) <= 2048);
SELECT
(SELECT COUNT(*) FROM links_staging) AS staged,
(SELECT COUNT(*) FROM links) AS imported,
(SELECT COUNT(*) FROM links_staging) - (SELECT COUNT(*) FROM links) AS skipped_too_long;
COMMIT;
SQL
# --- combined Astro + Rust container image ---
# Build the production image: Astro static bundle + Rust binary in one image.
# `STATIC_DIR=/app/static` is baked in by the Dockerfile.
#
# Always builds linux/amd64 because Scaleway Serverless Containers don't support
# arm64. On Apple Silicon this uses buildx + QEMU emulation — slower than a
# native build but produces a Scaleway-pushable image.
image:
docker buildx build --platform=linux/amd64 -t amputatorbot:dev --load .
# Run the combined image locally. Requires `just db-up` first (the container
# talks to the Postgres on the host docker-compose). On macOS,
# host.docker.internal resolves to the host; on Linux, --add-host wires it up.
image-run:
docker run --rm -it \
-p 8080:8080 \
--add-host=host.docker.internal:host-gateway \
-e DATABASE_URL="postgres://amputatorbot:amputatorbot@host.docker.internal:5432/amputatorbot" \
-e RUST_LOG=info \
amputatorbot:dev
# --- one-time setup after clone ---
setup:
mise install
pnpm install -r
lefthook install
@echo "Setup complete. Try: just check"
You can’t perform that action at this time.