Skip to content

chore: include debug symbols in nightly images#908

Merged
steveiliop56 merged 2 commits into
mainfrom
chore/nightly-debug
May 27, 2026
Merged

chore: include debug symbols in nightly images#908
steveiliop56 merged 2 commits into
mainfrom
chore/nightly-debug

Conversation

@steveiliop56
Copy link
Copy Markdown
Member

@steveiliop56 steveiliop56 commented May 27, 2026

Summary by CodeRabbit

  • Chores
    • Parameterized linker flags across build and release pipelines for more consistent builds.
    • Nightly builds now preserve debug symbols to aid debugging.
    • Release image builds and local build targets use configurable symbol-stripping for smaller, production-ready binaries.

Review Change Stack

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 27, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 72382bf0-e3bf-4945-8bf4-95c14fb6dd8d

📥 Commits

Reviewing files that changed from the base of the PR and between d83ace1 and 54cf131.

📒 Files selected for processing (2)
  • Dockerfile
  • Dockerfile.distroless
🚧 Files skipped from review as they are similar to previous changes (2)
  • Dockerfile
  • Dockerfile.distroless

📝 Walkthrough

Walkthrough

Centralizes Go linker flags by adding an LDFLAGS variable in the Makefile, introducing ARG LDFLAGS in both Dockerfiles and using it in go build, removing inline -s -w in nightly CI builds, and passing LDFLAGS="-s -w" as build-args in release image jobs.

Changes

Linker Flags Parameterization

Layer / File(s) Summary
Makefile LDFLAGS definition
Makefile
A new LDFLAGS := -s -w is defined and the binary target’s go build -ldflags now references ${LDFLAGS}.
Docker build argument parameterization
Dockerfile, Dockerfile.distroless
Both Dockerfiles add ARG LDFLAGS in the builder stage and update go build to prefix -ldflags with the ${LDFLAGS} value instead of hardcoding -s -w.
Workflow build coordination
.github/workflows/nightly.yml, .github/workflows/release.yml
Nightly workflows remove inline -s -w from go build for amd64 and arm64 jobs. Release workflows add LDFLAGS="-s -w" to build-args for four image-build jobs (amd64, distroless, arm64, arm64-distroless).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hop through Make and Docker lands,
flags in paw and plans in hand.
No more hardcode in a row,
one small var to make it so.
Build pipelines hum — go, go, go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims to 'include debug symbols in nightly images', but the changes actually remove debug symbols (-s -w flags) from nightly builds while adding them to release Docker builds. Update the title to accurately reflect the changes, such as 'chore: move debug symbol stripping from nightly to release Docker builds' or 'chore: enable debug symbols in release Docker images'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/nightly-debug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Dockerfile`:
- Around line 43-46: The go build invocation has a malformed -ldflags
interpolation: replace the stray closing brace in "${LDFLAGS}}" with
"${LDFLAGS}" so the linker flags interpolate correctly; update the RUN lines
that set CGO_ENABLED=0 and call go build (the -ldflags argument and its quoted
multi-line continuation) in both the Dockerfile and Dockerfile.distroless to
remove the extra "}" while preserving the existing -X assignments for
github.com/tinyauthapp/tinyauth/internal/model.Version, CommitHash and
BuildTimestamp.

In `@Dockerfile.distroless`:
- Around line 45-48: The -ldflags expansion in the Docker build RUN line is
malformed: it uses the variable token "${LDFLAGS}}" (extra closing brace) which
injects a stray '}' into the linker flags; fix the build invocation that runs
"go build ... -ldflags ... ./cmd/tinyauth" by correcting the variable to
"${LDFLAGS}" (remove the extra '}') in both Dockerfile.distroless and Dockerfile
so the go linker receives the intended flags alongside the -X flags for
model.Version, model.CommitHash, and model.BuildTimestamp.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b20456e-0987-467a-a659-924197b2c923

📥 Commits

Reviewing files that changed from the base of the PR and between 4538922 and d83ace1.

📒 Files selected for processing (5)
  • .github/workflows/nightly.yml
  • .github/workflows/release.yml
  • Dockerfile
  • Dockerfile.distroless
  • Makefile

Comment thread Dockerfile Outdated
Comment thread Dockerfile.distroless Outdated
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 27, 2026
@steveiliop56 steveiliop56 merged commit f2c4e79 into main May 27, 2026
5 checks passed
@steveiliop56 steveiliop56 deleted the chore/nightly-debug branch May 27, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants