Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2universalStack: node
loggingobservabilitymigrationsdata-backfill
Add progress logging to long-running or one-off data scripts
Even for one-time backfills, log batch progress so you can see where the script succeeded or failed if something goes wrong mid-run.
PR: vinify-database-migrator · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codejavascript
| 1 | for (let i = 0; i < batches; i += 1) { |
| 2 | await db.query("UPDATE ... LIMIT 10000"); |
| 3 | // silent: no idea how far it got if it crashes |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | for (let i = 0; i < batches; i += 1) { |
| 2 | await db.query("UPDATE ... LIMIT 10000"); |
| 3 | console.log(`Batch ${i + 1}/${batches} done`); |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)