Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Nov 10, 2024
2 parents ccb8dff + ee1300e commit 5589438
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v3.9.0
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.2.0
- uses: taiki-e/create-gh-release-action@v1.5.0
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1.8.2
with:
# Produced by the build/Build.cfc
changelog: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4

- uses: Ortus-Solutions/[email protected]
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3.9.0
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "${{ matrix.javaVersion }}"
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Scan project file system
id: scan
uses: anchore/scan-action@v2
uses: anchore/scan-action@v5
with:
path: "./"
fail-build: true
Expand Down Expand Up @@ -108,9 +108,9 @@ jobs:

- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.cfengine }}
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}-jdk${{ matrix.javaVersion }}-es${{ matrix.ELASTICSEARCH_VERSION }}
path: |
test-harness/tests/results/**/*
Expand All @@ -121,9 +121,9 @@ jobs:
- name: Upload Debugging Log To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
name: Failure Debugging Info - ${{ matrix.cfengine }} | Coldbox ${{ matrix.coldboxVersion }} ( jdk${{ matrix.javaVersion }}-es${{ matrix.ELASTICSEARCH_VERSION }} )
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*
Expand Down
3 changes: 2 additions & 1 deletion ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ component {
interceptorSettings = {
customInterceptionPoints : [
"cbElasticsearchPreSave",
"cbElasticsearchPostSave"
"cbElasticsearchPostSave",
"onLogstashEntryCreate"
]
};

Expand Down
4 changes: 2 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name":"Elasticsearch for the Coldbox Framework",
"author":"Ortus Solutions <[email protected]",
"author":"Ortus Solutions <[email protected]>",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbelasticsearch/@build.version@/[email protected]@[email protected]@.zip",
"version":"3.4.1",
"version":"3.4.2",
"slug":"cbelasticsearch",
"type":"modules",
"homepage":"https://cbelasticsearch.ortusbooks.com",
Expand Down
5 changes: 4 additions & 1 deletion build/resources/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ discovery.type: "single-node"
cluster.name: "docker-cluster"
xpack.security.enabled: "false"
network.host: 0.0.0.0
path.repo: ["/tmp"]
path.repo: ["/tmp"]

# ES 8 requires explicit setting of the following
# xpack.security.enabled: false
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* * *

## [Unreleased]
## [3.4.1] - 2024-11-10

### Added

- Add `onLogstashEntryCreate` interception point, to allow influencing and additions to final log object
- Add `mode` argument to client `saveAll` method to allow for a `create` mode to be used for data streams

## [3.4.1] - 2024-09-26

Expand Down
19 changes: 16 additions & 3 deletions models/io/HyperClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,8 @@ component accessors="true" threadSafe singleton {
array function saveAll(
required array documents,
boolean throwOnError = false,
struct params = {}
struct params = {},
string mode = "update"
){
var requests = [];

Expand Down Expand Up @@ -1259,10 +1260,22 @@ component accessors="true" threadSafe singleton {
}
}

var opAction = { "#mode#" : { "_index" : doc.getIndex() } };

if( !isNull( doc.getId() ) ){
opAction[ mode ][ "_id" ] = doc.getId();
}

var docAction = { "doc" : memento };

if( mode == "update" ){
docAction[ "doc_as_upsert" ] = true;
}

requests.append(
[
{ "update" : { "_index" : doc.getIndex(), "_id" : doc.getId() } },
{ "doc" : memento, "doc_as_upsert" : true }
opAction,
docAction
],
true
);
Expand Down
3 changes: 3 additions & 0 deletions models/util/Util.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
component accessors="true" singleton {

property name="appEnvironment" inject="box:setting:environment";
property name="interceptorService" inject="coldbox:InterceptorService";

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

generateLogEntrySignature( logObj );

interceptorService.announce( "onLogstashEntryCreate", { "entry" : logObj } );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test-harness/tests/specs/unit/AppenderServiceTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
"Test message",
4
);
sleep( 1000 );
sleep( 1500 );
expect( getDataStreamCount( appender.getProperty( "dataStreamPattern" ) ) ).toBe( dataStreamCount + 1 );
} );

Expand Down

0 comments on commit 5589438

Please sign in to comment.