Skip to content

Commit

Permalink
Release v2.0.7 (#44)
Browse files Browse the repository at this point in the history
- doc: Changes -> CHANGELOG
- prettier
- ci: update to shared GHA workflows
- lint: remove duplicate / stale rules from .eslintrc
- populate [files] in package.json. Delete .npmignore.
- doc(CONTRIBUTORS): added
  • Loading branch information
msimerson authored Apr 22, 2024
1 parent ca6c766 commit 828ae6b
Show file tree
Hide file tree
Showing 15 changed files with 392 additions and 452 deletions.
8 changes: 4 additions & 4 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
engines:
eslint:
enabled: true
channel: "eslint-8"
channel: 'eslint-8'
config:
config: ".eslintrc.yaml"
config: '.eslintrc.yaml'

checks:
method-complexity:
config:
threshold: 10

ratings:
paths:
- "**.js"
paths:
- '**.js'
17 changes: 2 additions & 15 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ env:
node: true
es6: true
mocha: true
es2020: true
es2022: true

plugins: [ haraka ]

extends: [ eslint:recommended, plugin:haraka/recommended ]

root: true

globals:
OK: true
CONT: true
DENY: true
DENYSOFT: true
DENYDISCONNECT: true
DENYSOFTDISCONNECT: true
connection: true
extends: ['@haraka']
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Fixes #

Changes proposed in this pull request:
-
-

-
-

Checklist:

- [ ] docs updated
- [ ] tests updated
- [ ] Changes.md updated
Expand Down
43 changes: 12 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,22 @@
name: CI

on: [ push, pull_request ]
on: [push, pull_request]

env:
CI: true
node-version: 16

jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Node ${{ env.node-version }}
with:
node-version: ${{ env.node-version }}
- run: npm install
- run: npm run lint
uses: haraka/.github/.github/workflows/lint.yml@master

# coverage:
# uses: haraka/.github/.github/workflows/coverage.yml@master
# secrets: inherit

test:
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [ 14, 16, 18 ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
needs: [lint]
uses: haraka/.github/.github/workflows/ubuntu.yml@master

# windows:
# needs: [lint]
# uses: haraka/.github/.github/workflows/windows.yml@master
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CodeQL

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '18 7 * * 4'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ env:
jobs:
publish:
uses: haraka/.github/.github/workflows/publish.yml@master
secrets: inherit
secrets: inherit
58 changes: 0 additions & 58 deletions .npmignore

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
singleQuote: true
semi: false
2 changes: 1 addition & 1 deletion .release
38 changes: 22 additions & 16 deletions Changes.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,100 @@
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [2.0.7] - 2024-04-21

- populate [files] in package.json. Delete .npmignore.
- lint: remove duplicate / stale rules from .eslintrc
- ci: update to shared GHA workflows
- doc(CONTRIBUTORS): added
- doc: Changes -> CHANGELOG
- prettier

### [2.0.6] - 2023-12-12

- doc(README): '[socket]' is now '[server]' (#39)
- chore(ci): add .release, updated dot files


### 2.0.5 - 2022-05-26

- fix: backwards compatibility with legacy plugin config files
- fix: rename p\* methods -> * (required in redis v4)
- fix: rename p\* methods -> \* (required in redis v4)
- fix: add `await client.connect()` as is now required, fixes #32
- fix: make redis_ping async
- dep(redis): bump 4.0 -> 4.1
- chore(ci): updated syntax
- chore(ci): added codeql config
- test: added tests for init_redis_plugin


### 2.0.0 - 2022-03-29

- dep(redis): bump major version 3 -> 4
- breaking API change: replaced callbacks with promises
- config.ini
- opts.db -> opts.database (to match upstream)

- opts.db -> opts.database (to match upstream)

### 1.0.13 - 2021-10-14

- chore(ci): switch CI from Travis to GitHub Actions
- doc(README): update formatting with GFM


### 1.0.12 - 2020-03-16

- chore(ci): replace nodeunit with mocha
- dep(redis): update lib to v3
- appveyor: test on node 10


### 1.0.11 - 2019-04-11

- create custom connection only after: all 3 conditions match


### 1.0.10 - 2019-04-09

- merge ALL of [opts] into [server] config (fixes #18)
- merge all of [opts] into [pubsub] config
- include an empty config/redis.ini
- add defaultOpts once, vs defaults in two places


### 1.0.9 - 2019-02-19

- bump redis version to 2.8.0
- emit error message if redis connection fails
- add 3s timeout for subscribe connects: minimize connections stalls
- add es6 template literals


### 1.0.8 - 2018-01-03

- upon punsubscribe, `quit()` (disconnect) redis client


### 1.0.7 - 2017-07-31

- apply config [opts] to pubsub settings #7


### 1.0.6 - 2017-06-16

- eslint 4 compat


### 1.0.5 - 2017-06-09

- disconnect per-connection redis client upon punsubscribe


### 1.0.4 - 2017-02-06

- remove retry_strategy, redis client now does The Right Thing w/o it


### 1.0.3 - 2017-02-06

- don't break when no [redis] config exists

[2.0.6]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.6
[1.0.13]: https://github.com/haraka/haraka-plugin-redis/releases/tag/1.0.13
[2.0.0]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.0
[2.0.1]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.1
[2.0.2]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.2
[2.0.3]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.3
[2.0.4]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.4
[2.0.5]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.5
[2.0.6]: https://github.com/haraka/haraka-plugin-redis/releases/tag/v2.0.6
[2.0.7]: https://github.com/haraka/haraka-plugin-redis/releases/tag/2.0.7
8 changes: 8 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributors

This handcrafted artisinal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-redis/commits?author=msimerson">57</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/7803873?v=4"><br><a href="https://github.com/zazapeta">zazapeta</a> (<a href="https://github.com/haraka/haraka-plugin-redis/commits?author=zazapeta">1</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,31 @@ optionally with a redis db ID. All redis config options must be listed in your p

```js
exports.register = function () {
this.inherits('redis');
this.inherits('redis')

this.cfg = this.config.get('my-plugin.ini');
this.cfg = this.config.get('my-plugin.ini')

// populate plugin.cfg.redis with defaults from redis.ini
this.merge_redis_ini();
// populate plugin.cfg.redis with defaults from redis.ini
this.merge_redis_ini()

// cluster aware redis connection(s)
this.register_hook('init_master', 'init_redis_plugin');
this.register_hook('init_child', 'init_redis_plugin');
// cluster aware redis connection(s)
this.register_hook('init_master', 'init_redis_plugin')
this.register_hook('init_child', 'init_redis_plugin')
}
```

When a db ID is specified in the [redis] section of a redis inheriting plugin, log messages like these will be emitted when Haraka starts:

````
```
[INFO] [-] [redis] connected to redis://172.16.15.16:6379 v3.2.6
[INFO] [-] [limit] connected to redis://172.16.15.16:6379/1 v3.2.6
[INFO] [-] [karma] connected to redis://172.16.15.16:6379/2 v3.2.6
[INFO] [-] [known-senders] connected to redis://172.16.15.16:6379/3 v3.2.6
````
```

Notice the database ID numbers appended to each plugins redis connection
message.


[ci-img]: https://github.com/haraka/haraka-plugin-redis/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-redis/actions/workflows/ci.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-redis/badges/gpa.svg
Expand Down
Loading

0 comments on commit 828ae6b

Please sign in to comment.