Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
ae372ee
chore: fix devcontainer progress
budak7273 Jan 29, 2025
47a0491
chore: update directions
budak7273 Mar 30, 2025
80e29f6
feat: controller support in compatibility info
budak7273 Apr 6, 2025
82b6b12
feat: network activity transparency as a string field on Mod
budak7273 Apr 11, 2025
33c1b1a
fix: make network_use_disclosure nillable
budak7273 Apr 11, 2025
8820fd1
chore: update to gqlgen 0.17.56 for omittable support.
budak7273 Apr 11, 2025
7dc04bf
fix: setting mod network disclosure back to Unspecified
budak7273 Apr 12, 2025
8d1346e
chore: regenerate generated files after rebase
budak7273 Jan 10, 2026
5e799f0
chore: fix typo
budak7273 Jan 10, 2026
b173519
docs: mention devcontainer discontinuation and mise bug
budak7273 Jan 10, 2026
fdf7376
chore: remove accidental misplaced atlas migration hash
budak7273 Jan 11, 2026
ea441e7
chore: properly recalculate migration hash from AddNetworkUsageDisclo…
budak7273 Jan 11, 2026
21f830e
fix: mise needs windows rewrites of the file tasks we use for migrations
budak7273 Jan 11, 2026
9fe7c0b
docs: add descriptions for all mise tasks
budak7273 Jan 11, 2026
332d101
test: add controller compat to Update test
budak7273 Jan 11, 2026
aa8294d
chore: `go mod tidy`
budak7273 Jan 11, 2026
cb63ec1
fix: force LF line endings on windows for sql files so atlas migratio…
budak7273 Jan 11, 2026
f439098
chore: update atlas to 1.0.0
budak7273 Jan 11, 2026
47c4d58
cI: produce descriptive error when generated files don't match
budak7273 Jan 11, 2026
0b606ff
chore: `mise run migrate_hash` (seems atlas 1.0.0 has different order…
budak7273 Jan 11, 2026
210be84
chore: one mise migrate_hash command that works on both platforms
budak7273 Jan 24, 2026
ac6ab28
chore: move setup task to files, add ci argument to use docker compos…
budak7273 Jan 24, 2026
f4f5647
chore: regenerate mise.lock with mise 2026.3.17
budak7273 Mar 31, 2026
6a0cdac
chore: routing task to route to windows or linux variant because of h…
budak7273 Mar 31, 2026
19f817d
docs: mention conventional commits, powershell >=7 need on windows
budak7273 Mar 31, 2026
5fb5fc1
fix: pin tempo version to fix container crash on startup:
budak7273 Mar 31, 2026
cce2297
docs: how to make yourself admin for local testing
budak7273 Mar 31, 2026
9670e12
chore: remove outdated launch.json
budak7273 Mar 31, 2026
a3e4e13
chore: regenerate mise lock
budak7273 Mar 31, 2026
f858c3e
chore: chmod +x linux scripts
budak7273 Mar 31, 2026
c14c4fe
chore: remove extra argument, list file task properties in ci
budak7273 Mar 31, 2026
c06b3bc
fix: ignore mise.lock in ci diffs because it has checksums windows au…
budak7273 Mar 31, 2026
9f14bce
feat: prevent reusing semver of deleted mod versions (#134)
budak7273 May 24, 2026
64264df
added new field and corresponding check
rhit-zhangl8 Jan 19, 2026
8c95ec8
first commit
rhit-zhangl8 Jan 22, 2026
12f3efa
added generated files
rhit-zhangl8 Jan 22, 2026
78cf6fe
seperate package
rhit-zhangl8 Jan 22, 2026
6fe9c15
hash migration
rhit-zhangl8 Jan 22, 2026
b911e08
fix merge conflicts
rhit-zhangl8 Jan 22, 2026
bec62c7
just needs to run new update script
rhit-zhangl8 Jan 27, 2026
bcc4fbb
added sql lines
rhit-zhangl8 Jan 27, 2026
8d93998
minor mistake
rhit-zhangl8 Jan 27, 2026
0e5041a
oopsie
rhit-zhangl8 Jan 27, 2026
e40deb6
hash update
rhit-zhangl8 Jan 27, 2026
9e7e6b2
added generated files
rhit-zhangl8 Mar 10, 2026
1eb1747
seperated fields, serving correctly
rhit-zhangl8 Mar 10, 2026
8290060
Using struct instead of strings
rhit-silkaijr Mar 27, 2026
8b51e89
Removing commented code
rhit-silkaijr Mar 27, 2026
8782799
chore: mise run migrate_hash
budak7273 Mar 31, 2026
168fd68
chore: mise run format
budak7273 Mar 31, 2026
c47ce29
feat: added backend check for constraints on ai use disclosure field
rhit-zhangl8 Apr 2, 2026
37e21a9
feat: network disclosure required for version upload
rhit-silkaijr Apr 3, 2026
9f12e94
feat: supporting unspecified disclosure
rhit-silkaijr Apr 6, 2026
9a99b9d
feat: required string input for positive disclosure
rhit-silkaijr Apr 7, 2026
14fd12b
docs: update configuration steps, update sample config port to match …
budak7273 Apr 8, 2026
c58630f
chore: `mise run format`
budak7273 Apr 13, 2026
4b6234f
refactor: clarify test data
budak7273 Apr 14, 2026
bad8559
test: fix broken test
budak7273 Apr 14, 2026
9f75abf
fix: non-empty string disclosure check should still happen even if no…
budak7273 Apr 14, 2026
3bc4c44
tests: ensure disclosure can't be set back to No Disclosure, ensure d…
budak7273 Apr 14, 2026
951219a
refactor: use types instead of string literals
budak7273 Apr 14, 2026
8241314
feat: fixing network disclosure check
rhit-silkaijr Apr 14, 2026
a741e43
test: sml_versions_test not quite working yet
rhit-zhangl8 Apr 23, 2026
13a2946
fix: migrations and disclosure logic
rhit-silkaijr Apr 27, 2026
a3aba1d
fix: addressed comments on PR
rhit-zhangl8 Apr 27, 2026
007db23
fix: reverted changes, added no_disclosure type to enum
rhit-zhangl8 Apr 27, 2026
2c71bb3
fix: readding ai_use_disclosure to NewMod
rhit-silkaijr Apr 27, 2026
039eb30
fix: hash migration
rhit-silkaijr Apr 27, 2026
58dece6
fix: mise setup command regression in 14f8197d187b807e68218ccab57d34d…
budak7273 Apr 27, 2026
2c6962d
fix: `mark_chmod_execute` task can now add files to index
budak7273 Apr 27, 2026
9da051d
feat: extra info while running `mise run setup`
budak7273 Apr 28, 2026
bee0ec4
refactor: remove unused field from test, clarify test data
budak7273 Apr 28, 2026
04dfb11
test: fix mod version tests by setting disclosures
budak7273 Apr 28, 2026
29998ff
chore: `mise run migrate hash` (not working on Jack's machine?)
budak7273 Apr 28, 2026
9e3bc0a
chore: testing migrate_hash
rhit-silkaijr Apr 28, 2026
a5c5974
chore: testing migrate_hash again
rhit-silkaijr Apr 28, 2026
dfe903d
feat: controller migration script
rhit-silkaijr May 5, 2026
0a42d14
fix: hash update
rhit-silkaijr May 5, 2026
32da151
fix: proper Omittable handling
budak7273 May 22, 2026
ee753eb
feat: remove NewMod unused AiUseDisclosure field
budak7273 May 22, 2026
c138ecd
fix: specify `ai_use_disclosure` as omittable in gqlgen (did not resu…
budak7273 May 23, 2026
bcbe74f
feat: remove unused `ToggleNetworkUse` field
budak7273 May 23, 2026
c3b033f
fix: revert go.sum changes produced by running migrate_hash
budak7273 May 23, 2026
efd748f
fix: forgot to also remove field from `custom_models` type `UpdateMod`
budak7273 May 23, 2026
0bdde75
fix: address possible nil pointer deref
budak7273 May 24, 2026
210367c
fix: address errant failure message
budak7273 May 24, 2026
5899134
docs: add comments to INN* functions
budak7273 May 24, 2026
f0fc7e8
refactor: generalized Compatibility setter
budak7273 May 24, 2026
c4d8adb
refactor: version reuse checks as 1 combined query
budak7273 May 24, 2026
71042e2
test: utils helper for disclosure setting
budak7273 May 24, 2026
0d7529a
refactor: migration name format consistency
budak7273 May 24, 2026
105b873
refactor: simplified migration
budak7273 May 25, 2026
ab623b1
fix: atlas rehash
budak7273 May 25, 2026
397daf4
docs: nillable comment
budak7273 May 25, 2026
ce51290
refactor: remove `AIUseDisclosureType:no_disclosure` in favor of unset
budak7273 May 25, 2026
51985b4
fix: atlas errantly set to latest; pin to 1.2.0
budak7273 May 25, 2026
9ee93ae
fix: untrack errantly added atlas.sum outside of sql folder
budak7273 May 25, 2026
b5c046c
refactor: rename `disclosure_string` to `message`
budak7273 May 25, 2026
bc6dd07
refactor: extract condition
budak7273 May 25, 2026
29fccf6
refactor: clarify error message wording
budak7273 May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -ex

# Install protoc (used by go:generate) and add it to path
# Not done in Dockerfile because it seems to lock out writing to some files go needs to write to?
# https://github.com/ericslandry/grpc/blob/dcc9b228a2189933b0666eeea23852a12225092b/.devcontainer/post-create.sh
version=25.4
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v$version/protoc-$version-linux-x86_64.zip
unzip protoc-$version-linux-x86_64.zip -d $HOME/.local/
export PATH="$PATH:$HOME/.local/bin"
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
export PATH="$PATH:$(go env GOPATH)/bin"

# Install libwebp (otherwise go:generate tries and fails to build it itself or something)
# https://developers.google.com/speed/webp/docs/precompiled
libwebp_version=1.4.0
libwebp_file="libwebp-$libwebp_version-linux-x86-64.tar.gz"
curl -LO "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/$libwebp_file"
mkdir -p $HOME/libwebp
tar xzvf $libwebp_file -C $HOME/libwebp
export PATH="$PATH:$HOME/libwebp/bin"

# Add as a safe git directory
git config --global --add safe.directory "/workspaces/smr_api"
57 changes: 32 additions & 25 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
{
"name": "Go",
"name": "smr-api",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"workspaceFolder": "/workspaces/smr_api",
"onCreateCommand": "./.devcontainer/create.sh",
"updateContentCommand": "go mod download && go generate -tags tools -x ./...",

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"sqltools.connections": [
{
"name": "Container database",
"driver": "PostgreSQL",
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"database": "postgres",
"username": "postgres",
"password": "REPLACE_ME"
"customizations": {
"vscode": {
"extensions": [
"golang.Go",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"streetsidesoftware.code-spell-checker"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"sqltools.connections": [
{
"name": "Container database",
"driver": "PostgreSQL",
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"database": "postgres",
"username": "postgres",
"password": "REPLACE_ME"
}
]
}
]
}
},
"forwardPorts": [
5432,
6379,
9000,
9001,
5020,
5020
],
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
}
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
VARIANT: "1-bullseye"
NODE_VERSION: "none"
volumes:
- ..:/workspace:cached
- ..:/workspaces/smr_api:cached
cap_add:
- SYS_PTRACE
network_mode: service:postgres
Expand Down
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Auto detect text files and perform LF normalization
# This keeps unix/windows machines from wanting to change every file
# from the other because of the line ending (\r vs \r\n)
* text=auto
*.sh text eol=lf
*.env* text eol=lf

# Atlas migration hashes are different if file get windows line endings
*.sql text eol=lf
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

- name: List file tasks and their permissions
run: cd ./.mise/tasks/ && ls -l

- name: Setup
run: mise run setup
run: mise run setup -ci

- name: Test
run: mise run test_coverage_junit
Expand Down Expand Up @@ -105,7 +108,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Setup
run: mise run setup
run: mise run setup -ci

- name: Download and seed database
run: |
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ jobs:
- name: Tidy
run: go mod tidy

- name: Ensure no changes
run: git diff --exit-code
- name: Ensure freshly generated hashes match committed ones
# Ignore mise.lock because it seems like mise can't generate checksums for platforms that you aren't on -> always diff
run: |
if ! git diff --exit-code ':!mise.lock'; then
echo "Error: Generating migration hashes again produced output that doesn't match those committed to the repo."
echo "Run 'mise run migrate_hash' and commit the changes."
exit 1
fi

go:
runs-on: ubuntu-latest
Expand All @@ -41,5 +47,11 @@ jobs:
- name: Tidy
run: go mod tidy

- name: Ensure no changes
run: git diff --exit-code
- name: Ensure freshly generated code matches committed code
# Ignore mise.lock because it seems like mise can't generate checksums for platforms that you aren't on -> always diff
run: |
if ! git diff --exit-code ':!mise.lock'; then
echo "Error: Regenerating the generated code produced output that doesn't match the code committed to the repo."
echo "Run 'mise run generate' and commit the changes."
exit 1
fi
9 changes: 9 additions & 0 deletions .mise/tasks/mark_chmod_execute.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#MISE description="For developers on Windows, mark all .sh file-based Mise tasks as executable so Linux devs and the CI can use them"

$shFiles = Get-ChildItem -Path "./.mise/tasks" -Filter "*.sh" -File

foreach ($file in $shFiles) {
Write-Host "Setting Linux execute permission on $($file.Name)"
# https://git-scm.com/docs/git-update-index#Documentation/git-update-index.txt---chmod-x
git update-index --add --chmod=+x $file.FullName
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env bash
#MISE hide=true

echo -n 'Migration Name: '

read -r migration_name

echo -n "Atlas is running..."

atlas migrate diff "$migration_name" --dir "file://migrations/sql?format=golang-migrate" --to "ent://db/schema" --dev-url "docker://postgres/16/test?search_path=public"
9 changes: 9 additions & 0 deletions .mise/tasks/migrate_diff_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#MISE hide=true

Write-Host -NoNewline 'Migration Name: '
$migration_name = Read-Host
Write-Host "Atlas is running..."
atlas migrate diff "$migration_name" --dir "file://migrations/sql?format=golang-migrate" --to "ent://db/schema" --dev-url "docker://postgres/16/test?search_path=public"
if (-not $?) {
Write-Error "If the above failed due to a checksum error, don't run the command it suggests, instead run ``mise run migrate_hash`` "
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
#MISE hide=true

echo -n 'Migration Name: '

Expand Down
10 changes: 10 additions & 0 deletions .mise/tasks/migrate_new_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#MISE hide=true

Write-Host -NoNewline 'Migration Name: '
$migration_name = Read-Host
atlas migrate new "$migration_name" --dir "file://migrations/sql?format=golang-migrate"
if (-not $?) {
Write-Error "If the above failed due to a checksum error, don't run the command it suggests, instead run ``mise run migrate_hash`` "
} else {
Write-Host "Created new migration '$migration_name', check the migrations/sql/ directory for the new files"
}
25 changes: 25 additions & 0 deletions .mise/tasks/setup_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#USAGE flag "-ci" "Use plain progress output suitable for CI environments"
#MISE hide=true

ci=false
while [[ $# -gt 0 ]]; do
case "$1" in
-ci)
ci=true
;;
*)
;;
esac
shift
done

progress=$([ "$ci" = true ] && echo "plain" || echo "auto")

docker compose --progress "$progress" --file docker-compose-dev.yml up --detach --wait && echo "Waiting for 5 seconds" && sleep 5
echo "Setting up MinIO..."
mc alias set local http://localhost:9000 minio minio123
mc admin user svcacct remove local/ REPLACE_ME_KEY --dp || echo It is okay for this REMOVE command to fail if the account is not found
mc admin user svcacct add local minio --access-key REPLACE_ME_KEY --secret-key REPLACE_ME_SECRET
mc anonymous set public local/smr
echo "Setup complete"
16 changes: 16 additions & 0 deletions .mise/tasks/setup_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#USAGE flag "-ci" "Use plain progress output suitable for CI environments"
#MISE hide=true

param(
[switch]$ci
)

$progress = if ($ci) { "plain" } else { "auto" }

docker compose --progress $progress --file docker-compose-dev.yml up --detach --wait && timeout /t 5
Write-Host "Setting up MinIO... (If it gets stuck here, try restarting WSL via `wsl --shutdown`)"
mc alias set local http://localhost:9000 minio minio123
mc admin user svcacct remove local/ REPLACE_ME_KEY --dp || Write-Output "It is okay for this REMOVE command to fail if the account is not found"
mc admin user svcacct add local minio --access-key REPLACE_ME_KEY --secret-key REPLACE_ME_SECRET
mc anonymous set public local/smr
Write-Host "Setup complete"
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

Loading
Loading