Skip to content

Commit d60444d

Browse files
authored
Avoid double-logging queries (#110)
* This logging is handled in MySQLKit and should not be present at the MySQLNIO layer. * Fix CI
1 parent 605fe1d commit d60444d

File tree

4 files changed

+32
-66
lines changed

4 files changed

+32
-66
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
version: 2
2-
enable-beta-ecosystems: true
32
updates:
43
- package-ecosystem: "github-actions"
54
directory: "/"
@@ -9,13 +8,3 @@ updates:
98
dependencies:
109
patterns:
1110
- "*"
12-
- package-ecosystem: "swift"
13-
directory: "/"
14-
schedule:
15-
interval: "daily"
16-
allow:
17-
- dependency-type: all
18-
groups:
19-
all-dependencies:
20-
patterns:
21-
- "*"

.github/workflows/test.yml

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ env:
2222
MYSQL_HOSTNAME_B: 'mysql-b'
2323

2424
jobs:
25-
dependency-graph:
26-
if: ${{ github.event_name == 'push' }}
27-
runs-on: ubuntu-latest
28-
container: swift:jammy
29-
permissions:
30-
contents: write
31-
steps:
32-
- name: Check out code
33-
uses: actions/checkout@v4
34-
- name: Fix Git configuration
35-
run: |
36-
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
37-
apt-get update && apt-get install -y curl
38-
- name: Submit dependency graph
39-
uses: vapor-community/[email protected]
40-
with:
41-
path: ${{ github.workspace }}
42-
4325
api-breakage:
4426
if: ${{ !(github.event.pull_request.draft || false) }}
4527
runs-on: ubuntu-latest
@@ -53,33 +35,26 @@ jobs:
5335
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
5436
swift package diagnose-api-breaking-changes origin/main
5537
56-
gh-codeql:
57-
if: ${{ !(github.event.pull_request.draft || false) }}
58-
runs-on: ubuntu-latest
59-
container:
60-
image: swift:5.9-jammy
61-
permissions: { actions: write, contents: read, security-events: write }
62-
timeout-minutes: 60
63-
steps:
64-
- name: Check out code
65-
uses: actions/checkout@v4
66-
- name: Mark repo safe in non-fake global config
67-
run: |
68-
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
69-
- name: Check Swift compatibility
70-
id: swift-check
71-
uses: vapor/ci/.github/actions/check-compatible-swift@main
72-
- name: Initialize CodeQL
73-
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
74-
uses: github/codeql-action/init@v3
75-
with: { languages: swift }
76-
- name: Perform build
77-
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
78-
run: |
79-
swift build
80-
- name: Run CodeQL analyze
81-
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
82-
uses: github/codeql-action/analyze@v3
38+
# gh-codeql:
39+
# if: ${{ !(github.event.pull_request.draft || false) }}
40+
# runs-on: ubuntu-latest
41+
# permissions: { actions: write, contents: read, security-events: write }
42+
# timeout-minutes: 30
43+
# steps:
44+
# - name: Install latest Swift toolchain
45+
# uses: vapor/[email protected]
46+
# with: { toolchain: latest }
47+
# - name: Check out code
48+
# uses: actions/checkout@v4
49+
# - name: Fix Git configuration
50+
# run: 'git config --global --add safe.directory "${GITHUB_WORKSPACE}"'
51+
# - name: Initialize CodeQL
52+
# uses: github/codeql-action/init@v3
53+
# with: { languages: swift }
54+
# - name: Perform build
55+
# run: 'swift build ${PACKAGE_ROOT} ${EXTRA_FLAGS}'
56+
# - name: Run CodeQL analyze
57+
# uses: github/codeql-action/analyze@v3
8358

8459
linux-all:
8560
if: ${{ !(github.event.pull_request.draft || false) }}
@@ -94,10 +69,10 @@ jobs:
9469
- percona:5.7
9570
- percona:8
9671
swiftver:
97-
- swift:5.7-jammy
9872
- swift:5.8-jammy
9973
- swift:5.9-jammy
100-
- swiftlang/swift:nightly-5.10-jammy
74+
- swift:5.10-jammy
75+
- swiftlang/swift:nightly-6.0-jammy
10176
- swiftlang/swift:nightly-main-jammy
10277
runs-on: ubuntu-latest
10378
container: ${{ matrix.swiftver }}
@@ -115,8 +90,9 @@ jobs:
11590
- name: Run unit tests
11691
run: swift test --package-path mysql-nio --enable-code-coverage --sanitize=thread
11792
- name: Upload code coverage
118-
uses: vapor/swift-codecov-action@v0.2
93+
uses: vapor/swift-codecov-action@v0.3
11994
with:
95+
codecov_token: ${{ secrets.CODECOV_TOKEN }}
12096
package_path: 'mysql-nio'
12197
- name: Check out mysql-kit dependent
12298
uses: actions/checkout@v4
@@ -139,18 +115,19 @@ jobs:
139115
fail-fast: false
140116
matrix:
141117
dbimage: [mysql, mariadb, percona-server]
142-
xcode: ['~14.3', 'latest']
143-
macos: ['macos-13']
118+
macos-version: ['macos-13', 'macos-14']
144119
include:
145120
- { username: root }
146121
- { dbimage: mariadb, username: runner }
147-
runs-on: ${{ matrix.macos }}
122+
- { macos-version: 'macos-13', xcode-version: '~15.2' }
123+
- { macos-version: 'macos-14', xcode-version: 'latest' }
124+
runs-on: ${{ matrix.macos-version }}
148125
env: { MYSQL_HOSTNAME: '127.0.0.1' }
149126
steps:
150127
- name: Select latest available Xcode
151128
uses: maxim-lobanov/setup-xcode@v1
152129
with:
153-
xcode-version: ${{ matrix.xcode }}
130+
xcode-version: ${{ matrix.xcode-version }}
154131
- name: Install MySQL, setup DB and auth, and wait for server start
155132
env:
156133
FORMULA: ${{ matrix.dbimage }}
@@ -171,4 +148,6 @@ jobs:
171148
- name: Run all tests
172149
run: swift test --sanitize=thread --enable-code-coverage
173150
- name: Upload code coverage
174-
uses: vapor/[email protected]
151+
uses: vapor/[email protected]
152+
with:
153+
codecov_token: ${{ secrets.CODECOV_TOKEN }}

Sources/MySQLNIO/MySQLQueryCommand.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extension MySQLDatabase {
2727
onRow: @escaping (MySQLRow) throws -> (),
2828
onMetadata: @escaping (MySQLQueryMetadata) throws -> () = { _ in }
2929
) -> EventLoopFuture<Void> {
30-
self.logger.debug("\(sql) \(binds)")
3130
let query = MySQLQueryCommand(
3231
sql: sql,
3332
binds: binds,

Sources/MySQLNIO/MySQLSimpleQueryCommand.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extension MySQLDatabase {
99
}
1010

1111
public func simpleQuery(_ sql: String, onRow: @escaping (MySQLRow) -> ()) -> EventLoopFuture<Void> {
12-
self.logger.debug("\(sql)")
1312
let query = MySQLSimpleQueryCommand(sql: sql, onRow: onRow)
1413
return self.send(query, logger: self.logger)
1514
}

0 commit comments

Comments
 (0)