roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

feat(config): config versions #152

Closed rustatian closed 2 years ago

rustatian commented 2 years ago

Reason for This PR

closes: #32

Description of Changes

Compatibility matrix located here: TODO

version: "2.6"

# ..... PLUGINS ......

Before:

  pipelines:
    test-local:
      driver: memory
      priority: 10
      prefetch: 10000

    test-local-1:
      driver: boltdb
      priority: 10
      file: "rr.db"
      prefetch: 10000

    test-local-2:
      driver: amqp
      prefetch: 10
      priority: 1
      queue: test-1-queue
      exchange: default
      exchange_type: direct
      routing_key: test
      exclusive: false
      multiple_ack: false
      requeue_on_fail: false

    test-local-3:
      driver: beanstalk
      priority: 11
      tube_priority: 1
      tube: default-1
      reserve_timeout: 10s

    test-local-4:
      driver: sqs
      priority: 10
      prefetch: 10
      visibility_timeout: 0
      wait_time_seconds: 0
      queue: default
      attributes:
        DelaySeconds: 0
        MaximumMessageSize: 262144
        MessageRetentionPeriod: 345600
        ReceiveMessageWaitTimeSeconds: 0
        VisibilityTimeout: 30
      tags:
        test: "tag"

    test-local-5:
      driver: nats
      priority: 2
      prefetch: 100
      subject: default
      stream: foo
      deliver_new: true
      rate_limit: 100
      delete_stream_on_stop: false
      delete_after_ack: false

After:
Now, pipelines have only driver key with the configuration under the config key. We did that to uniform configuration across all drivers (like in the KV).

  pipelines:
    test-local:
      driver: memory

      config: # <------------------ NEW
        priority: 10
        prefetch: 10000

    test-local-1:
      driver: boltdb

      config: # <------------------ NEW
        priority: 10
        file: "test-local-1-bolt.db"
        prefetch: 10000

    test-local-2:
      driver: amqp

      config: # <------------------ NEW
        priority: 11
        prefetch: 100
        queue: test-12-queue
        exchange: default
        exchange_type: direct
        routing_key: test
        exclusive: false
        multiple_ack: false
        requeue_on_fail: false

    test-local-3:
      driver: beanstalk

      config: # <------------------ NEW
        priority: 11
        tube_priority: 1
        tube: default-2
        reserve_timeout: 10s

    test-local-4:
      driver: sqs

      config: # <------------------ NEW
        priority: 10
        prefetch: 10
        visibility_timeout: 0
        wait_time_seconds: 0
        queue: default

        attributes:
          DelaySeconds: 0
          MaximumMessageSize: 262144
          MessageRetentionPeriod: 345600
          ReceiveMessageWaitTimeSeconds: 0
          VisibilityTimeout: 30
        tags:
        test: "tag"

    test-local-5:
      driver: nats

      config: # <------------------ NEW
        priority: 2
        prefetch: 100
        subject: default
        stream: foo
        deliver_new: true
        rate_limit: 100
        delete_stream_on_stop: false
        delete_after_ack: false

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.] [Reviewer TODO: Verify that these criteria are met. Request changes if not]

codecov[bot] commented 2 years ago

Codecov Report

Merging #152 (1ff2ff5) into master (4000d93) will increase coverage by 0.34%. The diff coverage is 75.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
+ Coverage   67.23%   67.58%   +0.34%     
==========================================
  Files         135      135              
  Lines       10292    10497     +205     
==========================================
+ Hits         6920     7094     +174     
- Misses       2653     2664      +11     
- Partials      719      739      +20     
Impacted Files Coverage Δ
amqp/amqpjobs/redial.go 66.66% <ø> (ø)
amqp/plugin.go 100.00% <ø> (ø)
beanstalk/plugin.go 100.00% <ø> (ø)
boltdb/boltjobs/config.go 100.00% <ø> (ø)
boltdb/boltjobs/listener.go 55.35% <0.00%> (-3.14%) :arrow_down:
boltdb/plugin.go 82.35% <ø> (ø)
http/attributes/attributes.go 70.00% <ø> (ø)
http/handler/handler.go 79.68% <ø> (ø)
http/handler/request.go 78.48% <ø> (ø)
http/handler/uploads.go 80.88% <ø> (ø)
... and 52 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c9e1b66...1ff2ff5. Read the comment docs.