Skip to content

Commit 3b47500

Browse files
committed
[#189] Introducing Nebulex v3 🚀 (#149)
Nebulex `v3.0.0-rc.1`: - Ok/Error tuple Cache API. - Unify `all` and `get_all` into one callback `get_all`. - Remove deprecated module `Nebulex.Hook`. - Use `NimbleOptions` to define and validate cache options. - Move adapters to separate repositories. - All commands optionally support a dynamic cache as the first argument. - Deprecate `Nebulex.Adapter.Stats` in favor of `Nebulex.Adapter.Info`. - Deprecate `Nebulex.Adapter.Persistence` behaviour. - Telemetry events for cache commands out-of-box. - Rename the Telemetry metadata field from `:function_name` to `:command`. - Option `:bypass_mode` to skip the cache while running tests - Changes and improvements on Decorator API. - Fix possible inconsistencies on decorators when using references (#215) - Option `:keep_ttl` to determine whether to retain the TTL - Observable API: A tagging interface for cache entry event handlers (experimental) - Update Nebulex to `elixir-nebulex` org - Update docs
1 parent b20cd77 commit 3b47500

File tree

153 files changed

+13760
-15404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+13760
-15404
lines changed

.credo.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@
117117
## Refactoring Opportunities
118118
#
119119
{Credo.Check.Refactor.CondStatements, []},
120-
{Credo.Check.Refactor.CyclomaticComplexity, []},
120+
{Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 40]},
121121
{Credo.Check.Refactor.FunctionArity, []},
122-
{Credo.Check.Refactor.LongQuoteBlocks, [max_line_count: 300, ignore_comments: true]},
122+
{Credo.Check.Refactor.LongQuoteBlocks, [max_line_count: 200]},
123123
# {Credo.Check.Refactor.MapInto, []},
124124
{Credo.Check.Refactor.MatchInCondition, []},
125125
{Credo.Check.Refactor.NegatedConditionsInUnless, []},

.dialyzer_ignore.exs

Lines changed: 0 additions & 6 deletions
This file was deleted.

.doctor.exs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
%Doctor.Config{
22
ignore_modules: [
3-
Nebulex.Adapter,
4-
Nebulex.Adapters.Local.Metadata,
5-
Nebulex.Adapters.Partitioned.Bootstrap,
6-
Nebulex.Helpers,
7-
Nebulex.Telemetry,
8-
Nebulex.Cluster,
9-
Nebulex.NodeCase,
10-
Nebulex.TestCache.Common,
3+
Nebulex.Cache.Helpers,
4+
Nebulex.Cache.Options,
5+
Nebulex.Cache.QuerySpec,
6+
Nebulex.Caching.Options,
7+
Nebulex.Adapter.Transaction.Options,
8+
Nebulex.Adapters.Nil.Options,
119
Nebulex.Dialyzer.CachingDecorators
1210
],
1311
ignore_paths: [],
14-
min_module_doc_coverage: 30,
12+
min_module_doc_coverage: 40,
1513
min_module_spec_coverage: 0,
1614
min_overall_doc_coverage: 80,
1715
min_overall_moduledoc_coverage: 100,

.formatter.exs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
locals_without_parens = [
2+
# Nebulex.Utils
3+
unwrap_or_raise: 1,
4+
wrap_ok: 1,
5+
wrap_error: 1,
6+
wrap_error: 2,
7+
8+
# Nebulex.Cache.Utils
9+
defcacheapi: 2,
10+
11+
# Nebulex.Adapter
12+
defcommand: 1,
13+
defcommand: 2,
14+
defcommandp: 1,
15+
defcommandp: 2,
16+
217
# Nebulex.Caching
18+
dynamic_cache: 2,
319
keyref: 1,
420
keyref: 2,
521

@@ -9,7 +25,17 @@ locals_without_parens = [
925
setup_with_cache: 1,
1026
setup_with_cache: 2,
1127
setup_with_dynamic_cache: 2,
12-
setup_with_dynamic_cache: 3
28+
setup_with_dynamic_cache: 3,
29+
with_telemetry_handler: 2,
30+
with_telemetry_handler: 3,
31+
wait_until: 1,
32+
wait_until: 2,
33+
wait_until: 3,
34+
assert_error_module: 2,
35+
assert_error_reason: 2,
36+
assert_eventually: 1,
37+
assert_eventually: 2,
38+
assert_eventually: 3
1339
]
1440

1541
[

.github/workflows/ci.yml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
branches:
9-
- master
9+
- main
1010

1111
jobs:
1212
nebulex_test:
@@ -18,32 +18,28 @@ jobs:
1818
strategy:
1919
matrix:
2020
include:
21-
- elixir: 1.17.x
21+
- elixir: 1.18.x
2222
otp: 27.x
2323
os: 'ubuntu-latest'
24+
lint: true
2425
style: true
2526
coverage: true
2627
sobelow: true
2728
dialyzer: true
28-
doctor: true
29+
docs: true
2930
- elixir: 1.17.x
30-
otp: 26.x
31-
os: 'ubuntu-latest'
32-
- elixir: 1.16.x
33-
otp: 26.x
31+
otp: 27.x
3432
os: 'ubuntu-latest'
35-
- elixir: 1.15.x
33+
- elixir: 1.17.x
3634
otp: 25.x
3735
os: 'ubuntu-latest'
3836
- elixir: 1.14.x
3937
otp: 24.x
4038
os: 'ubuntu-latest'
41-
- elixir: 1.12.x
42-
otp: 23.x
43-
os: 'ubuntu-20.04'
4439

4540
env:
4641
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
42+
CODECOV_TOKEN: '${{ secrets.CODECOV_TOKEN }}'
4743
MIX_ENV: test
4844

4945
steps:
@@ -83,37 +79,48 @@ jobs:
8379
mix deps.get
8480
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
8581

86-
- name: Compile code
82+
- name: Compile deps
83+
run: mix deps.compile
84+
85+
- name: Check unused dependencies
86+
run: mix deps.unlock --check-unused
87+
if: ${{ matrix.lint }}
88+
89+
- name: Compile lint
8790
run: mix compile --warnings-as-errors
91+
if: ${{ matrix.lint }}
8892

8993
- name: Run style and code consistency checks
9094
run: |
9195
mix format --check-formatted
9296
mix credo --strict
93-
if: ${{ matrix.style }}
97+
if: ${{ matrix.lint }}
9498

9599
- name: Run tests
96-
run: |
97-
epmd -daemon
98-
mix test --trace
100+
run: mix test
99101
if: ${{ !matrix.coverage }}
100102

101103
- name: Run tests with coverage
102-
run: |
103-
epmd -daemon
104-
mix coveralls.github
104+
run: mix coveralls.json
105+
if: ${{ matrix.coverage }}
106+
107+
- name: Upload coverage reports to Codecov
108+
uses: codecov/codecov-action@v5
109+
with:
110+
fail_ci_if_error: true
111+
flags: unittests-elixir-${{ matrix.elixir }}-otp-${{ matrix.otp }}
105112
if: ${{ matrix.coverage }}
106113

107114
- name: Run sobelow
108-
run: mix sobelow --exit --skip
115+
run: mix sobelow --skip --exit Low
109116
if: ${{ matrix.sobelow }}
110117

111118
- name: Restore PLT Cache
112119
uses: actions/cache@v3
113120
id: plt-cache
114121
with:
115122
path: priv/plts
116-
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v1
123+
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v3-1
117124
if: ${{ matrix.dialyzer }}
118125

119126
- name: Create PLTs
@@ -126,10 +133,6 @@ jobs:
126133
run: mix dialyzer --format github
127134
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}
128135

129-
- name: Doc coverage report
130-
run: MIX_ENV=docs mix inch.report
131-
if: ${{ matrix.inch-report }}
132-
133136
- name: Run documentation health check
134137
run: mix doctor
135-
if: ${{ matrix.doctor }}
138+
if: ${{ matrix.docs }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ erl_crash.dump
3737
/priv
3838
.sobelow*
3939
/config
40+
Elixir*

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.17.3-otp-27
2-
erlang 27.1.1
1+
elixir 1.18.3-otp-27
2+
erlang 27.3.3

CHANGELOG.md

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,6 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [v2.6.4](https://github.com/cabol/nebulex/tree/v2.6.4) (2024-10-19)
8-
9-
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.3...v2.6.4)
10-
11-
**Closed issues:**
12-
13-
- [Proposal] A New GC Strategy for Local Generation
14-
[#184](https://github.com/cabol/nebulex/issues/184)
15-
16-
**Merged pull requests:**
17-
18-
- Fix race condition in multilevel cache replication
19-
[#232](https://github.com/cabol/nebulex/pull/232)
20-
([costaraphael](https://github.com/costaraphael))
21-
- Fix typos again
22-
[#230](https://github.com/cabol/nebulex/pull/230)
23-
([kianmeng](https://github.com/kianmeng))
24-
25-
## [v2.6.3](https://github.com/cabol/nebulex/tree/v2.6.3) (2024-08-05)
26-
27-
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.2...v2.6.3)
28-
29-
**Closed issues:**
30-
31-
- `Cache.all(nil, return: :value)` with a partitioned cache gives incorrect
32-
results
33-
[#228](https://github.com/cabol/nebulex/issues/228)
34-
- 2.6.2 is missing from tags and releases on github
35-
[#227](https://github.com/cabol/nebulex/issues/227)
36-
37-
**Merged pull requests:**
38-
39-
- `Cache.all(nil, return: :value)` did not correctly handle values that are
40-
lists.
41-
[#229](https://github.com/cabol/nebulex/pull/229)
42-
([jweinkam](https://github.com/jweinkam))
43-
44-
## [v2.6.2](https://github.com/cabol/nebulex/tree/v2.6.2) (2024-06-15)
45-
46-
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.1...v2.6.2)
47-
48-
**Closed issues:**
49-
50-
- Having a cache per user ID
51-
[#224](https://github.com/cabol/nebulex/issues/224)
52-
53-
**Merged pull requests:**
54-
55-
- Fix some compiler warnings in Elixir 1.17
56-
[#222](https://github.com/cabol/nebulex/pull/222)
57-
([peaceful-james](https://github.com/peaceful-james))
58-
59-
## [v2.6.1](https://github.com/cabol/nebulex/tree/v2.6.1) (2024-02-24)
60-
61-
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.0...v2.6.1)
62-
63-
**Merged pull requests:**
64-
65-
- Improve variable handing in key generators
66-
[#221](https://github.com/cabol/nebulex/pull/221)
67-
([hissssst](https://github.com/hissssst))
68-
69-
## [v2.6.0](https://github.com/cabol/nebulex/tree/v2.6.0) (2024-01-21)
70-
71-
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.5.2...v2.6.0)
72-
73-
**Fixed bugs:**
74-
75-
- Fix compatibility with Elixir 1.15 and 1.16
76-
[#220](https://github.com/cabol/nebulex/issues/220)
77-
78-
**Closed issues:**
79-
80-
- `Multilevel` inclusive cache doesn't duplicate entries backwards on
81-
`get_all/2`
82-
[#219](https://github.com/cabol/nebulex/issues/219)
83-
- Empty arguments list passed to `generate/3` in Elixir 1.16
84-
[#218](https://github.com/cabol/nebulex/issues/218)
85-
- Regression on decorated functions and Elixir 1.16
86-
[#216](https://github.com/cabol/nebulex/issues/216)
87-
- Bug on Local adapter when using `delete_all` and keys are nested tuples:
88-
not a valid match specification
89-
[#211](https://github.com/cabol/nebulex/issues/211)
90-
- `Nebulex.RegistryLookupError`
91-
[#207](https://github.com/cabol/nebulex/issues/207)
92-
- Docs on Migrating to v2 from Nebulex.Adapters.Dist.Cluster
93-
[#198](https://github.com/cabol/nebulex/issues/198)
94-
95-
**Merged pull requests:**
96-
97-
- Partitioned Adapter supports two-item tuples as keys
98-
[#214](https://github.com/cabol/nebulex/pull/214)
99-
([twinn](https://github.com/twinn))
100-
- Adds nebulex Ecto adapter
101-
[#212](https://github.com/cabol/nebulex/pull/212)
102-
([hissssst](https://github.com/hissssst))
103-
1047
## [v2.5.2](https://github.com/cabol/nebulex/tree/v2.5.2) (2023-07-14)
1058

1069
[Full Changelog](https://github.com/cabol/nebulex/compare/v2.5.1...v2.5.2)

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MIT License
1+
# MIT License
22

33
Copyright (c) 2017 Carlos Andres Bolaños R.A.
44

0 commit comments

Comments
 (0)