Skip to content

Set mod time & revision via ldflags; Sign docker image with actions/attest#38

Merged
tangrufus merged 6 commits intomainfrom
build-link
Mar 25, 2026
Merged

Set mod time & revision via ldflags; Sign docker image with actions/attest#38
tangrufus merged 6 commits intomainfrom
build-link

Conversation

@tangrufus
Copy link
Member

@tangrufus tangrufus commented Mar 24, 2026

  • Fix duplicate -ldflags in Dockerfile (combined into single value)
  • Add actions/checkout step to publish workflow
  • Add attestations: read permission to deploy workflow
  • Fix Revision default value typo: devldevel (matching Go toolchain convention)
  • Remove accidentally committed serve binary

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…s/attest`

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 24, 2026 17:49
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.28%. Comparing base (d1f1814) to head (7333cec).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
cmd/serve/main.go 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   90.97%   91.28%   +0.30%     
==========================================
  Files          22       22              
  Lines        4767     4751      -16     
==========================================
  Hits         4337     4337              
+ Misses        398      382      -16     
  Partials       32       32              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR switches build stamping from VCS build info to explicit -ldflags variables (mod time + revision), adds local tasks to build/run the container image with those stamps, and replaces Cosign signing/verification with GitHub’s native actions/attest + gh attestation verify in the publish/deploy workflows.

Changes:

  • Add mise tasks/env for building and running a locally tagged image with stamped build args.
  • Introduce ModTime/Revision linker-stamped variables in cmd/serve and use them for startup logging + 304 mod-time behavior.
  • Update Docker build and GitHub workflows to pass build args and generate/verify GitHub attestations instead of Cosign.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mise.toml Adds DOCKER env and image/image:build tasks to build/run the dev image with MOD_TIME/REVISION args.
mise.local-example.toml Documents overriding DOCKER (e.g., to use Podman).
cmd/serve/main.go Adds linker-stamped globals and replaces debug build-info based stamping with explicit RFC3339 parsing/fallback.
Dockerfile Accepts MOD_TIME/REVISION build args and stamps them into the binary via -ldflags.
.github/workflows/publish.yml Passes MOD_TIME/REVISION build args and attests the pushed image with actions/attest.
.github/workflows/deploy.yml Verifies the image using gh attestation verify and deploys by digest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tangrufus and others added 4 commits March 25, 2026 17:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: tangrufus <2259834+tangrufus@users.noreply.github.com>
Agent-Logs-Url: https://github.com/typisttech/wpsecadv/sessions/85af0e3c-0267-46f8-a42e-48f88061758b
@tangrufus tangrufus enabled auto-merge (squash) March 25, 2026 18:11
@tangrufus tangrufus disabled auto-merge March 25, 2026 18:40
@tangrufus tangrufus merged commit b468b64 into main Mar 25, 2026
16 checks passed
@tangrufus tangrufus deleted the build-link branch March 25, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants