Skip to content

Commit 7911f8b

Browse files
Merge branch 'main' into lint-cleanup
2 parents 7eafd66 + 10e1a5d commit 7911f8b

61 files changed

Lines changed: 5454 additions & 3694 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 404 additions & 0 deletions
Large diffs are not rendered by default.

.github/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
4+
# To get started with Dependabot version updates, you'll need to specify which
5+
# package ecosystems to update and where the package manifests are located.
6+
# Please see the documentation for all configuration options:
7+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
8+
9+
version: 2
10+
updates:
11+
# Enable version updates for Go modules
12+
- package-ecosystem: "gomod"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
day: "monday"
17+
open-pull-requests-limit: 10
18+
labels:
19+
- "dependencies"
20+
- "go"
21+
commit-message:
22+
prefix: "deps"
23+
include: "scope"
24+
groups:
25+
go-dependencies:
26+
patterns:
27+
- "*"
28+
29+
# Enable version updates for GitHub Actions
30+
- package-ecosystem: "github-actions"
31+
directory: "/"
32+
schedule:
33+
interval: "weekly"
34+
day: "monday"
35+
open-pull-requests-limit: 5
36+
labels:
37+
- "dependencies"
38+
- "github-actions"
39+
commit-message:
40+
prefix: "ci"
41+
groups:
42+
github-actions:
43+
patterns:
44+
- "*"

.github/workflows/golangci-lint.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@ on:
44
branches:
55
- main
66
pull_request:
7+
8+
permissions:
9+
contents: read
10+
711
jobs:
812
golangci-pr:
913
name: lint-pr-changes
1014
runs-on: ubuntu-latest
1115
steps:
12-
- uses: actions/setup-go@v5
16+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1317
with:
14-
go-version: stable
15-
- uses: actions/checkout@v4
18+
go-version: '1.25.9'
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1620
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v6
21+
# Pinned to commit SHA for supply chain security (CWE-829)
22+
# Verify: gh api repos/golangci/golangci-lint-action/git/ref/tags/v9 --jq '.object.sha'
23+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.0.0
1824
with:
1925
version: latest
2026
only-new-issues: true

.github/workflows/pr-title.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR Title Check
2+
on:
3+
pull_request_target:
4+
types: [opened, edited, synchronize]
5+
6+
permissions:
7+
pull-requests: read
8+
9+
jobs:
10+
validate:
11+
name: Validate PR title
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
types: |
19+
feat
20+
fix
21+
docs
22+
chore
23+
deps
24+
ci
25+
test
26+
refactor
27+
perf
28+
build
29+
requireScope: false
30+
subjectPattern: ^[a-z].+$
31+
subjectPatternError: "Subject must start with a lowercase letter"

.github/workflows/pr-validation.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1316
- name: Setup go
14-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1518
with:
16-
go-version: '1.22'
19+
go-version: '1.25.9'
1720
- name: Run tests against Linux SQL
1821
run: |
1922
go version
@@ -23,5 +26,20 @@ jobs:
2326
export SQLCMDPASSWORD=$(date +%s|sha256sum|base64|head -c 32)
2427
export SQLCMDUSER=sa
2528
docker run -m 2GB -e ACCEPT_EULA=1 -d --name sql2022 -p:1433:1433 -e SA_PASSWORD=$SQLCMDPASSWORD mcr.microsoft.com/mssql/server:2022-latest
29+
echo "Waiting for SQL Server to be ready..."
30+
READY=0
31+
for i in {1..60}; do
32+
if docker exec sql2022 /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SQLCMDPASSWORD" -C -Q "SELECT 1" &>/dev/null; then
33+
echo "SQL Server is ready!"
34+
READY=1
35+
break
36+
fi
37+
echo "Attempt $i: SQL Server not ready yet, waiting..."
38+
sleep 2
39+
done
40+
if [ $READY -eq 0 ]; then
41+
echo "ERROR: SQL Server failed to become ready within 2 minutes"
42+
exit 1
43+
fi
2644
cd ../..
2745
go test -v ./...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: {}
9+
10+
env:
11+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
steps:
20+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
21+
with:
22+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

.github/workflows/security.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
4+
name: Security Scanning
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
schedule:
14+
# Run weekly on Monday at 9:00 AM UTC
15+
- cron: '0 9 * * 1'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
govulncheck:
23+
name: Go Vulnerability Check
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
31+
with:
32+
go-version-file: go.mod
33+
34+
- name: Install govulncheck
35+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
36+
37+
- name: Run govulncheck
38+
run: govulncheck ./...

.pipelines/LocBuild.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ steps:
1919
packageSourceAuth: patAuth
2020
dependencyPackageSource: 'https://pkgs.dev.azure.com/msdata/_packaging/SQLDS_SSMS/nuget/v3/index.json'
2121
patVariable: $(System.AccessToken)
22-
22+
isAutoCompletePrSelected: false
23+
isShouldReusePrSelected: true
2324
- task: PublishPipelineArtifact@1
2425
inputs:
2526
targetPath: '$(Build.ArtifactStagingDirectory)'
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- task: GoTool@0
33
inputs:
4-
version: '1.22.10'
4+
version: '1.25.7'
55
- task: Go@0
66
displayName: 'Go: get dependencies'
77
inputs:
@@ -18,18 +18,10 @@ steps:
1818
workingDirectory: '$(System.DefaultWorkingDirectory)'
1919

2020
- task: Go@0
21-
displayName: 'Go: install github.com/axw/gocov/gocov'
21+
displayName: 'Go: install github.com/boumenot/gocover-cobertura'
2222
inputs:
2323
command: 'custom'
2424
customCommand: 'install'
25-
arguments: 'github.com/axw/gocov/gocov@latest'
26-
workingDirectory: '$(System.DefaultWorkingDirectory)'
27-
28-
- task: Go@0
29-
displayName: 'Go: install github.com/axw/gocov/gocov'
30-
inputs:
31-
command: 'custom'
32-
customCommand: 'install'
33-
arguments: 'github.com/AlekSi/gocov-xml@latest'
25+
arguments: 'github.com/boumenot/gocover-cobertura@latest'
3426
workingDirectory: '$(System.DefaultWorkingDirectory)'
3527

.pipelines/include-runtests-linux.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ parameters:
1616
steps:
1717
- script: |
1818
~/go/bin/gotestsum --junitfile "${{ parameters.RunName }}.testresults.xml" -- ./... -coverprofile="${{ parameters.RunName }}.coverage.txt" -covermode count
19-
~/go/bin/gocov convert "${{ parameters.RunName }}.coverage.txt" > "${{ parameters.RunName }}.coverage.json"
20-
~/go/bin/gocov-xml < "${{ parameters.RunName }}.coverage.json" > ${{ parameters.RunName }}.coverage.xml
19+
~/go/bin/gocover-cobertura < "${{ parameters.RunName }}.coverage.txt" > ${{ parameters.RunName }}.coverage.xml
2120
mkdir -p coverage
2221
workingDirectory: '$(Build.SourcesDirectory)'
2322
displayName: 'run tests'

0 commit comments

Comments
 (0)