Skip to content

Commit

Permalink
[#189] Nebulex v3 initial draft
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
cabol committed Jul 7, 2024
1 parent 2b15912 commit e157be7
Show file tree
Hide file tree
Showing 136 changed files with 10,652 additions and 14,080 deletions.
4 changes: 2 additions & 2 deletions .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@
## Refactoring Opportunities
#
{Credo.Check.Refactor.CondStatements, []},
{Credo.Check.Refactor.CyclomaticComplexity, []},
{Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 40]},
{Credo.Check.Refactor.FunctionArity, []},
{Credo.Check.Refactor.LongQuoteBlocks, [max_line_count: 300, ignore_comments: true]},
{Credo.Check.Refactor.LongQuoteBlocks, [max_line_count: 200]},
# {Credo.Check.Refactor.MapInto, []},
{Credo.Check.Refactor.MatchInCondition, []},
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
Expand Down
6 changes: 0 additions & 6 deletions .dialyzer_ignore.exs

This file was deleted.

16 changes: 7 additions & 9 deletions .doctor.exs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
%Doctor.Config{
ignore_modules: [
Nebulex.Adapter,
Nebulex.Adapters.Local.Metadata,
Nebulex.Adapters.Partitioned.Bootstrap,
Nebulex.Helpers,
Nebulex.Telemetry,
Nebulex.Cluster,
Nebulex.NodeCase,
Nebulex.TestCache.Common,
Nebulex.Cache.Impl,
Nebulex.Cache.Options,
Nebulex.Cache.QuerySpec,
Nebulex.Caching.Options,
Nebulex.Adapter.Transaction.Options,
Nebulex.Adapters.Nil.Options,
Nebulex.Dialyzer.CachingDecorators
],
ignore_paths: [],
min_module_doc_coverage: 30,
min_module_doc_coverage: 40,
min_module_spec_coverage: 0,
min_overall_doc_coverage: 80,
min_overall_moduledoc_coverage: 100,
Expand Down
16 changes: 16 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
locals_without_parens = [
# Nebulex.Utils
unwrap_or_raise: 1,
wrap_ok: 1,
wrap_error: 1,
wrap_error: 2,

# Nebulex.Cache.Utils
defcacheapi: 2,

# Nebulex.Adapter
defcommand: 1,
defcommand: 2,
defcommandp: 1,
defcommandp: 2,

# Nebulex.Caching
dynamic_cache: 2,
keyref: 1,
keyref: 2,

Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- elixir: 1.15.x
otp: 25.x
os: 'ubuntu-latest'
- elixir: 1.14.x
otp: 24.x
os: 'ubuntu-latest'
- elixir: 1.12.x
otp: 23.x
os: 'ubuntu-20.04'
Expand Down Expand Up @@ -93,27 +90,23 @@ jobs:
if: ${{ matrix.style }}

- name: Run tests
run: |
epmd -daemon
mix test --trace
run: mix test
if: ${{ !matrix.coverage }}

- name: Run tests with coverage
run: |
epmd -daemon
mix coveralls.github
run: mix coveralls.github
if: ${{ matrix.coverage }}

- name: Run sobelow
run: mix sobelow --exit --skip
run: mix sobelow --skip --exit Low
if: ${{ matrix.sobelow }}

- name: Restore PLT Cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v1
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v3-1
if: ${{ matrix.dialyzer }}

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

- name: Doc coverage report
run: MIX_ENV=docs mix inch.report
if: ${{ matrix.inch-report }}

- name: Run documentation health check
run: mix doctor
if: ${{ matrix.doctor }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ erl_crash.dump
/priv
.sobelow*
/config
Elixir*
60 changes: 0 additions & 60 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,6 @@ All notable changes to this project will be documented in this file.

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

## [v2.6.2](https://github.com/cabol/nebulex/tree/v2.6.2) (2024-06-15)

[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.1...v2.6.2)

**Closed issues:**

- Having a cache per user ID
[#224](https://github.com/cabol/nebulex/issues/224)

**Merged pull requests:**

- Fix some compiler warnings in Elixir 1.17
[#222](https://github.com/cabol/nebulex/pull/222)
([peaceful-james](https://github.com/peaceful-james))

## [v2.6.1](https://github.com/cabol/nebulex/tree/v2.6.1) (2024-02-24)

[Full Changelog](https://github.com/cabol/nebulex/compare/v2.6.0...v2.6.1)

**Merged pull requests:**

- Improve variable handing in key generators
[#221](https://github.com/cabol/nebulex/pull/221)
([hissssst](https://github.com/hissssst))

## [v2.6.0](https://github.com/cabol/nebulex/tree/v2.6.0) (2024-01-21)

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

**Fixed bugs:**

- Fix compatibility with Elixir 1.15 and 1.16
[#220](https://github.com/cabol/nebulex/issues/220)

**Closed issues:**

- `Multilevel` inclusive cache doesn't duplicate entries backwards on
`get_all/2`
[#219](https://github.com/cabol/nebulex/issues/219)
- Empty arguments list passed to `generate/3` in Elixir 1.16
[#218](https://github.com/cabol/nebulex/issues/218)
- Regression on decorated functions and Elixir 1.16
[#216](https://github.com/cabol/nebulex/issues/216)
- Bug on Local adapter when using `delete_all` and keys are nested tuples:
not a valid match specification
[#211](https://github.com/cabol/nebulex/issues/211)
- `Nebulex.RegistryLookupError`
[#207](https://github.com/cabol/nebulex/issues/207)
- Docs on Migrating to v2 from Nebulex.Adapters.Dist.Cluster
[#198](https://github.com/cabol/nebulex/issues/198)

**Merged pull requests:**

- Partitioned Adapter supports two-item tuples as keys
[#214](https://github.com/cabol/nebulex/pull/214)
([twinn](https://github.com/twinn))
- Adds nebulex Ecto adapter
[#212](https://github.com/cabol/nebulex/pull/212)
([hissssst](https://github.com/hissssst))

## [v2.5.2](https://github.com/cabol/nebulex/tree/v2.5.2) (2023-07-14)

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

0 comments on commit e157be7

Please sign in to comment.