Skip to content

Commit 550c1e4

Browse files
gazbertgazbert
andauthored
Deps updates (#170)
* #169 - Updated Dockerfile + docs * #169 - Updated misc maven deps - no problems * #169 - Updated maven build to use Boot 3.3.5 * #169 - Updated Gradle build deps * #169 - Uplift Snakeyaml to v2.2 * #169 - Lombok + Intellisense cleanup * #169 - Added Lombok to domain objects * #169 - Added Lombok + cleanup * #169 - Repo cleanup * #169 - Use parametrised log statements * #169 - Use parameterised log statements * #169 - Use parameterised log statements * chore: #169 - Use Lombok + parameterised logging * Some Intellisense cleanup too. * chore: #169 - Spring 6.1 RequestParam fix * Since Spring 6.1, RequestParam names are no longer "auto discovered" via Spring magic... you need to specify them or use compiler flags. See: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.1-Release-Notes#parameter-name-retention * Cleanup of builds files too. * docs: #169 - Added Code of Conduct & adopt semantic commits * chore: #169 - Added missing javadoc * docs: Commit example tweak * Follow the GitHub convention of using putting the ticket number at end of commit msg. * docs: Commit example tweak (#169) * Follow the GitHub convention of using putting the ticket number at end of commit msg. * chore: Use parameterised logging (#169) * test: Replace deprecated test class (#169) * chore: Use parameterised logging (#169) * chore: Use Lombok + parameterise logging (#169) * Some misc test code cleanup too. * chore: Fix Sonar URL whines (#169) * test: Fix Sonar test whines (#169) * test: Fix more Sonar test whines (#169) * test: Fix last Sonar test whines (#169) * test: Fix deprecated mock usage (#169) --------- Co-authored-by: gazbert <[email protected]>
1 parent f9a2a4a commit 550c1e4

File tree

121 files changed

+1423
-2983
lines changed

Some content is hidden

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

121 files changed

+1423
-2983
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A clear and concise description of what the bug is.
1414
Steps to reproduce the behavior:
1515
1. I configured the bot to run against Bitstamp...
1616
2. I started the bot successfully...
17-
3. When the bot tried to send a buy order, it shutdown with xyz error ...
17+
3. When the bot tried to send a buy order, it shut down with xyz error ...
1818

1919
**Expected behavior**
2020
A clear and concise description of what you expected to happen.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Code of Conduct breach
3+
about: Report any breaches of the Contributor Covenant.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Code of Conduct**
11+
12+
We support and adopt the [Contributor Covenant](https://www.contributor-covenant.org/) for the BX-bot project.
13+
14+
If you feel that the behaviour of another developer has breached this covenant,
15+
please raise an issue here.

.mvn/wrapper/maven-wrapper.jar

-61.1 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official email address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
[BX-bot Issues](https://github.com/gazbert/bxbot/issues).
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ To work on something, whether a new feature or a bug fix:
4949
git checkout -b my-new-feature-or-bugfix-branch
5050
```
5151
5. Write some code! Commit to that branch locally, and regularly push your work to the same
52-
branch on the server. Commit messages must have a short description no longer than 50 characters
53-
followed by a blank line and a longer, more descriptive message that includes reference to
54-
issue(s) being addressed so that they will be automatically closed on a merge e.g.
55-
```Closes #1234``` or ```Fixes #1234``` - see
52+
branch on the server. When writing a commit message please use
53+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) that include references to
54+
issue being addressed, so that they will be automatically closed on a merge e.g.
55+
```fix: Fixed the NullPointer bug (#123)``` - see
5656
[here](https://help.github.com/articles/closing-issues-via-commit-messages/) for more details.
57-
When writing a commit message please follow
58-
[these conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
5957

60-
6. Any code changes that affect documentation (e.g. README.MD) should be accompanied by
58+
6. Any code changes that affect documentation (e.g. README.md) should be accompanied by
6159
corresponding changes (or additions) to the documentation and tests. This will ensure that if
6260
the merged PR is reversed, all traces of the change will be reversed as well.
6361

@@ -91,4 +89,9 @@ The following conventions should be followed:
9189
* We like static analysis: the build uses [JaCoCo](https://www.jacoco.org/jacoco/) to enforce code
9290
coverage and [SpotBugs](https://spotbugs.github.io/) to weed out bugs.
9391
[Sonarcloud](https://sonarcloud.io/dashboard?id=gazbert_bxbot) is used for analysing and
94-
maintaining the quality of our code. Please maintain this, or better still, help improve it!
92+
maintaining the quality of our code. Please maintain this, or better still, help improve it!
93+
94+
## Code of Conduct
95+
We want the BX-bot project to be a friendly and collaborative development experience for everyone.
96+
97+
We adopt and support the [Contributor Covenant](https://www.contributor-covenant.org/).

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
FROM eclipse-temurin:21.0.2_13-jdk
1+
FROM eclipse-temurin:21-jdk
22

3+
# Install editor for folks to play around with the config.
34
RUN apt-get update
4-
RUN apt-get install -y maven
5+
RUN apt-get install -y vim
56

67
COPY . bxbot-staging
7-
88
WORKDIR ./bxbot-staging
9-
RUN mvn clean package
9+
10+
RUN ./mvnw clean package
1011
RUN cp ./bxbot-app/target/bxbot-app-*-dist.tar.gz /
1112

1213
WORKDIR /

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Gradle CI](https://github.com/gazbert/bxbot/actions/workflows/gradle.yml/badge.svg?branch=main)](https://github.com/gazbert/bxbot/actions/workflows/gradle.yml)
44
[![Maven CI](https://github.com/gazbert/bxbot/actions/workflows/maven.yml/badge.svg?branch=main)](https://github.com/gazbert/bxbot/actions/workflows/maven.yml)
55
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=gazbert_bxbot&metric=alert_status)](https://sonarcloud.io/dashboard?id=gazbert_bxbot)
6+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
67
[![Join the chat at https://gitter.im/BX-bot/Lobby](https://badges.gitter.im/BX-bot/Lobby.svg)](https://gitter.im/BX-bot/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
78

89
## What is BX-bot?
@@ -109,7 +110,10 @@ and evaluate the bot, Docker is the way to go.
109110
1. Usage: `./bxbot.sh [start|stop|status]`
110111
1. You can detach from the container and leave the bot running using the `CTRL-p` `CTRL-q` key sequence.
111112
1. To re-attach to the Docker container, run `docker container ls` to get the CONTAINER ID.
112-
Then run: `docker container attach <CONTAINER ID>`
113+
Then run: `docker container attach <CONTAINER ID>`
114+
115+
You could modify the [Dockerfile](./Dockerfile) to containerise the bot and deploy to Kubernetes. The config can
116+
be externalised using a Docker [volume](https://docs.docker.com/engine/storage/) mount.
113117

114118
## Build Guide
115119
If you plan on developing the bot, you'll need JDK 21 installed on your dev box.
@@ -291,7 +295,7 @@ You specify which markets you want to trade on in the
291295
292296
- id: ltcusd
293297
name: LTC/BTC
294-
baseCurrency: LTC
298+
baseCurrency: LTC[CONTRIBUTING.md](CONTRIBUTING.md)
295299
counterCurrency: BTC
296300
enabled: false
297301
tradingStrategyId: scalping-strategy

build.gradle

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ buildscript {
66
}
77

88
dependencies {
9-
classpath('io.spring.gradle:dependency-management-plugin:1.1.4')
10-
classpath('org.springframework.boot:spring-boot-gradle-plugin:3.1.11')
9+
classpath('io.spring.gradle:dependency-management-plugin:1.1.6')
10+
classpath('org.springframework.boot:spring-boot-gradle-plugin:3.3.5')
1111
}
1212
}
1313

1414
plugins {
15-
id 'org.sonarqube' version '5.0.0.4638' // https://plugins.gradle.org/plugin/org.sonarqube
15+
id 'org.sonarqube' version '5.1.0.4882' // https://plugins.gradle.org/plugin/org.sonarqube
1616
id 'jacoco'
17-
id 'com.github.spotbugs' version '5.2.5' // https://plugins.gradle.org/plugin/com.github.spotbugs
17+
id 'com.github.spotbugs' version '6.0.26' // https://plugins.gradle.org/plugin/com.github.spotbugs
1818
}
1919

2020
buildScan {
@@ -23,11 +23,11 @@ buildScan {
2323
}
2424

2525
ext.versions = [
26-
springBootVersion : '3.1.11',
27-
springCloudVersion : '4.0.5',
26+
springBootVersion : '3.3.5',
27+
springCloudVersion : '4.1.4',
2828

2929
// Should be same as dependency used by springBootVersion
30-
springCoreVersion : '6.0.19',
30+
springCoreVersion : '6.1.14',
3131

3232
hibernateVaildatorVersion: '8.0.1.Final',
3333
jjwtVersion : '0.11.5'
@@ -56,43 +56,44 @@ ext.libraries = [
5656
spring_cloud_starter : dependencies.create("org.springframework.cloud:spring-cloud-starter:" + ext.versions.springCloudVersion) {
5757
exclude module: "spring-boot-starter-logging"
5858
},
59+
5960
spring_tx : dependencies.create("org.springframework:spring-tx:" + ext.versions.springCoreVersion),
6061

6162
jjwt_api : dependencies.create("io.jsonwebtoken:jjwt-api:" + ext.versions.jjwtVersion),
6263
jjwt_impl : dependencies.create("io.jsonwebtoken:jjwt-impl:" + ext.versions.jjwtVersion),
6364
jjwt_jackson : dependencies.create("io.jsonwebtoken:jjwt-jackson:" + ext.versions.jjwtVersion),
6465

65-
google_guava : dependencies.create("com.google.guava:guava:33.1.0-jre"),
66-
google_gson : dependencies.create("com.google.code.gson:gson:2.10.1"),
67-
h2 : dependencies.create("com.h2database:h2:2.2.224"),
66+
google_guava : dependencies.create("com.google.guava:guava:33.3.1-jre"),
67+
google_gson : dependencies.create("com.google.code.gson:gson:2.11.0"),
68+
h2 : dependencies.create("com.h2database:h2:2.3.232"),
6869

6970
jakarta_mail_api : dependencies.create("jakarta.mail:jakarta.mail-api:2.1.3"),
7071
jakarta_mail_sun : dependencies.create("org.eclipse.angus:angus-mail:2.0.3"),
7172

7273
jakarta_xml_api : dependencies.create("jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"),
7374

74-
snake_yaml : dependencies.create("org.yaml:snakeyaml:1.33"),
75+
snake_yaml : dependencies.create("org.yaml:snakeyaml:2.2"),
7576

76-
springdoc_openapi_ui : dependencies.create("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0"),
77+
springdoc_openapi_ui : dependencies.create("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0"),
7778

78-
lombok : dependencies.create("org.projectlombok:lombok:1.18.32"),
79+
lombok : dependencies.create("org.projectlombok:lombok:1.18.34"),
7980

8081
validation_api : dependencies.create("jakarta.validation:jakarta.validation-api:3.0.2"),
8182
hibernate_validator : dependencies.create("org.hibernate.validator:hibernate-validator:" + ext.versions.hibernateVaildatorVersion),
8283
hibernate_validator_annotation_processor: dependencies.create("org.hibernate.validator:hibernate-validator-annotation-processor:" + ext.versions.hibernateVaildatorVersion),
8384

8485
powermock_junit : dependencies.create("org.powermock:powermock-module-junit4:2.0.9"),
8586
powermock_api_easymock : dependencies.create("org.powermock:powermock-api-easymock:2.0.9"),
86-
easymock : dependencies.create("org.easymock:easymock:5.2.0"),
87+
easymock : dependencies.create("org.easymock:easymock:5.4.0"),
8788

8889
// JUnit 4 still as Powermock does not play with Junit 5: https://github.com/powermock/powermock/issues/929
89-
junit_vintage_engine : dependencies.create("org.junit.vintage:junit-vintage-engine:5.10.2"),
90+
junit_vintage_engine : dependencies.create("org.junit.vintage:junit-vintage-engine:5.11.3"),
9091

9192
spring_boot_starter_test : dependencies.create("org.springframework.boot:spring-boot-starter-test:" + ext.versions.springBootVersion) {
9293
exclude module: "spring-boot-starter-logging"
9394
},
94-
spring_security_test : dependencies.create("org.springframework.security:spring-security-test:6.1.8"),
95-
awaitility : dependencies.create("org.awaitility:awaitility:4.2.1")
95+
spring_security_test : dependencies.create("org.springframework.security:spring-security-test:6.3.4"),
96+
awaitility : dependencies.create("org.awaitility:awaitility:4.2.2")
9697
]
9798

9899
allprojects {
@@ -167,7 +168,7 @@ subprojects {
167168
ignoreFailures = false
168169
excludeFilter = file("${rootDir}/etc/spotbugs-exclude-filter.xml")
169170
reportsDir = file("$project.buildDir/reports/spotbugs")
170-
effort = "max"
171+
effort = com.github.spotbugs.snom.Effort.MAX
171172
}
172173
spotbugsMain {
173174
reports {

bxbot-core/src/main/java/com/gazbert/bxbot/core/config/exchange/AuthenticationConfigImpl.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
import com.gazbert.bxbot.exchange.api.AuthenticationConfig;
2727
import java.util.HashMap;
2828
import java.util.Map;
29+
import lombok.Setter;
2930

3031
/**
3132
* Exchange API Authentication config.
3233
*
3334
* @author gazbert
3435
*/
36+
@Setter
3537
public class AuthenticationConfigImpl implements AuthenticationConfig {
3638

3739
private Map<String, String> items;
@@ -54,13 +56,4 @@ public String getItem(String name) {
5456
Map<String, String> getItems() {
5557
return items;
5658
}
57-
58-
/**
59-
* Sets the config items.
60-
*
61-
* @param items the config items.
62-
*/
63-
public void setItems(Map<String, String> items) {
64-
this.items = items;
65-
}
6659
}

0 commit comments

Comments
 (0)