8000 Merge pull request #14 from AppsFlyer/log4j-cve · AppsFlyer/unleash-client-clojure@5a79c2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a79c2d

Browse files
authored
Merge pull request #14 from AppsFlyer/log4j-cve
Work around log4j cve
2 parents 9f55de2 + fb4db37 commit 5a79c2d

File tree

7 files changed

+299
-28
lines changed

7 files changed

+299
-28
lines changed

.github/workflows/build_test_pr.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Pull Request Build & Test"
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-18.04
10+
timeout-minutes: 5
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 1.8
18+
- name: Restore local Maven repository from cache
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.m2/repository
22+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
23+
restore-keys: |
24+
${{ runner.os }}-maven-
25+
- name: Validate SNAPSHOT version
26+
env:
27+
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$
28+
if: github.ref != 'refs/heads/master'
29+
run: |
30+
lein pom
31+
export VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
32+
echo "Version is:" $VERSION
33+
if [[ !("$VERSION" =~ $SNAPSHOT_REGEX) ]]
34+
then
35+
echo "Version isn't a SNAPSHOT version:" $VERSION
36+
exit 0
37+
fi
38+
- name: lint
39+
run: lein lint
40+
41+
test:
42+
needs: build
43+
runs-on: ubuntu-18.04
44+
timeout-minutes: 5
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v2
48+
- name: Set up JDK 8
49+
uses: actions/setup-java@v1
50+
with:
51+
java-version: 1.8
52+
- name: Restore local Maven repository from cache
53+
uses: actions/cache@v2
54+
with:
55+
path: ~/.m2/repository
56+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
57+
restore-keys: |
58+
${{ runner.os }}-maven-
59+
- name: Unit and integration tests
60+
run: lein test :all

.github/workflows/ci_branch.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: "Push CI - branches"
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-18.04
11+
timeout-minutes: 5
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Set up JDK 8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
- name: Restore local Maven repository from cache
20+
uses: actions/cache@v2
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
26+
- name: Validate SNAPSHOT version
27+
env:
28+
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$
29+
if: github.ref != 'refs/heads/master'
30+
run: |
31+
lein pom
32+
export VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
33+
echo "Version is:" $VERSION
34+
if [[ !("$VERSION" =~ $SNAPSHOT_REGEX) ]]
35+
then
36+
echo "Version isn't a SNAPSHOT version:" $VERSION
37+
exit 0
38+
fi
39+
- name: lint
40+
run: lein lint
41+
42+
test:
43+
needs: build
44+
runs-on: ubuntu-18.04
45+
timeout-minutes: 5
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
- name: Set up JDK 8
50+
uses: actions/setup-java@v1
51+
with:
52+
java-version: 1.8
53+
- name: Restore local Maven repository from cache
54+
uses: actions/cache@v2
55+
with:
56+
path: ~/.m2/repository
57+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
58+
restore-keys: |
59+
${{ runner.os }}-maven-
60+
- name: Unit and Integration tests
61+
run: lein eftest :all
62+
- name: Publish unit and integration test results
63+
uses: EnricoMi/publish-unit-test-result-action@v1.6
64+
if: always()
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
files: "target/junit.xml"
68+
69+
deploy:
70+
needs: test
71+
runs-on: ubuntu-18.04
72+
timeout-minutes: 5
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v2
76+
- name: Set up JDK 8
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: 1.8
80+
- name: Restore local Maven repository from cache
81+
uses: actions/cache@v2
82+
with:
83+
path: ~/.m2/repository
84+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
85+
restore-keys: |
86+
${{ runner.os }}-maven-
87+
- name: Deploy SNAPSHOT version
88+
env:
89+
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
92+
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
93+
run: |
94+
git config --global user.name "github-actions-bot"
95+
git config --global user.email "<>"
96+
lein pom
97+
export SNAPSHOT_VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
98+
echo "SNAPSHOT version is:" $SNAPSHOT_VERSION
99+
if [[ !("$SNAPSHOT_VERSION" =~ $SNAPSHOT_REGEX) ]]
100+
then
101+
echo "Version isn't a SNAPSHOT version:" $SNAPSHOT_VERSION ", skipping deployment to Clojars..."
102+
exit 0
103+
fi
104+
lein deploy
105+
echo "SNAPSHOT version:" $SNAPSHOT_VERSION"; commit: "${{github.sha}}"; successfully deployed to Clojars"

.github/workflows/ci_master.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: "Push CI - master"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-18.04
11+
timeout-minutes: 5
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Set up JDK 8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
- name: Restore local Maven repository from cache
20+
uses: actions/cache@v2
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
26+
- name: Validate SNAPSHOT version
27+
env:
28+
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$
29+
if: github.ref != 'refs/heads/master'
30+
run: |
31+
lein pom
32+
export VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
33+
echo "Version is:" $VERSION
34+
if [[ !("$VERSION" =~ $SNAPSHOT_REGEX) ]]
35+
then
36+
echo "Version isn't a SNAPSHOT version:" $VERSION
37+
exit 0
38+
fi
39+
- name: lint
40+
run: lein lint
41+
42+
test:
43+
needs: build
44+
runs-on: ubuntu-18.04
45+
timeout-minutes: 5
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
- name: Set up JDK 8
50+
uses: actions/setup-java@v1
51+
with:
52+
java-version: 1.8
53+
- name: Restore local Maven repository from cache
54+
uses: actions/cache@v2
55+
with:
56+
path: ~/.m2/repository
57+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
58+
restore-keys: |
59+
${{ runner.os }}-maven-
60+
- name: Unit and Integration tests
61+
run: lein eftest :all
62+
- name: Publish unit and integration test results
63+
uses: EnricoMi/publish-unit-test-result-action@v1.6
64+
if: always()
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
files: "target/junit.xml"
68+
69+
deploy:
70+
needs: test
71+
runs-on: ubuntu-18.04
72+
timeout-minutes: 5
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v2
76+
- name: Set up JDK 8
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: 1.8
80+
- name: Restore local Maven repository from cache
81+
uses: actions/cache@v2
82+
with:
83+
path: ~/.m2/repository
84+
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
85+
restore-keys: |
86+
${{ runner.os }}-maven-
87+
- name: Deploy release version
88+
env:
89+
RELEASE_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}$
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
92+
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
93+
run: |
94+
git config --global user.name "github-actions-bot"
95+
git config --global user.email "<>"
96+
git config --global push.followTags true
97+
lein pom
98+
export ORIGINAL_VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
99+
echo "Original version is:" $ORIGINAL_VERSION
100+
lein change version leiningen.release/bump-version release
101+
lein do vcs commit, install
102+
lein pom
103+
export RELEASE_VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
104+
echo "Release version is:" $RELEASE_VERSION
105+
if [[ !("$RELEASE_VERSION" =~ $RELEASE_REGEX) ]]
106+
then
107+
echo "Version isn't a release version:" $RELEASE_VERSION ", skipping deployment to Clojars..."
108+
exit 0
109+
fi
110+
git tag -a $RELEASE_VERSION -m "Release version $RELEASE_VERSION"
111+
git push origin master
112+
lein deploy
113+
echo "Release version:" $RELEASE_VERSION"; commit: "${{github.sha}}"; successfully deployed to Clojars"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ pom.xml.asc
1616
.lsp
1717
.settings
1818
.project
19-
.idea
19+
.idea
20+
.bloop
21+
.metals

CHANGELOG.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# Change Log
22
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
33

4-
## [Unreleased]
4+
## [0.3.0]
55
### Changed
6-
- Add a new arity to `make-widget-async` to provide a different widget shape.
7-
8-
## [0.1.1] - 2020-08-20
9-
### Changed
10-
- Documentation on how to make the widgets.
11-
12-
### Removed
13-
- `make-widget-sync` - we're all async, all the time.
14-
15-
### Fixed
16-
- Fixed widget maker to keep working when daylight savings switches over.
17-
18-
## 0.1.0 - 2020-08-20
19-
### Added
20-
- Files from the new template.
21-
- Widget maker public API - `make-widget-sync`.
22-
23-
[Unreleased]: https://github.com/your-name/unleash-client-clojure/compare/0.1.1...HEAD
24-
[0.1.1]: https://github.com/your-name/unleash-client-clojure/compare/0.1.0...0.1.1
6+
- removed direct log dependency originating upstream.

project.clj

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
(defproject unleash-client-clojure "0.2.1"
1+
(defproject unleash-client-clojure "0.3.0"
22
:description "A Clojure library wrapping https://github.com/Unleash/unleash-client-java"
33
:url "https://github.com/AppsFlyer/unleash-client-clojure"
44
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
55
:url "https://www.eclipse.org/legal/epl-2.0/"}
6-
:dependencies [[no.finn.unleash/unleash-client-java "3.3.3"]]
7-
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.1"]
6+
:deploy-repositories [["releases" {:url "https://repo.clojars.org"
7+
:username :env/clojars_username
8+
:password :env/clojars_password
9+
:sign-releases false}]
10+
["snapshots" {:url "https://repo.clojars.org"
11+
:username :env/clojars_username
12+
:password :env/clojars_password
13+
:sign-releases false}]]
14+
:dependencies [[no.finn.unleash/unleash-client-java "3.3.4" :exclusions [org.apache.logging.log4j/log4j-api]]]
15+
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.3"]
816
[clj-kondo "RELEASE"]
9-
[org.apache.logging.log4j/log4j-core "2.11.2"]]
17+
[org.apache.logging.log4j/log4j-core "2.15.0"]]
1018
:aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
1119
"lint" ["run" "-m" "clj-kondo.main" "--lint" "src" "test"]}
12-
:plugins [[lein-ancient "0.6.15"]
13-
[lein-cloverage "1.2.0"]]
20+
:plugins [[lein-ancient "1.0.0-RC3"]
21+
[lein-cloverage "1.2.2"]
22+
[lein-eftest "0.5.9"]]
1423
:global-vars {*warn-on-reflection* true}}})

src/unleash_client_clojure/fake.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
([this toggle-name context default-variant]
3333
(OptionalPayloadVariant. (.getVariant this ^String toggle-name ^UnleashContext context ^Variant default-variant))))
3434

35-
(get-toggle-definition [this toggle-name]
35+
(get-toggle-definition [_this _toggle-name]
3636
(throw (UnsupportedOperationException.)))
3737

3838
(get-feature-toggle-names [this]

0 commit comments

Comments
 (0)
0