Skip to content

Commit 5589438

Browse files
committed
Merge branch 'development'
2 parents ccb8dff + ee1300e commit 5589438

File tree

11 files changed

+47
-23
lines changed

11 files changed

+47
-23
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
runs-on: ubuntu-20.04
3030
steps:
3131
- name: Checkout Repository
32-
uses: actions/checkout@v3.2.0
32+
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
3535

3636
- name: Setup Java
37-
uses: actions/setup-java@v3.9.0
37+
uses: actions/setup-java@v4
3838
with:
3939
distribution: "temurin"
4040
java-version: "11"

.github/workflows/gh-release.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ jobs:
1010
create-release:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3.2.0
14-
- uses: taiki-e/create-gh-release-action@v1.5.0
13+
- uses: actions/checkout@v4
14+
- uses: taiki-e/create-gh-release-action@v1.8.2
1515
with:
1616
# Produced by the build/Build.cfc
1717
changelog: changelog.md
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-20.04
2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@v3.2.0
22+
uses: actions/checkout@v4
2323

2424
- uses: Ortus-Solutions/[email protected]
2525
with:

.github/workflows/tests.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
experimental: true
4141
steps:
4242
- name: Checkout Repository
43-
uses: actions/checkout@v3.2.0
43+
uses: actions/checkout@v4
4444

4545
- name: Setup Java
46-
uses: actions/setup-java@v3.9.0
46+
uses: actions/setup-java@v4
4747
with:
4848
distribution: "temurin"
4949
java-version: "${{ matrix.javaVersion }}"
@@ -62,7 +62,7 @@ jobs:
6262
6363
- name: Scan project file system
6464
id: scan
65-
uses: anchore/scan-action@v2
65+
uses: anchore/scan-action@v5
6666
with:
6767
path: "./"
6868
fail-build: true
@@ -108,9 +108,9 @@ jobs:
108108

109109
- name: Upload Test Results to Artifacts
110110
if: always()
111-
uses: actions/upload-artifact@v3.1.1
111+
uses: actions/upload-artifact@v4
112112
with:
113-
name: test-results-${{ matrix.cfengine }}
113+
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}-jdk${{ matrix.javaVersion }}-es${{ matrix.ELASTICSEARCH_VERSION }}
114114
path: |
115115
test-harness/tests/results/**/*
116116
@@ -121,9 +121,9 @@ jobs:
121121
122122
- name: Upload Debugging Log To Artifacts
123123
if: ${{ failure() }}
124-
uses: actions/upload-artifact@v3.1.1
124+
uses: actions/upload-artifact@v4
125125
with:
126-
name: Failure Debugging Info - ${{ matrix.cfengine }}
126+
name: Failure Debugging Info - ${{ matrix.cfengine }} | Coldbox ${{ matrix.coldboxVersion }} ( jdk${{ matrix.javaVersion }}-es${{ matrix.ELASTICSEARCH_VERSION }} )
127127
path: |
128128
.engine/**/logs/*
129129
.engine/**/WEB-INF/cfusion/logs/*

ModuleConfig.cfc

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ component {
7575
interceptorSettings = {
7676
customInterceptionPoints : [
7777
"cbElasticsearchPreSave",
78-
"cbElasticsearchPostSave"
78+
"cbElasticsearchPostSave",
79+
"onLogstashEntryCreate"
7980
]
8081
};
8182

box.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name":"Elasticsearch for the Coldbox Framework",
3-
"author":"Ortus Solutions <[email protected]",
3+
"author":"Ortus Solutions <[email protected]>",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbelasticsearch/@build.version@/[email protected]@[email protected]@.zip",
5-
"version":"3.4.1",
5+
"version":"3.4.2",
66
"slug":"cbelasticsearch",
77
"type":"modules",
88
"homepage":"https://cbelasticsearch.ortusbooks.com",

build/resources/elasticsearch.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ discovery.type: "single-node"
22
cluster.name: "docker-cluster"
33
xpack.security.enabled: "false"
44
network.host: 0.0.0.0
5-
path.repo: ["/tmp"]
5+
path.repo: ["/tmp"]
6+
7+
# ES 8 requires explicit setting of the following
8+
# xpack.security.enabled: false

changelog.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
* * *
99

10-
## [Unreleased]
10+
## [3.4.1] - 2024-11-10
11+
12+
### Added
13+
14+
- Add `onLogstashEntryCreate` interception point, to allow influencing and additions to final log object
15+
- Add `mode` argument to client `saveAll` method to allow for a `create` mode to be used for data streams
1116

1217
## [3.4.1] - 2024-09-26
1318

models/io/HyperClient.cfc

+16-3
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,8 @@ component accessors="true" threadSafe singleton {
12301230
array function saveAll(
12311231
required array documents,
12321232
boolean throwOnError = false,
1233-
struct params = {}
1233+
struct params = {},
1234+
string mode = "update"
12341235
){
12351236
var requests = [];
12361237

@@ -1259,10 +1260,22 @@ component accessors="true" threadSafe singleton {
12591260
}
12601261
}
12611262

1263+
var opAction = { "#mode#" : { "_index" : doc.getIndex() } };
1264+
1265+
if( !isNull( doc.getId() ) ){
1266+
opAction[ mode ][ "_id" ] = doc.getId();
1267+
}
1268+
1269+
var docAction = { "doc" : memento };
1270+
1271+
if( mode == "update" ){
1272+
docAction[ "doc_as_upsert" ] = true;
1273+
}
1274+
12621275
requests.append(
12631276
[
1264-
{ "update" : { "_index" : doc.getIndex(), "_id" : doc.getId() } },
1265-
{ "doc" : memento, "doc_as_upsert" : true }
1277+
opAction,
1278+
docAction
12661279
],
12671280
true
12681281
);

models/util/Util.cfc

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
component accessors="true" singleton {
22

33
property name="appEnvironment" inject="box:setting:environment";
4+
property name="interceptorService" inject="coldbox:InterceptorService";
45

56
/**
67
* Ensures a CF native struct is returned ( allowing for dot-notation )
@@ -158,6 +159,8 @@ component accessors="true" singleton {
158159
}
159160

160161
generateLogEntrySignature( logObj );
162+
163+
interceptorService.announce( "onLogstashEntryCreate", { "entry" : logObj } );
161164
}
162165

163166
/**

test-harness/tests/specs/unit/AppenderServiceTest.cfc

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
109109
"Test message",
110110
4
111111
);
112-
sleep( 1000 );
112+
sleep( 1500 );
113113
expect( getDataStreamCount( appender.getProperty( "dataStreamPattern" ) ) ).toBe( dataStreamCount + 1 );
114114
} );
115115

0 commit comments

Comments
 (0)