Skip to content

Commit 6b65116

Browse files
Merge pull request #138 from sebastianconcept/adds-ci
adds CI instructions and edit readme and changelog
2 parents 437f674 + 1b5d39a commit 6b65116

File tree

10 files changed

+146
-440
lines changed

10 files changed

+146
-440
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Unit Tests
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
unit-tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
smalltalk: [Pharo64-7.0]
11+
redis-version: [7]
12+
mongodb-version: ['4.4']
13+
name: ${{ matrix.smalltalk }}
14+
services:
15+
postgres:
16+
image: postgres:14
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_HOST_AUTH_METHOD: trust
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
ports:
26+
- 5432:5432
27+
steps:
28+
- name: Start Redis
29+
uses: supercharge/[email protected]
30+
with:
31+
redis-version: ${{ matrix.redis-version }}
32+
- name: Start MongoDB
33+
uses: supercharge/[email protected]
34+
with:
35+
mongodb-version: ${{ matrix.mongodb-version }}
36+
mongodb-replica-set: test-rs
37+
- uses: actions/checkout@v2
38+
- uses: hpi-swa/setup-smalltalkCI@v1
39+
with:
40+
smalltalk-image: ${{ matrix.smalltalk }}
41+
- name: Load Image and Run Tests
42+
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.unit-tests.ston
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
timeout-minutes: 15
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v1
48+
with:
49+
name: ${{matrix.os}}-${{matrix.smalltalk}}
50+
token: ${{ secrets.CODECOV_TOKEN }}

.smalltalk.ston

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
SmalltalkCISpec {
2+
#loading : [
3+
SCIMetacelloLoadSpec {
4+
#baseline : 'Mapless',
5+
#directory : 'src',
6+
#load : [ 'Core',
7+
'Memory',
8+
'Postgres',
9+
'Mongo',
10+
'Redis'
11+
],
12+
#platforms : [ #pharo
13+
]
14+
}
15+
]
16+
}

.smalltalkci/.unit-tests.ston

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
SmalltalkCISpec {
2+
#loading : [
3+
SCIMetacelloLoadSpec {
4+
#baseline : 'Mapless',
5+
#directory : '../src',
6+
#load : [ 'Core',
7+
'Memory',
8+
'Postgres',
9+
'Mongo',
10+
'Redis' ],
11+
#platforms : [ #pharo ]
12+
}
13+
],
14+
#testing : {
15+
#coverage : {
16+
#packages : [
17+
'Mapless-Base-Core',
18+
'Mapless-Memory-Core',
19+
'Mapless-Postgres-Core',
20+
'Mapless-Mongo-Core',
21+
'Mapless-Redis-Core'
22+
],
23+
#format: #lcov
24+
}
25+
}
26+
}

README.md

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44

55
Schema-less persistence for Smalltalk with support for multiple backends.
66

7-
[![Release](https://img.shields.io/github/v/tag/sebastianconcept/Mapless?label=release)](https://github.com/sebastianconcept/Mapless/releases)
8-
![Tests](https://img.shields.io/badge/tests-178-green)
7+
[![Unit Tests](https://github.com/sebastianconcept/Mapless/actions/workflows/build.yml/badge.svg)](https://github.com/sebastianconcept/Mapless/actions/workflows/build.yml)
8+
![Tests](https://img.shields.io/badge/tests-193-green)
9+
[![Coverage Status](https://codecov.io/github/sebastianconcept/Mapless/coverage.svg?branch=main)](https://codecov.io/gh/sebastianconcept/Mapless/branch/master)
10+
911
[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE.txt)
12+
[![Release](https://img.shields.io/github/v/tag/sebastianconcept/Mapless?label=release)](https://github.com/sebastianconcept/Mapless/releases)
13+
14+
15+
[![Pharo 7](https://img.shields.io/badge/Pharo-7-%23383932.svg)](https://pharo.org/download)
16+
[![Pharo 10](https://img.shields.io/badge/Pharo-10-%23383932.svg)](https://pharo.org/download)
1017

1118
[![Social](https://img.shields.io/github/stars/sebastianconcept/Mapless?style=social)]()
1219
[![Forks](https://img.shields.io/github/forks/sebastianconcept/Mapless?style=sociall)]()
13-
[![](https://img.shields.io/reddit/subreddit-subscribers/mapless_data?style=social)](https://www.reddit.com/r/mapless_data/)
1420

1521
---
1622

@@ -21,62 +27,84 @@ Schema-less persistence for Smalltalk with support for multiple backends.
2127
- Composable.
2228
- JSON friendly.
2329
- No need to create accessors and mutators.
24-
- Multiple backends to chose from.
30+
- Multiple backends to choose from.
2531
- Enables smooth data migration/interoperation among backends.
26-
- Via Redis PUB/SUB, scalable observer-pattern functionality across images.
32+
- ~~Via Redis PUB/SUB, scalable observer-pattern functionality across images.~~ In the roadmap.
33+
34+
## Description
35+
36+
Mapless is a schema-less persistence framework supporting multiple backends and offering a user-friendly API. For instance, querying Mapless objects involves a common family of methods, and there's no need to declare accessors and mutators. See [examples below](#examples).
37+
38+
Designed to be schema-less, Mapless eliminates the need for schema maintenance and avoids any Object-Relational Mapping requirements.
39+
40+
Mapless achieves a balance of maximum data survivability and robust architectural flexibility without imposing a heavy burden in terms of adoption and maintenance.
2741

2842
## Ambition
2943

30-
Mapless gives you performant state plasticity and high availability in a scale that goes beyond one Smalltalk image and without backend vendor locking nor object-mapping impedance mismatch.
44+
To deliver a high-performance solution that preserves arbitrary application state (data) with a focus on flexibility, availability, and capacity. It aims to strategically aid in scaling without causing backend vendor lock-in, across various persistence backends, and by neutralizing the costs associated with object-mapping impedance mismatch.
3145

3246
## Supported backends
3347

3448
1. MongoDB
3549
2. Redis
3650
3. Memory
3751
4. PostgreSQL
38-
5. UnQLite
52+
5. ~~UnQLite~~ `deprecated` / retiring soon
3953

4054
## Examples
4155

4256
```Smalltalk
4357
"Instanciates a mapless object."
44-
genius := DummyPerson new
58+
philosopher := Person new
4559
firstName: 'Aristotle';
4660
yourself.
4761
4862
"Saves it."
49-
repository save: genius.
63+
repository save: philosopher.
5064
```
5165

5266
```Smalltalk
5367
"Loads one by known ID."
54-
identified := repository findOne: DummyPerson atId: genius id.
68+
identified := repository findOne: Person atId: philosopher id.
5569
```
5670

5771
```Smalltalk
5872
"Loads all instances of that class that were stored in that database."
59-
allOrEmpty := repository findAll: DummyPerson.
73+
allOrEmpty := repository findAll: Person.
6074
```
6175

6276
```Smalltalk
6377
"Query to load all the instances that match the condition."
64-
someOrEmpty := repository findAll: DummyPerson where: [ :each | each lastName = 'Peterson' ].
78+
someOrEmpty := repository findAll: Person where: [ :each | each lastName = 'Peterson' ].
6579
```
6680

6781
```Smalltalk
6882
"Conditionally loading the first matching instance."
69-
oneOrNil := repository findOne: DummyPerson where: [ :each | each lastName = 'Peterson' ].
83+
oneOrNil := repository findOne: Person where: [ :each | each lastName = 'Peterson' ].
7084
```
7185

86+
```Smalltalk
87+
"Create a Person mapless model"
88+
philosopher := Person new
89+
firstName: 'Aristotle';
90+
save.
91+
92+
"Set it as the person for a new User mapless model"
93+
philosopherUser := User new
94+
person: philosopher;
95+
save.
96+
97+
"Query for that user by ID and get its person instance"
98+
aristotle := (User findId: philosopherUser id) person.
99+
```
72100
## Installation
73101

74-
Open a Pharo workspace and evaluate:
102+
Open a workspace in a supported Pharo image and evaluate:
75103

76104
```smalltalk
77105
Metacello new
78106
baseline: 'Mapless';
79-
repository: 'github://sebastianconcept/Mapless:v0.5.7/src';
107+
repository: 'github://sebastianconcept/Mapless:latest/src';
80108
load
81109
```
82110

@@ -88,6 +116,6 @@ In BaselineOf or ConfigurationOf it can be added in this way:
88116
spec
89117
baseline: 'Mapless'
90118
with: [ spec
91-
repository: 'github://sebastianconcept/Mapless:v0.5.0-alpha/src';
92-
load: #('Core' 'Mongo' 'Memory' 'Redis' 'UnQLite') ]
119+
repository: 'github://sebastianconcept/Mapless:latest/src';
120+
load: #('Core' 'Postgres' 'Mongo' 'Redis' 'Memory') ]
93121
```

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Jan 25, 2024
2+
===================================
3+
- Updating `master` branch to keep up with the latests useful upgrades.
4+
- Adding badges to the README.md for constant monitoring of CI, unit tests, regression detection capacity and supported Pharo versions.
5+
- Adds CI via GitHub actions.
6+
17
May 22, 2023
28
===================================
39
- Improved `MongoAPI` by adding `initializeMongoUrl` and a lazy accessor using it and `Array` instead of `Set` so comparing it on the fly from `getIdleReadOnlyClient` is significantly faster now.

0 commit comments

Comments
 (0)