github jwilder/dockerize v0.14.0

10 hours ago

Changelog

  • 9593ee5 Add 'cache: true' to every actions/setup-go step in the existing ci.yml (lint, test, vulncheck, build jobs) so caching is applied consistently to all jobs in the real workflow instead of a duplicate file.
  • 6d99eaf Add 'cache: true' to the actions/setup-go step in release.yml (keep the previous attempt's correct change here).
  • 50aebd6 Add 'timeout-minutes: 15' to the 'lint' job in the Lint workflow file.
  • 24fa7f5 Add 'timeout-minutes: 15' to the 'release' job in the Release workflow file.
  • 3bf3ea3 Add 15-minute timeout to CodeQL workflow
  • c267dd3 Add concurrency: { group: ${{ github.workflow }}-${{ github.ref }}, cancel-in-progress: true } to the second PR-triggered workflow file (the one with push and pull_request triggers). Place the concurrency block at the top level of the workflow without altering any existing triggers or jobs.
  • 44be37a Add timeout-minutes: 15 (or an appropriate value per job) to each job defined in the CI workflow file, including the lint job and any other jobs present.
  • 5162cb7 Add a deterministic, failing test that proves waitForSocket ignores its timeout parameter. To make the dial observable, introduce a minimal package-level dial seam in main.go (e.g. var dialTimeout = net.DialTimeout) and have waitForSocket call it WHILE STILL passing waitTimeoutFlag (bug preserved). In main_test.go, override the seam with a stub that records the timeout argument and returns a successful connection (e.g. via net.Pipe) so the retry goroutine exits; assert the recorded timeout equals the value passed to waitForSocket. This test FAILS because the body forwards waitTimeoutFlag, not the parameter.
  • 90f692c Add a failing test to template_test.go that calls the defaultValue template function with a non-nil, non-string value for args[0] (e.g. an int from atoi/add) and asserts that template execution does not panic. This test must fail (panic) against the current code, proving the bug.
  • c44b201 Add a test in main_test.go for Context.Env() that verifies it returns all current environment variables correctly (key=value mapping). This establishes a behavioral baseline that must remain unchanged after the size-hint optimization is applied.
  • 16c9c35 Add a test in template_test.go that exercises the producer/consumer path using channel c, verifying all produced values from start to stop with the given step are consumed correctly and in order. This locks in the channel's functional behavior before introducing the buffer change.
  • 537e60a Add a top-level concurrency block with group: ${{ github.workflow }}-${{ github.ref }} and cancel-in-progress: true to the first PR-triggered workflow file (the one triggered by push and pull_request on master). Only add the concurrency block; do not alter any existing triggers, jobs, or steps.
  • a4bf5a7 Add a top-level concurrency block with group: ${{ github.workflow }}-${{ github.ref }} and cancel-in-progress: true to the second PR-triggered workflow file (the one triggered by push, pull_request, and schedule on master). Only add the concurrency block; do not alter any existing triggers, jobs, or steps.
  • 012b771 Add tests for main.go covering waitForDependencies, connection checking, and signal handling logic
  • a242e42 Add tests for tail.go covering file tailing functionality
  • a4443f7 Add tests for template.go covering template generation, parsing, and rendering functions
  • 4a564b4 Apply the core fix: change waitForSocket to forward its timeout parameter (instead of the global waitTimeoutFlag) to the dial seam. The test from step 1 now PASSES, demonstrating the bug is fixed.
  • 7fb0522 Bump Go from 1.25.11 to 1.25.12
  • 207dcc7 Continue the main.go complexity reduction by extracting the remaining ex
  • a1f49c2 Create a new clean Go test file exec_signal_test.go (valid Go, package main, NO markdown fences or backticks anywhere). Add a subprocess-helper pattern that compiles against runCmd (whose signature is unchanged) so it can detect the data race under -race: (a) a helper test TestRunCmdSignalShutdownHelper that calls t.Skip(...) unless an env var like RUNCMD_SIGNAL_SHUTDOWN_HELPER=1 is set, otherwise runs runCmd(ctx, cancel, "sleep", "30"); (b) a driver test TestRunCmdSignalShutdown that re-execs the test binary via exec.Command(os.Args[0], "-test.run=^TestRunCmdSignalShutdownHelper$"), sets Env to include RUNCMD_SIGNAL_SHUTDOWN_HELPER=1 and GORACE=halt_on_error=1, captures the child's stderr into a bytes.Buffer, starts it, sleeps ~1s, sends syscall.SIGTERM to the child, then waits (with a ~20s timeout guarding against hangs) for the child to exit and asserts the captured stderr does NOT contain "DATA RACE". With the unfixed concurrent process.Wait() this test fails under -race (DATA RACE reported); with the fix it passes. Use only standard-library imports (context, os, os/exec, syscall, testing, time, bytes, strings).
  • 2467392 Edit exec.go to remove the second process.Wait() call. In runCmd, declare waitDone := make(chan struct{}) before the signal-handling goroutine, pass it as a new argument to signalProcessWithTimeout(process, sig, waitDone), and add close(waitDone) immediately after the single err = process.Wait() returns (before/around the existing cancel()). Change signalProcessWithTimeout to the signature func signalProcessWithTimeout(process *exec.Cmd, sig os.Signal, waitDone <-chan struct{}), delete the internal goroutine that called process.Wait() and close(done), keep the existing process.Process.Signal(sig) call (and its existing comment), and replace the select so it waits on <-waitDone (return) vs <-time.After(10 * time.Second) (log + process.Process.Kill()). Make ONLY these changes — do not alter imports, exit-code handling, or add signal.Stop. CRITICAL: the file must remain valid Go starting with package main and ending with a normal newline — do NOT insert any go opening fence, closing fence, or backticks anywhere (this was the cause of the prior 'patch corrupted' rejection).
  • 84d14e5 Expand main_test.go with targeted unit tests for the new main.go helper
  • d26c1b6 Fix defaultValue in template.go by replacing the unchecked args[0].(string) assertion at lines 42-43 with the comma-ok pattern, mirroring the guarded args[1] handling at line 52, so a non-string args[0] is handled gracefully instead of panicking.
  • c460188 For the checkout step that already sets 'fetch-depth: 0' and 'token: ${{ secrets.GITHUB_TOKEN }}' (evidence lines 26-30), verify whether the job performs a git push/tag. If it does NOT push, add 'persist-credentials: false' to the existing 'with' block; if it does push, leave credentials persisted and document why.
  • 5c517bd Go fmt (automated transform)
  • 5663029 In e2e/e2e_test.go, add a regression test for -wait-http-header that inv
  • 18cf60b In main.go, change the -wait-http-header parsing block and the -template
  • 97ae43a In main.go, change the map creation on line 33 from make(map[string]string) to make(map[string]string, len(os.Environ())) to pre-size the map based on the expected number of environment entries. Do not alter any other logic in the function.
  • 97b35d6 In main.go, ensure the 'errors' package is imported and replace os.IsNotExist(err) in the file-wait loop (around line 105) with errors.Is(err, os.ErrNotExist). This is the change the reviewer reported as lost.
  • c64dd19 In main.go, include the dial target context in the error logs: add the scheme/addr being dialed to the 'Problem with dial: %v' message in waitForSocket (line 178), and add the URL to the http/https wait 'Problem with dial: %v' message (line 128), correctly labeling the http.NewRequest failure rather than calling it a dial. Match the contextual style already used by sibling lines like 'Connected to %s://%s' and 'unable to stat %s'.
  • 5ca776e In main.go, update the header-parsing error messages (lines 270 and 274) to log the offending individual header h instead of the entire headersFlag slice, so the specific failing input is identified.
  • 6ff080b In template.go at line 118, change the unbuffered channel c := make(chan int) to a buffered channel c := make(chan int, N) with an appropriate buffer size to reduce goroutine wake-ups. Do not alter any surrounding producer/consumer logic.
  • 26431f4 In template.go, add the 'errors' import (if not present) and replace os.IsNotExist(err) inside exists() with errors.Is(err, os.ErrNotExist).
  • 9ca43c5 In template.go, include the destination file path in the 'unable to chmod temp file: %s' (line 178) and 'unable to chown temp file: %s' (line 181) error messages so the failing target file is named.
  • 2017179 In template.go, update the three error messages that omit their operation target: add the destPath to the 'unable to create' message (line 166), add the templatePath to the 'unable to parse template' message (line 154), and add the identifying template/path to the 'template error' message (line 173), matching the pattern already used by the messages at template.go:192 and 201.
  • 4df209c Locate the first workflow checkout step (simple actions/checkout@v6 with no token, evidence lines 15-21) and add with: / persist-credentials: false to prevent credential persistence.
  • f909c71 Locate the workflow checkout step that has no 'with' block (evidence lines 22-23, followed by Set up Go at line 25) and add 'with:\n persist-credentials: false' since no git push is performed.
  • 8f51e57 Locate the workflow checkout step with no 'with' block (evidence lines 18-19, followed by Set up Go at line 21) and add 'with:\n persist-credentials: false' since no git push is performed.
  • f402598 Locate the workflow checkout step with no 'with' block (evidence lines 25-26, followed by Set up Go at line 28) and add 'with:\n persist-credentials: false' since no git push is performed.
  • 5deb98b Read README.md and align the 'Project setup' and 'Running tests' sections of CONTRIBUTING.md with the actual build/run/test instructions documented there (e.g. correct Go build commands, any prerequisites, and naming of the project/binary). Fix any inaccuracies so the doc is consistent with the README.
  • d4cabc1 Read the Makefile and verify every Makefile-related claim in CONTRIBUTING.md (the make test, make dockerize targets and the underlying commands such as go test -v -race ./...). Correct CONTRIBUTING.md to reflect the exact target names and commands that actually exist in the Makefile; remove or fix any target or command that does not exist.
  • a9e33ae Refactor main.go to extract flag setup and parsed runtime state into sma
  • ebffab2 Remove the unused templateDirsFlag sliceVar declaration from the package-level var block in main.go. Verify it is not registered via flag.Var() nor referenced elsewhere before deletion, then remove only that declaration line.
  • 263f7db Remove the unused package-level dependencyChan chan struct{} declaration from the var block (main.go:53). The variable is never read or written at package scope because waitForDependencies() creates its own local dependencyChan via make(chan struct{}). Leave the local variable and all other declarations in the var block untouched.
  • 30e93f1 Rewrite .github/CODEOWNERS using the canonical GitHub CODEOWNERS format: include a clarifying header comment, a valid default-owner glob rule (* @jwilder), and ensure the file is plain UTF-8/ASCII text with a single trailing newline so it is no longer flagged as corrupted/malformed.
  • 92ecb70 Update exists() (line 26) to wrap the os.Stat error with the path, and jsonQuery() (lines 91, 95) to wrap the returned errors with the JSON object/query that failed, matching the existing 'unable to ... %s' style.
  • ec3df3b Update the checkout step in .github/workflows/codeql.yml to add `persi
  • 5040d70 Update the checkout steps in .github/workflows/ci.yml to add `persist-
  • a0dbcce Update waitForSocket's 'Problem with dial' log (line 185) to include the scheme/addr being dialed, and the HTTP wait loop's 'Problem with dial'/'Problem with request' logs (lines 128, 139) to include the target URL.
  • f5938ca Use any instead of interface{} (2 findings)
  • 9142ec1 Write failing tests verifying that exists() includes the file path in its error and that jsonQuery() includes the JSON object/query context in its returned errors.
  • 0a0ad16 Write failing tests verifying that waitForSocket (line 185) and the HTTP wait loop (lines 128, 139) include the scheme/addr and target URL in their log output.
  • 8ec283f refactor: extract drainBody helper and fix unchecked error returns in HTTP/socket wait
  • 2b3e41a refactor: extract waitForFile and waitForHTTP from waitForDependencies
  • 536a013 refactor: remove untrappable SIGKILL from signal.Notify

Don't miss a new dockerize release

NewReleases is sending notifications on new releases.