Skip to content

Commit

Permalink
fix: Revert 186 and 187 for injecting version during build (#206)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

- Reverts #186 
- Reverts #187 

## Short description of the changes

As seen in #192 (and attempted to fix in #201), GitHub Actions checkout
action doesn't include git tag history, so computing current version
from tags doesn't work at the moment.

We are temporarily reverting this to expedite a new release using
hardcoded version values, and will revisit this later.

## How to verify that this has the expected result

`honeycomb.agent_version` shows the `vX.Y.Z` version in use, in agent
container logs and telemetry.

---------

Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
  • Loading branch information
JamieDanielson and robbkidd committed Sep 18, 2023
1 parent 7eed65c commit 4a7a2aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ ifeq (,$(wildcard /sys/kernel/btf/vmlinux))
BPF_HEADERS += -DBPF_NO_PRESERVE_ACCESS_INDEX
endif

RELEASE_VERSION ?= $(shell git describe --always --match "v[0-9]*")
IMG_NAME ?= hny/network-agent
IMG_TAG ?= local

.PHONY: version
#: display the current computed project version
version:
@echo $(RELEASE_VERSION)

.PHONY: generate
generate: export CFLAGS := $(BPF_HEADERS)
#: generate go/bpf interop code
Expand All @@ -36,10 +30,7 @@ docker-generate:
.PHONY: build
#: compile the agent executable
build:
CGO_ENABLED=1 GOOS=linux \
go build \
--ldflags "-X main.Version=$(RELEASE_VERSION)" \
-o hny-network-agent main.go
CGO_ENABLED=1 GOOS=linux go build -o hny-network-agent main.go

.PHONY: docker-build
#: build the agent image
Expand Down Expand Up @@ -110,4 +101,4 @@ port-forward-pyroscope:
.PHONY: unapply-pyroscope-server
#: tear down pyroscope server
unapply-pyroscope-server:
helm uninstall pyroscope
helm uninstall pyroscope
5 changes: 3 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Releasing

- Update `CHANGELOG.md` with the changes since the last release. Consider automating with a command such as one of these two:
- Update version number in `main.go`
- Update `CHANGELOG.md` with the changes since the last release. Consider automating with a command such as these two:
- `git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline > new-in-this-release.log`
- `git log --pretty='%C(green)%d%Creset- %s | [%an](https://github.com/)'`
- Commit changes, push, and open a release preparation pull request for review.
- Once the pull request is merged, fetch the updated `main` branch.
- Apply an annotated tag (`git tag -a`) for the new version on the merged commit (e.g. `git tag -a v0.1.0-alpha -m "v0.1.0-alpha"`)
- Apply a tag for the new version on the merged commit (e.g. `git tag -a v0.1.0-alpha -m "v0.1.0-alpha"`)
- Push the tag upstream (this will kick off the release pipeline in CI) e.g. `git push origin v0.1.0-alpha`
- Ensure that there is a draft GitHub release created as part of CI publish steps.
- Click "generate release notes" in GitHub for full changelog notes and any new contributors
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import (
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)

var Version string = "dev"

const Version string = "0.0.15-alpha"
const defaultDataset = "hny-network-agent"
const defaultEndpoint = "https://api.honeycomb.io"

Expand Down

0 comments on commit 4a7a2aa

Please sign in to comment.