Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildstamp: Fix "official" build stamping #14

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

minor-fixes
Copy link
Contributor

This change fixes the logic for "official build" labeling in buildstamp logic. Before this change, only builds from the branch master were official; this was erroneous since this repo uses main as the trunk branch name.

This change validates the branch name against main and release branch patterns using a regexp, since technically official builds could come from release branches as well.

Tested: Created a temp local branch matching the release branch pattern, and checked that a build was marked official:

[blackbird | ~/dev/engflow.com/auth] (release/v0.0)
scott-> bazel run --stamp //cmd/engflow_auth -- version
INFO: Writing tracer profile to '/home/scott/.cache/bazel/_bazel_scott/b3a8ca38e37ded8f1e329b8939d3f3df/command.profile.gz'
INFO: Analyzed target //cmd/engflow_auth:engflow_auth (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //cmd/engflow_auth:engflow_auth up-to-date:
  bazel-bin/cmd/engflow_auth/engflow_auth_/engflow_auth
INFO: Elapsed time: 0.458s, Critical Path: 0.22s
INFO: 4 processes: 1 internal, 3 linux-sandbox.
INFO: Build completed successfully, 4 total actions
INFO: Running command line: bazel-bin/cmd/engflow_auth/engflow_auth_/engflow_auth version
build time: 2024-07-23 13:33:52 -0400 EDT
official build: true
build branch: release/v0.0
build revision: 742a795ba209ebdff9d3ce70d7ecdd727f3ea3de
clean build: true

Bug: linear/CUS-358

This change fixes the logic for "official build" labeling in buildstamp
logic. Before this change, only builds from the branch `master` were
official; this was erroneous since this repo uses `main` as the trunk
branch name.

This change validates the branch name against `main` and release branch
patterns using a regexp, since technically official builds could come
from release branches as well.

Tested: Created a temp local branch matching the release branch pattern,
and checked that a build was marked official:

```
[blackbird | ~/dev/engflow.com/auth] (release/v0.0)
scott-> bazel run --stamp //cmd/engflow_auth -- version
INFO: Writing tracer profile to '/home/scott/.cache/bazel/_bazel_scott/b3a8ca38e37ded8f1e329b8939d3f3df/command.profile.gz'
INFO: Analyzed target //cmd/engflow_auth:engflow_auth (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //cmd/engflow_auth:engflow_auth up-to-date:
  bazel-bin/cmd/engflow_auth/engflow_auth_/engflow_auth
INFO: Elapsed time: 0.458s, Critical Path: 0.22s
INFO: 4 processes: 1 internal, 3 linux-sandbox.
INFO: Build completed successfully, 4 total actions
INFO: Running command line: bazel-bin/cmd/engflow_auth/engflow_auth_/engflow_auth version
build time: 2024-07-23 13:33:52 -0400 EDT
official build: true
build branch: release/v0.0
build revision: 742a795ba209ebdff9d3ce70d7ecdd727f3ea3de
clean build: true
```

Bug: linear/CUS-358
@minor-fixes minor-fixes merged commit 7367477 into main Jul 23, 2024
4 checks passed
@minor-fixes minor-fixes deleted the scott/CUS-358 branch July 23, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants