Skip to content

Commit 42136bb

Browse files
authored
security(daemon): upgrade golang to 1.22 (#890)
1. Upgrade minimum toolchain required to build daemon to go1.22.3. 2. Remove `go.work` and `go.work.sum`, which as of go1.22 are no longer compatible with newrelic-php-agent's use of `vendor`. 3. Cleanup daemon's Makefile 4. Simplify CodeQL workflow
1 parent 3d09829 commit 42136bb

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,20 @@ jobs:
4141
uses: github/codeql-action/init@v3
4242
with:
4343
languages: ${{ matrix.language }}
44+
build-mode: manual
4445
# If you wish to specify custom queries, you can do so here or in a config file.
4546
# By default, queries listed here will override any specified in a config file.
4647
# Prefix the list here with "+" to use these queries and those in the config file.
4748

4849
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
4950
# queries: security-extended,security-and-quality
5051

51-
52-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
53-
# If this step fails, then you should remove it and run the build manually (see below)
54-
- name: Autobuild
55-
uses: github/codeql-action/autobuild@v3
56-
5752
# ℹ️ Command-line programs to run using the OS shell.
5853
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
5954

60-
# If the Autobuild fails above, remove it and uncomment the following three lines.
61-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
62-
63-
# - run: |
64-
# echo "Run, Build Application using script"
65-
# ./location_of_script_within_repo/buildscript.sh
55+
- name: Build
56+
run: |
57+
make ${{ matrix.language == 'go' && 'daemon' || 'agent' }}
6658
6759
- name: Perform CodeQL Analysis
6860
uses: github/codeql-action/analyze@v3

daemon/Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,13 @@ clean:
4646
clean-bin:
4747
$(GO) clean $(GOFLAGS) -i ./...
4848

49-
# setup depenencies for daemon
50-
# THIS IS TEMPORARY NEEDS TO BE REPLACED BY PINNED VENDOR DEPENDENCIES
51-
# will download vendor dependencies
52-
.PHONY: go-setup-dependencies
53-
go-setup-dependencies:
54-
$(GO) mod tidy
55-
$(GO) mod vendor
56-
5749
# Build the binaries
5850
.PHONY: $(BINARIES)
59-
$(BINARIES): clean-bin go-setup-dependencies
51+
$(BINARIES): clean-bin
6052
$(GO) install $(GOFLAGS) $(GO_MODULE)/cmd/$@
6153

6254
# the -race flag enabled the integrated Go race detector. Output to stderr.
63-
race: clean-bin go-setup-dependencies
55+
race: clean-bin
6456
$(GO) install -race $(GOFLAGS) $(GO_MODULE)/$@
6557

6658
# Test targets
@@ -76,10 +68,10 @@ cover:
7668
rm -f $(DAEMON_COV_FILE)
7769

7870
.PHONY: integration
79-
integration: go-setup-dependencies
71+
integration:
8072
$(GO) test $(GOFLAGS) -tags integration ./...
8173

8274
.PHONY: test
83-
test: go-setup-dependencies
75+
test:
8476
$(GO) test $(GOFLAGS) ./...
8577

daemon/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/newrelic/newrelic-php-agent/daemon
22

3-
go 1.21.1
3+
go 1.21
4+
toolchain go1.22.3
45

56
require (
67
github.com/golang/protobuf v1.5.3

go.work

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

go.work.sum

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)