Skip to content

Commit c97dabc

Browse files
committed
Merge branch 'development'
2 parents f265c4f + ff7972d commit c97dabc

File tree

11 files changed

+253
-96
lines changed

11 files changed

+253
-96
lines changed

.cfconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"class":"${DB_CLASS}",
1212
"dbdriver": "MySQL",
1313
"dsn":"jdbc:mysql://{host}:{port}/{database}",
14-
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false",
14+
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true",
1515
"host":"${DB_HOST:127.0.0.1}",
1616
"username": "${DB_USER:root}",
1717
"password": "${DB_PASSWORD}",

.github/workflows/gh-release.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@ on:
66
- "main"
77
- "master"
88
- "development"
9+
- "releases/v*"
910
pull_request:
1011
branches:
12+
- "releases/v*"
1113
- development
1214

1315
jobs:
1416
tests:
1517
uses: ./.github/workflows/tests.yml
18+
secrets: inherit
1619

17-
# Format PR
18-
format:
19-
name: Format
20+
formatCheck:
21+
name: Checks Source Code Formatting
2022
runs-on: ubuntu-20.04
2123
steps:
2224
- name: Checkout Repository
23-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2426

2527
- uses: Ortus-Solutions/[email protected]
2628
with:
27-
cmd: run-script format
28-
29-
- name: Commit Format Changes
30-
uses: stefanzweifel/git-auto-commit-action@v4
31-
with:
32-
commit_message: Apply cfformat changes
29+
cmd: run-script format:check

.github/workflows/release.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Build a Release
2+
3+
on:
4+
# If you push to master|main this will trigger a stable release
5+
push:
6+
branches:
7+
- master
8+
- main
9+
10+
# Reusable workflow : Usually called by a `snapshot` workflow
11+
workflow_call:
12+
inputs:
13+
snapshot:
14+
description: 'Is this a snapshot build?'
15+
required: false
16+
default: false
17+
type: boolean
18+
19+
env:
20+
MODULE_ID: cbdebugger
21+
SNAPSHOT: ${{ inputs.snapshot || false }}
22+
23+
jobs:
24+
##########################################################################################
25+
# Build & Publish
26+
##########################################################################################
27+
build:
28+
name: Build & Publish
29+
runs-on: ubuntu-20.04
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@v3
33+
34+
- name: Setup nodejs
35+
uses: actions/setup-node@v2
36+
with:
37+
node-version: 16.x
38+
39+
- name: Setup CommandBox
40+
uses: Ortus-Solutions/[email protected]
41+
with:
42+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
43+
44+
- name: "Setup Environment Variables For Build Process"
45+
id: current_version
46+
run: |
47+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
48+
49+
# master or snapshot
50+
echo "Github Ref is $GITHUB_REF"
51+
echo "BRANCH=master" >> $GITHUB_ENV
52+
if [ $GITHUB_REF == 'refs/heads/development' ]
53+
then
54+
echo "BRANCH=development" >> $GITHUB_ENV
55+
fi
56+
57+
- name: Update changelog [unreleased] with latest version
58+
uses: thomaseizinger/[email protected]
59+
if: env.SNAPSHOT == 'false'
60+
with:
61+
changelogPath: ./changelog.md
62+
tag: v${{ env.VERSION }}
63+
64+
- name: Build ${{ env.MODULE_ID }}
65+
run: |
66+
npm i npm@latest -g
67+
npm install
68+
npm run prod
69+
rm -Rf node_modules
70+
box install commandbox-docbox
71+
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
72+
73+
- name: Commit Changelog To Master
74+
uses: EndBug/[email protected]
75+
if: env.SNAPSHOT == 'false'
76+
with:
77+
author_name: Github Actions
78+
author_email: [email protected]
79+
message: 'Finalized changelog for v${{ env.VERSION }}'
80+
add: changelog.md
81+
82+
- name: Tag Version
83+
uses: rickstaa/[email protected]
84+
if: env.SNAPSHOT == 'false'
85+
with:
86+
tag: "v${{ env.VERSION }}"
87+
force_push_tag: true
88+
message: "Latest Release v${{ env.VERSION }}"
89+
90+
- name: Upload Build Artifacts
91+
if: success()
92+
uses: actions/upload-artifact@v3
93+
with:
94+
name: ${{ env.MODULE_ID }}
95+
path: |
96+
.artifacts/**/*
97+
changelog.md
98+
99+
- name: Publish To ForgeBox
100+
run: |
101+
cd .tmp/${{ env.MODULE_ID }} && box forgebox publish --force
102+
103+
- name: Create Github Release
104+
uses: taiki-e/[email protected]
105+
continue-on-error: true
106+
if: env.SNAPSHOT == 'false'
107+
with:
108+
title: ${{ env.VERSION }}
109+
changelog: changelog.md
110+
token: ${{ secrets.GITHUB_TOKEN }}
111+
ref: refs/tags/v${{ env.VERSION }}
112+
113+
##########################################################################################
114+
# Prep Next Release
115+
##########################################################################################
116+
prep_next_release:
117+
name: Prep Next Release
118+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
119+
runs-on: ubuntu-20.04
120+
needs: [ build ]
121+
steps:
122+
# Checkout development
123+
- name: Checkout Repository
124+
uses: actions/checkout@v3
125+
with:
126+
ref: development
127+
128+
- name: Setup CommandBox
129+
uses: Ortus-Solutions/[email protected]
130+
with:
131+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
132+
133+
- name: Download build artifacts
134+
uses: actions/download-artifact@v2
135+
with:
136+
name: ${{ env.MODULE_ID }}
137+
path: .tmp
138+
139+
# Copy the changelog to the development branch
140+
- name: Copy Changelog
141+
run: |
142+
cp .tmp/changelog.md changelog.md
143+
144+
# Bump to next version
145+
- name: Bump Version
146+
run: |
147+
box bump --minor --!TagVersion
148+
149+
# Commit it back to development
150+
- name: Commit Version Bump
151+
uses: EndBug/[email protected]
152+
with:
153+
author_name: Github Actions
154+
author_email: [email protected]
155+
message: 'Version bump'
156+
add: |
157+
box.json
158+
changelog.md

.github/workflows/snapshot.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- 'development'
7+
8+
jobs:
9+
##########################################################################################
10+
# Module Tests
11+
##########################################################################################
12+
tests:
13+
secrets: inherit
14+
uses: ./.github/workflows/tests.yml
15+
16+
##########################################################################################
17+
# Format Source Code
18+
##########################################################################################
19+
format:
20+
name: Code Auto-Formatting
21+
runs-on: ubuntu-20.04
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Auto-format
26+
uses: Ortus-Solutions/[email protected]
27+
with:
28+
cmd: run-script format
29+
30+
- name: Commit Format Changes
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: Apply cfformat changes
34+
35+
##########################################################################################
36+
# Release it
37+
##########################################################################################
38+
release:
39+
uses: ./.github/workflows/release.yml
40+
needs: [ tests, format ]
41+
secrets: inherit
42+
with:
43+
snapshot: true

.github/workflows/tests.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,32 @@ jobs:
1414
env:
1515
DB_USER: root
1616
DB_PASSWORD: root
17+
continue-on-error: ${{ matrix.experimental }}
1718
strategy:
1819
fail-fast: false
1920
matrix:
2021
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
22+
coldboxVersion: [ "^6.0.0" ]
23+
experimental: [ false ]
24+
include:
25+
- coldboxVersion: "be"
26+
cfengine: "lucee@5"
27+
experimental: true
28+
- coldboxVersion: "be"
29+
cfengine: "adobe@2018"
30+
experimental: true
31+
- coldboxVersion: "be"
32+
cfengine: "adobe@2021"
33+
experimental: true
2134
steps:
2235
- name: Checkout Repository
23-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
37+
2438

2539
- name: Setup Java
26-
uses: actions/setup-java@v2
40+
uses: actions/setup-java@v3
2741
with:
28-
distribution: "adopt"
42+
distribution: "temurin"
2943
java-version: "11"
3044

3145
- name: Setup Database and Fixtures
@@ -55,7 +69,9 @@ jobs:
5569
- name: Install Dependencies
5670
run: |
5771
box install
58-
cd test-harness && box install
72+
cd test-harness
73+
box package set dependencies.coldbox=${{ matrix.coldboxVersion }}
74+
box install
5975
6076
- name: Start ${{ matrix.cfengine }} Server
6177
run: |
@@ -66,33 +82,32 @@ jobs:
6682
run: |
6783
mkdir -p test-harness/tests/results
6884
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
69-
ls -lR test-harness/tests
7085
7186
- name: Publish Test Results
72-
uses: EnricoMi/publish-unit-test-result-action@v1
87+
uses: EnricoMi/publish-unit-test-result-action@v2
7388
if: always()
7489
with:
75-
files: test-harness/tests/results/**/*.xml
76-
check_name: "${{ matrix.cfengine }} Test Results"
90+
junit_files: test-harness/tests/results/**/*.xml
91+
check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results"
7792

7893
- name: Upload Test Results to Artifacts
7994
if: always()
80-
uses: actions/upload-artifact@v2
95+
uses: actions/upload-artifact@v3
8196
with:
82-
name: test-results-${{ matrix.cfengine }}
97+
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}
8398
path: |
8499
test-harness/tests/results/**/*
85100
86-
- name: Failure Debugging Log
101+
- name: Show Server Log On Failures
87102
if: ${{ failure() }}
88103
run: |
89104
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
90105
91-
- name: Upload Debugging Log To Artifacts
106+
- name: Upload Debug Logs To Artifacts
92107
if: ${{ failure() }}
93-
uses: actions/upload-artifact@v2
108+
uses: actions/upload-artifact@v3
94109
with:
95-
name: Failure Debugging Info - ${{ matrix.cfengine }}
110+
name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.coldboxVersion }}
96111
path: |
97112
.engine/**/logs/*
98113
.engine/**/WEB-INF/cfusion/logs/*
@@ -106,6 +121,6 @@ jobs:
106121
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
107122
SLACK_ICON_EMOJI: ":bell:"
108123
SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:'
109-
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed
124+
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} with ColdBox ${{ matrix.coldboxVersion }} failed
110125
SLACK_USERNAME: CI
111126
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

ModuleConfig.cfc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ component {
164164
*/
165165
function onLoad(){
166166
// Only activate interceptions and collectors if master switch is on or in test mode disable it
167-
if ( variables.settings.enabled ) {
167+
// And you must not be in testing mode
168+
if ( !structKeyExists( controller, "mockController" ) && variables.settings.enabled ) {
168169
var interceptorService = controller.getInterceptorService();
169170

170171
/******************** REQUEST COLLECTOR ************************************/
@@ -282,7 +283,7 @@ component {
282283
*/
283284
function onUnload(){
284285
// Only if we are enabled
285-
if ( variables.settings.enabled ) {
286+
if ( !structKeyExists( controller, "mockController" ) && variables.settings.enabled ) {
286287
var interceptorService = controller.getInterceptorService();
287288

288289
interceptorService.announce( "onDebuggerUnload" );

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"4.0.1",
5+
"version":"4.1.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",

0 commit comments

Comments
 (0)