|
| 1 | +# No-Cache Option Verification Report |
| 2 | + |
| 3 | +## Summary |
| 4 | +The `no-cache` option is **properly plumbed through** in the `respect-no-cache` branch and will be passed to the Docker buildx command when enabled. |
| 5 | + |
| 6 | +## Code Flow Analysis |
| 7 | + |
| 8 | +### 1. Input Declaration (action.yml:56-59) |
| 9 | +```yaml |
| 10 | +no-cache: |
| 11 | + description: "Do not use cache when building the image" |
| 12 | + required: false |
| 13 | + default: 'false' |
| 14 | +``` |
| 15 | +
|
| 16 | +### 2. Input Reading (src/context.ts:80) |
| 17 | +```typescript |
| 18 | +'no-cache': core.getBooleanInput('no-cache') |
| 19 | +``` |
| 20 | +The input is read as a boolean value from GitHub Actions inputs. |
| 21 | +
|
| 22 | +### 3. Argument Construction (src/context.ts:273-275) |
| 23 | +```typescript |
| 24 | +if (inputs['no-cache']) { |
| 25 | + args.push('--no-cache'); |
| 26 | +} |
| 27 | +``` |
| 28 | +When `no-cache` is true, the `--no-cache` flag is added to the buildx arguments. |
| 29 | + |
| 30 | +### 4. Command Execution (src/main.ts:304-310) |
| 31 | +```typescript |
| 32 | +const buildCmd = await toolkit.buildx.getCommand(args); |
| 33 | +// ... |
| 34 | +await Exec.getExecOutput(buildCmd.command, buildCmd.args, ...) |
| 35 | +``` |
| 36 | +The arguments (including `--no-cache` if present) are passed to the buildx command. |
| 37 | + |
| 38 | +## Verification Results |
| 39 | + |
| 40 | +### When `no-cache: true` |
| 41 | +- The `--no-cache` flag WILL be added to the docker buildx build command |
| 42 | +- BuildKit will not use any cached layers from previous builds |
| 43 | +- The entire image will be rebuilt from scratch |
| 44 | +- This ensures fresh dependencies and no stale cache issues |
| 45 | + |
| 46 | +### When `no-cache: false` (default) |
| 47 | +- The `--no-cache` flag will NOT be added |
| 48 | +- BuildKit will use its normal caching behavior |
| 49 | +- Cached layers from previous builds will be reused when possible |
| 50 | +- This provides faster builds when cache is valid |
| 51 | + |
| 52 | +## Impact on Remote Builder |
| 53 | +Since your builder is a custom remote builder that shares BuildKit across various runs: |
| 54 | +- With `no-cache: true` - The remote BuildKit instance will ignore all existing cache layers for this specific build |
| 55 | +- With `no-cache: false` - The remote BuildKit instance will use its shared cache pool as normal |
| 56 | + |
| 57 | +## Conclusion |
| 58 | +The `no-cache` option is correctly implemented and will effectively control whether the remote BuildKit instance uses cached layers. When set to `true`, it forces a complete rebuild without using any cached layers, which is exactly what you'd expect for ensuring fresh builds. |
0 commit comments