Skip to content

Commit 912cb2e

Browse files
authored
v5.1.0
2 parents 8ec18bc + faf5f18 commit 912cb2e

405 files changed

Lines changed: 84392 additions & 7038 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
# 4 space indentation
9+
[*.java]
10+
indent_style = space
11+
indent_size = 4
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Assign Author
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
assign-author:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: toshimaru/auto-author-assign@v1.6.2
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v4
12+
with:
13+
java-version: "17"
14+
distribution: "temurin"
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
- name: Install gpg secret key
19+
run: |
20+
# Install gpg secret key
21+
echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
22+
# Verify that the key ID is shown in the logs
23+
gpg --list-secret-keys --keyid-format LONG | grep "${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}"
24+
- name: Publish to Central Repository
25+
env:
26+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
28+
run: |
29+
mvn \
30+
--no-transfer-progress \
31+
--batch-mode \
32+
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
33+
clean deploy

.github/workflows/run-tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Unit Tests Run
2+
on:
3+
pull_request:
4+
branches:
5+
- '**'
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Java 17
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '17'
17+
distribution: 'temurin'
18+
19+
- name: Build with Maven
20+
run: mvn test
21+
22+

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Temp test files
2+
3+
src/main/resources/yaml-testing/
4+
5+
16
# Compiled class file
27
*.class
38

@@ -25,4 +30,13 @@ replay_pid*
2530

2631
target/
2732

28-
*.gpg
33+
*.gpg
34+
35+
# IDEs
36+
37+
.vscode
38+
39+
.idea
40+
41+
# MacOS
42+
.DS_Store

.vscode/settings.json

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

pom.xml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
<groupId>io.github.isa-group</groupId>
99
<artifactId>Pricing4Java</artifactId>
10-
<version>4.0.1</version>
10+
<version>5.1.0</version>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>
1313
<description>A pricing driven feature toggling library for java</description>
14-
<url>https://github.com/Alex-GF/pricingplans-4j</url>
14+
<url>https://github.com/isa-group/Pricing4Java</url>
1515
<packaging>jar</packaging>
1616

1717
<licenses>
@@ -53,9 +53,10 @@
5353
<aspectj.version>1.9.7</aspectj.version>
5454
<spring.version>6.1.5</spring.version>
5555
<spring.boot.version>3.2.0</spring.boot.version>
56-
<maven.compiler.source>11</maven.compiler.source>
57-
<maven.compiler.target>11</maven.compiler.target>
58-
</properties>
56+
<maven.compiler.source>17</maven.compiler.source>
57+
<maven.compiler.target>17</maven.compiler.target>
58+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
59+
</properties>
5960

6061

6162
<dependencies>
@@ -140,6 +141,12 @@
140141
<version>5.10.2</version>
141142
<scope>test</scope>
142143
</dependency>
144+
<dependency>
145+
<groupId>org.junit.jupiter</groupId>
146+
<artifactId>junit-jupiter-params</artifactId>
147+
<version>5.10.2</version>
148+
<scope>test</scope>
149+
</dependency>
143150

144151
<!-- JSON WEB TOKEN -->
145152
<dependency>
@@ -157,7 +164,7 @@
157164
<dependency>
158165
<groupId>org.yaml</groupId>
159166
<artifactId>snakeyaml</artifactId>
160-
<version>1.33</version>
167+
<version>2.3</version>
161168
</dependency>
162169

163170
<!-- API, java.xml.bind module -->
@@ -183,13 +190,20 @@
183190
<plugin>
184191
<groupId>org.apache.maven.plugins</groupId>
185192
<artifactId>maven-gpg-plugin</artifactId>
193+
<version>3.2.7</version>
186194
<executions>
187195
<execution>
188196
<id>sign-artifacts</id>
189197
<phase>verify</phase>
190198
<goals>
191199
<goal>sign</goal>
192200
</goals>
201+
<configuration>
202+
<gpgArguments>
203+
<arg>--pinentry-mode</arg>
204+
<arg>loopback</arg>
205+
</gpgArguments>
206+
</configuration>
193207
</execution>
194208
</executions>
195209
</plugin>
@@ -212,9 +226,32 @@
212226
</dependencies>
213227
</plugin>
214228
<plugin>
215-
<groupId>org.apache.maven.plugins</groupId>
216229
<artifactId>maven-surefire-plugin</artifactId>
217-
<version>3.2.5</version>
230+
<version>3.5.2</version>
231+
<dependencies>
232+
<dependency>
233+
<groupId>me.fabriciorby</groupId>
234+
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
235+
<version>1.4.0</version>
236+
</dependency>
237+
</dependencies>
238+
<configuration>
239+
<reportFormat>plain</reportFormat>
240+
<consoleOutputReporter>
241+
<disable>true</disable>
242+
</consoleOutputReporter>
243+
<statelessTestsetInfoReporter
244+
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
245+
<printStacktraceOnError>true</printStacktraceOnError>
246+
<printStacktraceOnFailure>true</printStacktraceOnFailure>
247+
<printStdoutOnError>true</printStdoutOnError>
248+
<printStdoutOnFailure>true</printStdoutOnFailure>
249+
<printStdoutOnSuccess>false</printStdoutOnSuccess>
250+
<printStderrOnError>true</printStderrOnError>
251+
<printStderrOnFailure>true</printStderrOnFailure>
252+
<printStderrOnSuccess>false</printStderrOnSuccess>
253+
</statelessTestsetInfoReporter>
254+
</configuration>
218255
</plugin>
219256
<plugin>
220257
<groupId>org.apache.maven.plugins</groupId>
@@ -245,7 +282,7 @@
245282
<plugin>
246283
<groupId>org.jacoco</groupId>
247284
<artifactId>jacoco-maven-plugin</artifactId>
248-
<version>0.8.11</version>
285+
<version>0.8.12</version>
249286
<executions>
250287
<execution>
251288
<goals>
@@ -263,4 +300,4 @@
263300
</plugin>
264301
</plugins>
265302
</build>
266-
</project>
303+
</project>

specification/CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Yaml4SaaS Specification Changelog
2+
3+
:warning: If no `version` is specified version 1.0 is set by default
4+
5+
## Version 1.0
6+
7+
## Version 1.1
8+
9+
### :white_check_mark: New
10+
11+
- new field `createdAt` to replace `day` `month` and `year`, see this [section](#deleted)
12+
- now addOns can depend on addOns putting the name of the addOn in the `avaliableFor` field
13+
14+
### :x: Deleted
15+
16+
- `day` `month` and `year` were used to indicate the day when the pricing was modeled.
17+
These fields has been deleted as in yaml it is possible to specify a date.
18+
Use new field `createdAt` instead.
19+
20+
### :up: Improvements
21+
22+
- Now you can skip duplicating the same `expression` in the `serverExpression` in a feature.
23+
`serverExpression` has the same evaluation in `expression` by default. You can still
24+
overwrite `serverExpression` if you want to be different.
25+
26+
## Version 2.0
27+
28+
### :white_check_mark: New
29+
30+
- new field in plan called `price` that supports setting the price with a number or
31+
compute mathematical expression to determine the price of the plan. Expression can
32+
be greatly reduced with `variables` feature
33+
- new root field called `variables` to use in conjunction when computing expressions
34+
plans prices. Assume that your plan price is calculated according to the number of
35+
conections `c` you want and uses the following formula `2*c + 3 / (c+1)` to compute
36+
the price. You can define in `variables` map parameter `c`.
37+
- dependencies between addons using the attribute `dependsOn`
38+
39+
### :x: Deleted
40+
41+
- plan fields `monthlyPrice` and `annualPrice` removed, use `price` instead
42+
43+
## Future Work (not yet implemented)
44+
45+
- new field in plan called `private` to indicate denote that you should contact sales
46+
to hire their services
47+
48+
- new root field called `billing` holds the discount ratio of different billing
49+
present in the pricing. Assumming that discount ratios are applied to the monthly price
50+
of plans and addOns
51+
52+
- feature groups using tags

0 commit comments

Comments
 (0)