Skip to content

Commit

Permalink
Merge pull request #140 from coldbox-modules/ci/addBoxlangToMatrix
Browse files Browse the repository at this point in the history
add boxlang to matrix
  • Loading branch information
jclausen authored Jan 28, 2025
2 parents 25de710 + 7a3e829 commit 5c287be
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 53 deletions.
1 change: 1 addition & 0 deletions .cfconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ jobs:
javaVersion: "21"
ELASTICSEARCH_VERSION: "8.14.1"
experimental: true
- cfengine: "boxlang@1"
coldboxVersion: "be"
javaVersion: "21"
ELASTICSEARCH_VERSION: "8.14.1"
experimental: true
- cfengine: "boxlang@1"
coldboxVersion: "be"
javaVersion: "21"
ELASTICSEARCH_VERSION: "7.17.10"
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down
42 changes: 18 additions & 24 deletions models/io/HyperClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ component accessors="true" threadSafe singleton {
*/
struct function getMappings( required string indexName, string field ){
var path = arguments.indexName & "/_mapping";
if( !isNull( arguments.field ) ){
if ( !isNull( arguments.field ) ) {
path &= "/field/" & arguments.field;
} else if( findNoCase( "*", arguments.indexName ) ){
} else if ( findNoCase( "*", arguments.indexName ) ) {
// if a wild card is present we are only interested in the fields
arguments.field = "*";
path &= "/field/" & arguments.field;
Expand All @@ -290,18 +290,20 @@ component accessors="true" threadSafe singleton {
} else {
var mappings = response.json();
return isNull( arguments.field )
? mappings[ indexName ].mappings
: mappings.reduce( ( acc, indexKey, value ) => {
value.mappings.keyArray().each( ( mappingKey ) => {
if( !acc.keyExists( mappingKey ) ){
acc[ mappingKey ] = value.mappings[ mappingKey ];
acc[ mappingKey ]["indices"] = [ indexKey ];
? mappings[ indexName ].mappings
: mappings.reduce( ( acc, indexKey, value ) => {
value.mappings
.keyArray()
.each( ( mappingKey ) => {
if ( !acc.keyExists( mappingKey ) ) {
acc[ mappingKey ] = value.mappings[ mappingKey ];
acc[ mappingKey ][ "indices" ] = [ indexKey ];
} else {
acc[ mappingKey ]["indices"].append( indexKey );
acc[ mappingKey ][ "indices" ].append( indexKey );
}
} );
return acc;
}, {} );
return acc;
}, {} );
}
}

Expand Down Expand Up @@ -1236,7 +1238,7 @@ component accessors="true" threadSafe singleton {
required array documents,
boolean throwOnError = false,
struct params = {},
string mode = "update"
string mode = "update"
){
var requests = [];

Expand Down Expand Up @@ -1267,23 +1269,17 @@ component accessors="true" threadSafe singleton {

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

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

var docAction = { "doc" : memento };

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

requests.append(
[
opAction,
docAction
],
true
);
requests.append( [ opAction, docAction ], true );
} );

var saveResult = processBulkOperation(
Expand Down Expand Up @@ -1694,9 +1690,7 @@ component accessors="true" threadSafe singleton {
* @name
*/
boolean function dataStreamExists( required string name ){
var check = variables.nodePool
.newRequest( "_data_stream/#arguments.name#" )
.send();
var check = variables.nodePool.newRequest( "_data_stream/#arguments.name#" ).send();
return check.getStatusCode() == "200" && check.json().data_streams.len();
}

Expand Down
43 changes: 20 additions & 23 deletions models/logging/LogstashAppender.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -659,22 +659,22 @@ component
"number_of_replicas" : getProperty( "indexReplicas" ),
"index.lifecycle.name" : getProperty( "ILMPolicyName" ),
"index.default_pipeline" : getProperty( "pipelineName" ),
"analysis": {
"analyzer": {
"component_path_analyzer": {
"tokenizer": "standard",
"filter": [ "component_path_filter" ]
}
"analysis" : {
"analyzer" : {
"component_path_analyzer" : {
"tokenizer" : "standard",
"filter" : [ "component_path_filter" ]
}
},
"filter": {
"component_path_filter": {
"type": "word_delimiter",
"type_table": [ ". => SUBWORD_DELIM" ],
"split_on_case_change": false,
"split_on_numerics": false,
"stem_english_possessive": true,
"preserve_original": true
}
"filter" : {
"component_path_filter" : {
"type" : "word_delimiter",
"type_table" : [ ". => SUBWORD_DELIM" ],
"split_on_case_change" : false,
"split_on_numerics" : false,
"stem_english_possessive" : true,
"preserve_original" : true
}
}
}
},
Expand Down Expand Up @@ -719,17 +719,14 @@ component
},
"error" : {
"type" : "object",
"properties" : {
"extrainfo" : {
"type" : "text",
"analyzer": "component_path_analyzer"
}
"properties" : {
"extrainfo" : { "type" : "text", "analyzer" : "component_path_analyzer" }
}
},
"message" : {
"type" : "text",
"analyzer": "component_path_analyzer",
"fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 512 } }
"type" : "text",
"analyzer" : "component_path_analyzer",
"fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 512 } }
},
"event" : {
"type" : "object",
Expand Down
18 changes: 12 additions & 6 deletions models/util/Util.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component accessors="true" singleton {

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

/**
Expand Down Expand Up @@ -131,13 +131,19 @@ component accessors="true" singleton {
}

// We pre-test this because ACF2018 will not recognize an already formatted ISO8601 datetime with offset
if( isDate( arguments.logObj[ "@timestamp" ] ) ){
arguments.logObj[ "@timestamp" ] = dateTimeFormat( arguments.logObj[ "@timestamp" ], "yyyy-mm-dd'T'HH:nn:ssZZ" );
if ( isDate( arguments.logObj[ "@timestamp" ] ) ) {
arguments.logObj[ "@timestamp" ] = dateTimeFormat(
arguments.logObj[ "@timestamp" ],
"yyyy-mm-dd'T'HH:nn:ssZZ"
);
}

if( arguments.logObj.keyExists( "event" ) && arguments.logObj.event.keyExists( "created" ) ){
if( isDate( arguments.logObj.event.created ) ){
arguments.logObj.event.created = dateTimeFormat( arguments.logObj.event.created, "yyyy-mm-dd'T'HH:nn:ssZZ" );
if ( arguments.logObj.keyExists( "event" ) && arguments.logObj.event.keyExists( "created" ) ) {
if ( isDate( arguments.logObj.event.created ) ) {
arguments.logObj.event.created = dateTimeFormat(
arguments.logObj.event.created,
"yyyy-mm-dd'T'HH:nn:ssZZ"
);
}
}

Expand Down
36 changes: 36 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"app":{
"cfengine":"boxlang@be",
"serverHomeDirectory":".engine/boxlang"
},
"name":"cbelasticsearch-boxlang@1",
"force":true,
"openBrowser":false,
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbelasticsearch":"./"
}
},
"JVM":{
"heapSize":"1024",
"javaVersion":"openjdk21_jdk",
"args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999"
},
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"BOXLANG_DEBUG":true
},
"scripts":{
"onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave"
}
}

0 comments on commit 5c287be

Please sign in to comment.