check all id's are autoincrement #14
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proc#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
as id's use autocincrement u32 everywhere not long guids
make sure the _server,_ui, _web (if it exists), the openrpc, the sdk all gets changed to use incremental id's for everything
in sqlite is int I guess
Implementation Spec for Issue #14: Standardize All IDs to Autoincrement u32
Objective
Standardize all entity IDs (Job, Run, Log) across the entire hero_proc codebase to use
u32autoincrement integers consistently. Currently there is a mix ofu64andu32for the same IDs depending on where they appear (struct definitions useu64, function signatures useu32, row deserialization castsi64 as u32).Current State
Requirements
u32(notu64)u32consistentlyVec<u64>holding IDs must becomeVec<u32>"type": "integer"is fine)Files to Modify
crates/hero_proc_lib/src/db/jobs/model.rs— Job.id, JobSummary.id, JobLogArchive.job_id: u64→u32crates/hero_proc_lib/src/db/runs/model.rs— Run.id, Run.jobs, Run.dependencies, insert/get/delete signaturescrates/hero_proc_lib/src/db/logs/model.rs— LogEntry.logid: u64→u32crates/hero_proc_lib/src/db/logs/mod.rs— insert_log, insert_logs_batch, get_log signaturescrates/hero_proc_lib/src/db/service/model.rs— ServiceRun.run_id: u64→u32crates/hero_proc_lib/src/db/factory.rs— Verify factory methods propagate u32 correctlycrates/hero_proc_server/src/rpc/run.rs— Update dependency collection typesImplementation Plan
Step 1 (independent): Fix Job ID types in
jobs/model.rsStep 2 (independent): Fix Run ID types in
runs/model.rsStep 3 (independent): Fix Log ID types in
logs/model.rs+logs/mod.rsStep 4 (independent): Fix ServiceRun.run_id in
service/model.rsStep 5 (depends 1-4): Verify factory.rs and server RPC handlers compile
Step 6 (depends 5): Run
cargo check --workspaceand fix any remaining issuesStep 7 (depends 6): Run
cargo test --workspaceAcceptance Criteria
cargo check --workspacepassescargo test --workspacepassesNotes
attemptfield inconsistency is out of scopeTest Results
cargo check --workspace✅cargo test --workspace✅Changes Made
Files Modified
crates/hero_proc_lib/src/db/jobs/model.rsJob.id: u64 → u32JobSummary.id: u64 → u32JobLogArchive.job_id: u64 → u32Job.attempt,JobAttemptLog.attempt, etc.: u64 → u32 (consistency fix)JobFilter.limit: u64 → u32 +default_list_limit()return type fixedcrates/hero_proc_lib/src/db/runs/model.rsRun.id: u64 → u32Run.jobs: Vec<u64> → Vec<u32>Run.dependencies: Vec<u64> → Vec<u32>insert_runreturn: u64 → u32get_run,delete_run,add_job_to_runparams: u64 → u32crates/hero_proc_lib/src/db/logs/model.rsLogEntry.logid: u64 → u32crates/hero_proc_lib/src/db/logs/mod.rsinsert_logreturn: u64 → u32insert_logs_batchreturn: Vec<u64> → Vec<u32>get_logparam: u64 → u32crates/hero_proc_lib/src/db/service/model.rsServiceRun.run_id: u64 → u32Not Changed (by design)
"type": "integer"is fine)count_logs,delete_by_src, etc.) remain u64Implementation committed:
1cfcef4Browse:
1cfcef4