Skip to content

Commit 3b4e5c4

Browse files
vkmcdependabot[bot]claude
authored
STF 1.5.7 release ops (#162)
* Pin Ceilometer to stable/2024.2 (#154) Even though we are pinning to the stable/2024.2 when cloning Devstack, we are pulling Ceilometer requirements from the master branch and this is generating dependencies conflict. Explicitily set stable/2024.2 branch when cloning Ceilometer to fix this. Closes-Bug: OSPRH-19908 * Bump gopkg.in/yaml.v3 from 3.0.0 to 3.0.1 (#153) --- updated-dependencies: - dependency-name: gopkg.in/yaml.v3 dependency-version: 3.0.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Victoria Martinez de la Cruz <victoria@redhat.com> * Protect the expiryProc list with a mutex (#155) The container/list data structure used in expiry.go is not safe for concurrent use. See golang/go#25105 Serialize the access to the shared list to avoid having check() on empty lists. Closes-Bug: OSPRH-18979 * Fix long message handling with dynamic buffer growth (#158) The socket transport plugin used a fixed 64KB buffer size which caused messages surpassing that size to be truncated For UDP/Unix datagram sockets, this resulted in parsing errors like "unexpected end of input" This change allows the buffer to grow (up to a limit depending on the protocol) to accommodate larger messages. * Create helper functions for TCP connection handling * Add helper sendUDPSocketMessage * Update TestUnixSocketTransport large message test This test verifies the dynamic buffer growth by sending three messages In each iteration the buffer grows from the initial size of 65535 bytes to 3 times the initial size. Also verifies the content of the received message Closes: OSPRH-23826 * Update to golang 1.24.11 (#159) * Fix non-constant format string in call Go 1.24.11 has stricter checking for format strings in printf-style functions to prevent format string vulnerabilities. * Bump golangci-lint version to 1.64.2 * Replace exportloopref for copyloopvar The linter 'exportloopref' is deprecated (since v1.60.2) * Update coveralls-badge workflow to be non-blocking (#160) Added "continue-on-error: true" to prevent badge failures from blocking PRs. Explicitly defined pull-requests: write permissions for GITHUB_TOKEN. Added try-catch safety logic and async/await to the script. * Improve test coverage for expiry.go (#164) Add tests for check() edge cases, run() function, and concurrent access. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Improve test coverage for prometheus application plugin (#166) Add tests for New, Config, PromCollector methods, metricExpiry, collectorExpiry, ReceiveMetric, UpdateMetrics, Describe, and Collect. Omit logging and HTTP server tests. * Fix golangci-lint empty-block error in prometheus tests Replace empty for-range loop with explicit assignment to satisfy revive linter. * Add timestamp verification assertions to prometheus collector tests Enhance test coverage by adding assertions that verify the presence or absence of timestamps in collected metrics. The "collect with timestamp" test now verifies that metrics include the expected timestamp value, while the "collect with zero timestamp" test confirms that metrics with zero timestamps are sent without timestamp metadata. Also fixes default port assertion and cleans up empty-block lint issue. * Fix golangci-lint empty-block error in channel drain loop Replace empty for-range loop with explicit variable usage to resolve the revive empty-block linting error. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Improve test coverage for socket transport plugin (#165) Add tests for Config, New, Listen, init errors, dump messages, and TCP parsing edge cases. * Fix golangci-lint errors in socket transport tests - Check error returns from binary.Write calls - Reduce file permissions from 0644 to 0600 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add comprehensive test coverage for parser libraries (#168) Ceilometer: - ParseInputJSON with various message formats - ParseInputMsgPack for msgpack parsing - sanitize function with escaped quotes and payload formatting - Error handling for invalid JSON and malformed data - Edge cases: empty payloads, multiple metrics, user metadata Collectd: - ParseInputByte for all metric variations - Multi-dimensional metrics with multiple values - Optional fields (plugin_instance, type_instance) - Error handling for invalid JSON and non-array data - Edge cases: empty arrays, zero values, negative values, large values - Real-world virt plugin data formats * Add comprehensive test coverage for sensu parser library Create test file for sensubility-metrics sensu parser library with complete coverage of all validation and error building functions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add test coverage for manager package (#167) Create manager_test.go test cases covering setter functions, plugin initialization error paths, and edge cases. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 12cd068 commit 3b4e5c4

21 files changed

Lines changed: 3478 additions & 165 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/setup-go@v5
2424
with:
25-
go-version: '1.21.13'
25+
go-version: '1.24.11'
2626
- uses: actions/checkout@v4.1.3
2727
#- name: download libraries
2828
# run: go mod download
@@ -32,7 +32,7 @@ jobs:
3232
# Caching conflicts happen in GHA, so just disable for now
3333
skip-cache: true
3434
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
35-
version: v1.59.1
35+
version: v1.64.2
3636
unit-tests:
3737
name: Unit tests
3838
runs-on: ubuntu-latest
@@ -77,7 +77,7 @@ jobs:
7777
- uses: actions/checkout@v4.1.3
7878
- uses: actions/setup-go@v5
7979
with:
80-
go-version: '1.21.13'
80+
go-version: '1.24.11'
8181
- name: Verify image builds
8282
run: |
8383
docker build --tag infrawatch/sg-core:latest --file build/Dockerfile .

.github/workflows/updates.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,31 @@ jobs:
1717
# (github.event.issue.author_association == 'MEMBER')
1818
# )
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: write
22+
issues: write
2023
steps:
2124
- name: update PR with coveralls badge
2225
uses: actions/github-script@v7.0.1
26+
continue-on-error: true
2327
with:
2428
github-token: ${{ secrets.GITHUB_TOKEN }}
2529
script: |
26-
var BRANCH_NAME = process.env.BRANCH_NAME;
27-
github.rest.issues.createComment({
28-
issue_number: context.issue.number,
29-
owner: context.repo.owner,
30-
repo: context.repo.repo,
31-
body: `[![Coverage Status](https://coveralls.io/repos/github/${context.repo.owner}/${context.repo.repo}/badge.svg?branch=${BRANCH_NAME})](https://coveralls.io/github/${context.repo.owner}/${context.repo.repo}?branch=${BRANCH_NAME})`
32-
})
30+
const branchName = process.env.BRANCH_NAME;
31+
if (!branchName) {
32+
console.log("No branch name found, skipping badge update.");
33+
return;
34+
}
35+
36+
try {
37+
await github.rest.issues.createComment({
38+
issue_number: context.issue.number,
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
body: `[![Coverage Status](https://coveralls.io/repos/github/${context.repo.owner}/${context.repo.repo}/badge.svg?branch=${branchName})](https://coveralls.io/github/${context.repo.owner}/${context.repo.repo}?branch=${branchName})`
42+
});
43+
} catch (error) {
44+
console.log("Could not post comment: ", error.message);
45+
}
3346
env:
3447
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}

.golangci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ linters:
3737
- dupl
3838
- errcheck
3939
# - exhaustive
40-
- exportloopref
40+
- copyloopvar
4141
# - gochecknoinits
4242
- goconst
4343
- gocritic
@@ -61,5 +61,5 @@ linters:
6161
- unconvert
6262
# NOTE: not all application plugins use ability to emit internal events through
6363
# passed bus function in it's constructor.
64-
#- unparam
64+
# - unparam
6565
# - whitespace

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPY . $D/
1010
COPY build/repos/opstools.repo /etc/yum.repos.d/CentOS-OpsTools.repo
1111

1212
RUN dnf install golang git qpid-proton-c-devel -y --setopt=tsflags=nodocs
13-
RUN go install golang.org/dl/go1.21.13@latest && /go/bin/go1.21.13 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.21.13 ./build.sh
13+
RUN go install golang.org/dl/go1.24.11@latest && /go/bin/go1.24.11 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.24.11 ./build.sh
1414

1515
# --- end build, create smart gateway layer ---
1616
FROM registry.access.redhat.com/ubi9-minimal:latest

ci/integration/logging/run_sg.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
1212
export GOBIN=$GOPATH/bin
1313
export PATH=$PATH:$GOBIN
1414

15-
go install golang.org/dl/go1.21.13@latest
16-
go1.21.13 download
15+
go install golang.org/dl/go1.24.11@latest
16+
go1.24.11 download
1717

1818
# install sg-core and start sg-core
1919
mkdir -p /usr/lib64/sg-core
20-
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21.13 BUILD_ARGS=-buildvcs=false ./build.sh
20+
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
2121

2222
./sg-core -config ./ci/integration/logging/sg_config.yaml

ci/integration/metrics/ceilometer/bridge/run_sg.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
1212
export GOBIN=$GOPATH/bin
1313
export PATH=$PATH:$GOBIN
1414

15-
go install golang.org/dl/go1.21.13@latest
16-
go1.21.13 download
15+
go install golang.org/dl/go1.24.11@latest
16+
go1.24.11 download
1717

1818
# install sg-core and start sg-core
1919
mkdir -p /usr/lib64/sg-core
20-
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21.13 BUILD_ARGS=-buildvcs=false ./build.sh
20+
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
2121

2222
./sg-core -config ./ci/integration/metrics/ceilometer/bridge/sg_config.yaml

ci/integration/metrics/ceilometer/tcp/run_sg.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
1313
export GOBIN=$GOPATH/bin
1414
export PATH=$PATH:$GOBIN
1515

16-
go install golang.org/dl/go1.21.13@latest
17-
go1.21.13 download
16+
go install golang.org/dl/go1.24.11@latest
17+
go1.24.11 download
1818

1919
# install sg-core and start sg-core
2020
mkdir -p /usr/lib64/sg-core
21-
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21.13 BUILD_ARGS=-buildvcs=false ./build.sh
21+
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
2222

2323
./sg-core -config ./ci/integration/metrics/ceilometer/tcp/sg_config.yaml

ci/integration/metrics/collectd/run_sg.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
1212
export GOBIN=$GOPATH/bin
1313
export PATH=$PATH:$GOBIN
1414

15-
go install golang.org/dl/go1.21.13@latest
16-
go1.21.13 download
15+
go install golang.org/dl/go1.24.11@latest
16+
go1.24.11 download
1717

1818
# install sg-core and start sg-core
1919
mkdir -p /usr/lib64/sg-core
20-
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21.13 BUILD_ARGS=-buildvcs=false ./build.sh
20+
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
2121

2222
./sg-core -config ./ci/integration/metrics/collectd/sg_config.yaml

ci/integration/metrics/local.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RABBIT_PASSWORD=$ADMIN_PASSWORD
66
SERVICE_PASSWORD=$ADMIN_PASSWORD
77
REDIS_PASSWORD=$ADMIN_PASSWORD
88

9-
enable_plugin ceilometer https://opendev.org/openstack/ceilometer.git
9+
enable_plugin ceilometer https://opendev.org/openstack/ceilometer.git stable/2024.2
1010
CEILOMETER_BACKEND=none
1111
CEILOMETER_PIPELINE_INTERVAL=60
1212
enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification

ci/unit/run_tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ yum install -y git golang gcc make glibc-langpack-en qpid-proton-c-devel
1313
export GOBIN=$GOPATH/bin
1414
export PATH=$PATH:$GOBIN
1515

16-
go install golang.org/dl/go1.21.13@latest
17-
go1.21.13 download
16+
go install golang.org/dl/go1.24.11@latest
17+
go1.24.11 download
1818

1919

20-
go1.21.13 test -v -coverprofile=profile.cov ./...
20+
go1.24.11 test -v -coverprofile=profile.cov ./...

0 commit comments

Comments
 (0)