Skip to content

Commit

Permalink
security(daemon): upgrade golang to 1.22 (#890)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lavarou authored May 15, 2024
1 parent 3d09829 commit 42136bb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,20 @@ jobs:
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: manual
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Build
run: |
make ${{ matrix.language == 'go' && 'daemon' || 'agent' }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
16 changes: 4 additions & 12 deletions daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,13 @@ clean:
clean-bin:
$(GO) clean $(GOFLAGS) -i ./...

# setup depenencies for daemon
# THIS IS TEMPORARY NEEDS TO BE REPLACED BY PINNED VENDOR DEPENDENCIES
# will download vendor dependencies
.PHONY: go-setup-dependencies
go-setup-dependencies:
$(GO) mod tidy
$(GO) mod vendor

# Build the binaries
.PHONY: $(BINARIES)
$(BINARIES): clean-bin go-setup-dependencies
$(BINARIES): clean-bin
$(GO) install $(GOFLAGS) $(GO_MODULE)/cmd/$@

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

# Test targets
Expand All @@ -76,10 +68,10 @@ cover:
rm -f $(DAEMON_COV_FILE)

.PHONY: integration
integration: go-setup-dependencies
integration:
$(GO) test $(GOFLAGS) -tags integration ./...

.PHONY: test
test: go-setup-dependencies
test:
$(GO) test $(GOFLAGS) ./...

3 changes: 2 additions & 1 deletion daemon/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/newrelic/newrelic-php-agent/daemon

go 1.21.1
go 1.21
toolchain go1.22.3

require (
github.com/golang/protobuf v1.5.3
Expand Down
3 changes: 0 additions & 3 deletions go.work

This file was deleted.

1 change: 0 additions & 1 deletion go.work.sum

This file was deleted.

0 comments on commit 42136bb

Please sign in to comment.