-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: model history table with more fields #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danielwpz
wants to merge
15
commits into
main
Choose a base branch
from
model_history
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0e20398
feat: model history table
danielwpz cff1966
format
danielwpz 6c07e12
fix clippy
danielwpz 4d9cc80
fix: model history atomicity, temporal gaps, and race conditions
danielwpz fee0334
refactor: rename migration to V0024 to avoid conflict
danielwpz 755cb44
refactor: rename migration to V0025 to avoid conflict with user_agent…
danielwpz 400bb65
update migration
danielwpz f13955c
feat: add database seeding binary and Makefile development tools
danielwpz 762c9ae
fix: replace misspelled "Superceded" with simpler "Replaced"
danielwpz 3692373
Simplify admin model upsert locking
danielwpz 78a1799
Renumber migrations for model history refactor
danielwpz 0783225
fix migration number
danielwpz 7dc773d
format
danielwpz e62ff31
update makefile
danielwpz e782ea5
update makefile
danielwpz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| .PHONY: help seed api dev build test test-unit test-integration lint fmt check-fmt preflight clean | ||
|
|
||
| help: | ||
| @echo "NEAR AI Cloud API - Development Commands" | ||
| @echo "" | ||
| @echo "Quick Start:" | ||
| @echo " make dev Seed database and run API server (recommended)" | ||
| @echo "" | ||
| @echo "Setup & Database:" | ||
| @echo " make seed Run database migrations and seed data" | ||
| @echo "" | ||
| @echo "Running Services:" | ||
| @echo " make api Run the API server (port 3000)" | ||
| @echo "" | ||
| @echo "Code Quality:" | ||
| @echo " make preflight Run all checks before committing (lint, fmt, test-unit, build)" | ||
| @echo " make build Build all crates" | ||
| @echo " make test Run both unit and integration tests" | ||
| @echo " make test-unit Run unit tests only" | ||
| @echo " make test-integration Run integration tests only" | ||
| @echo " make lint Run clippy linter (strict mode)" | ||
| @echo " make fmt Format code with rustfmt" | ||
| @echo " make check-fmt Check formatting without fixing" | ||
| @echo "" | ||
| @echo "Cleanup:" | ||
| @echo " make clean Remove build artifacts" | ||
|
|
||
| ## Database & Seeding | ||
|
|
||
| seed: | ||
| @echo "Running database migrations and seeding..." | ||
| cargo run --bin seed -p database | ||
|
|
||
| ## Services | ||
|
|
||
| api: | ||
| @echo "Starting API server on http://localhost:3000" | ||
| @echo " Documentation: http://localhost:3000/docs" | ||
| @echo " OpenAPI spec: http://localhost:3000/api-docs/openapi.json" | ||
| @echo "" | ||
| cargo run --bin api | ||
|
|
||
| dev: | ||
| @echo "Starting development environment..." | ||
| @echo "" | ||
| cargo run --bin seed -p database && \ | ||
| echo "" && \ | ||
| echo "Seed complete! Starting API server on http://localhost:3000" && \ | ||
| echo " Documentation: http://localhost:3000/docs" && \ | ||
| echo " OpenAPI spec: http://localhost:3000/api-docs/openapi.json" && \ | ||
| echo "" && \ | ||
| cargo run --bin api | ||
|
|
||
| ## Building & Testing | ||
|
|
||
| build: | ||
| @echo "Building all crates..." | ||
| cargo build | ||
|
|
||
| test-unit: | ||
| @echo "Running unit tests..." | ||
| cargo test --lib --bins | ||
|
|
||
| test-integration: | ||
| @echo "Running integration tests..." | ||
| cargo test --test e2e_test | ||
|
|
||
| test: test-unit test-integration | ||
| @echo "" | ||
| @echo "✅ All tests completed successfully!" | ||
|
|
||
| lint: | ||
| @echo "Running clippy linter (strict mode)..." | ||
| cargo clippy --lib --bins -- -D warnings | ||
|
|
||
| fmt: | ||
| @echo "Formatting code with rustfmt..." | ||
| cargo fmt | ||
|
|
||
| check-fmt: | ||
| @echo "Checking code formatting (without fixing)..." | ||
| cargo fmt --check | ||
|
|
||
| preflight: lint fmt test-unit build | ||
| @echo "" | ||
| @echo "✅ All preflight checks passed! Ready to commit." | ||
|
|
||
| ## Cleanup | ||
|
|
||
| clean: | ||
| @echo "Removing build artifacts..." | ||
| cargo clean | ||
|
|
||
| .DEFAULT_GOAL := help | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use https://github.com/sagiegurari/cargo-make ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't used that one before, if it provides more benefits than makefile we can definitely switch to it