Skip to content

upgrade: v1.16.8#1376

Merged
hwbrzzl merged 3 commits intov1.16.xfrom
bowen/upgrade-v1.16.8
Feb 11, 2026
Merged

upgrade: v1.16.8#1376
hwbrzzl merged 3 commits intov1.16.xfrom
bowen/upgrade-v1.16.8

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR upgrades the framework to v1.16.8 and includes two main functional changes:

  • Error handling: errors.errorString is now immutable (both Args() and SetModule() return a new instance) and implements Is() so errors.Is() can match errors by their template text. New tests cover immutability, concurrency safety, and Is() behavior.

  • Queue database driver: Queue components (Application, DriverCreator, PendingJob, Worker) now accept an injected cache.Cache. The database queue driver wraps Pop() with a cache-backed lock (Cache.Lock(...).Block(...)) to prevent concurrent pops for the same queue, and returns a new QueuePopIsLocked error when the lock can’t be acquired.

Most other changes are regenerated mocks/import reordering and test updates to match the new constructor signatures and error-argument semantics.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are cohesive (immutability in errors + cache injection/locking in database queue Pop) and tests were updated/added to cover the new behaviors; no merge-blocking defects were found in the diff after verifying key behavioral paths (NewDatabase error args, Push error args, WhereColumn argument counting).
  • queue/driver_database.go (new locking path) and errors/errors.go (new errors.Is semantics)

Important Files Changed

Filename Overview
database/db/query_test.go Updates expected invalid-argument count for WhereColumn() to match implementation (len(column2) == 0).
errors/errors.go Makes error instances immutable by returning new errorString from Args/SetModule and adds errorString.Is for errors.Is comparisons.
errors/errors_test.go Adds tests covering Args/SetModule immutability, concurrency safety, and Is() behavior.
errors/list.go Adds QueuePopIsLocked error constant used by database queue driver when lock acquisition fails.
mail/application_test.go Adjusts queue.NewApplication constructor usage to include cache parameter.
queue/application.go Adds cache dependency to queue Application and threads it through to driver/pending job/worker creation.
queue/driver_creator.go Adds cache to DriverCreator and passes it to database driver construction.
queue/driver_creator_test.go Updates tests to include mocked cache in DriverCreator construction and assertions.
queue/driver_database.go Adds required cache dependency and uses cache lock around Pop() to prevent concurrent pops per queue.
queue/driver_database_test.go Updates database driver tests for new cache dependency and lock expectations; fixes expected error args to match implementation.
queue/pending_job.go Threads cache dependency into PendingJob and PendingChainJob via DriverCreator.
queue/pending_job_test.go Updates pending job tests for new cache parameter in constructors.
queue/service_provider.go Wires cache into queue application construction via app.MakeCache().
queue/worker.go Adds cache dependency to Worker constructor and ensures debug log prints error text.
queue/worker_test.go Updates worker tests to pass cache parameter (nil in sync driver paths) and aligns expected error arg types.
support/constant.go Bumps framework version constant to v1.16.8.
tests/db_test.go Updates expected invalid-argument count for OrWhereColumn() to match implementation (len(column2) == 0).

Sequence Diagram

sequenceDiagram
    participant SP as queue.ServiceProvider
    participant App as foundation.Application
    participant QA as queue.Application
    participant DC as queue.DriverCreator
    participant DB as queue.DatabaseDriver
    participant Cache as cache.Cache
    participant Lock as cache.Lock
    participant SQL as db.DB

    SP->>App: MakeCache()
    SP->>App: MakeDB()
    SP->>App: GetJson()
    SP->>QA: NewApplication(config, cache, db, jobStorer, json, log)

    QA->>DC: NewDriverCreator(config, cache, db, jobStorer, json, log)
    QA->>DC: Create("default")
    DC->>DB: NewDatabase(config, cache, db, jobStorer, json, "default")

    QA->>QA: Worker(connection, queue)
    QA->>DC: NewDriverCreator(...)
    DC->>DB: (returns Driver)

    QA->>DB: Pop(queue)
    DB->>Cache: Lock("goravel:queue-database-<queue>:lock", 1m)
    Cache-->>Lock: lock
    DB->>Lock: Block(1m)
    alt lock acquired
        DB->>SQL: Transaction(fn)
        SQL-->>DB: reserved job
        DB->>Lock: Release()
        DB-->>QA: ReservedJob
    else lock not acquired
        DB-->>QA: QueuePopIsLocked error
    end
Loading

@hwbrzzl hwbrzzl requested a review from a team as a code owner February 11, 2026 09:09
@hwbrzzl hwbrzzl closed this Feb 11, 2026
@hwbrzzl hwbrzzl reopened this Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v1.16.x@f7dca2e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
queue/application.go 28.57% 5 Missing ⚠️
queue/driver_database.go 75.00% 1 Missing and 1 partial ⚠️
queue/service_provider.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v1.16.x    #1376   +/-   ##
==========================================
  Coverage           ?   68.28%           
==========================================
  Files              ?      215           
  Lines              ?    11619           
  Branches           ?        0           
==========================================
  Hits               ?     7934           
  Misses             ?     3305           
  Partials           ?      380           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl hwbrzzl merged commit 8e40522 into v1.16.x Feb 11, 2026
18 checks passed
@hwbrzzl hwbrzzl deleted the bowen/upgrade-v1.16.8 branch February 11, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant