Skip to content

fix(dbtest): order the deprecation audit rows by seq, not a tied created_at - #199

Merged
krazymir merged 1 commit into
mainfrom
claude/fix-deprecation-audit-order
Oct 20, 2026
Merged

krazymir merged 1 commit into
mainfrom
claude/fix-deprecation-audit-order

Conversation

@krazymir

Copy link
Copy Markdown
Contributor

Summary

Fixes the flaky §45 deprecation dbtest that failed on Jenkins (Deploy-Skilly #354):

deprecation.dbtest.ts:135  expected ['skill.deprecated','skill.unfeatured']
                           actual   ['skill.unfeatured','skill.deprecated']

setSkillDeprecation writes skill.deprecated and skill.unfeatured inside one transaction, so both audit_log rows get the same now(). The test sorted them with order by created_at, which is a tie, so Postgres could return them in either order. The test now sorts by audit_log.seq (the BIGSERIAL append-order column from migration 0008, also used by the hash chain), which follows insert order.

  • Test-only change: no app behavior change, so no APP_VERSION bump or changelog entry.
  • I checked the other dbtests that read audit_log … order by created_at. Each one either reads rows written by separate calls (so the timestamps differ) or finds rows by id, so none of them depend on order within one transaction.

Verification

  • pnpm --filter @skilly/web typecheck
  • deprecation.dbtest.ts against a live DB: not run locally because the Docker engine was down. The CI test:db stage on this PR is the check.

🤖 Generated with Claude Code

…ted_at

setSkillDeprecation writes skill.deprecated and skill.unfeatured in one
transaction, so both rows carry the same now() and `order by created_at`
returned them in either order — Jenkins build 354 got them reversed.
audit_log.seq (0008) is the monotonic append order; sort by it instead.
Test-only, no behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krazymir
krazymir merged commit f477d9b into main Oct 20, 2026
9 checks passed
@krazymir
krazymir deleted the claude/fix-deprecation-audit-order branch October 20, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants