Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .claude/commands/review-roundup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
model: sonnet
effort: medium
---

Categorize open non-draft PRs into a Slack-ready review-nudge message, prioritizing user-reported bugs. Usage: `/review-roundup`

1. List PRs:
```bash
gh pr list --state open --draft=false --limit 100 \
--json number,title,reviewRequests,additions,deletions,createdAt \
--jq '.[] | "\(.number)\t+\(.additions)/-\(.deletions)\t[\(.reviewRequests|map(.login // .name)|join(","))]\t\(.title)"'
```
2. Linked issue per PR: `gh pr view <num> --json body --jq '.body[:600]'` → `Closes`/`Fixes #N`.
3. Issue author+labels: `gh issue view <num> --json author,title,labels --jq '.author.login + " [" + (.labels|map(.name)|join(",")) + "] " + .title'`
- `mzihlmann` is the maintainer; his issues (typically `fuzz`/internal) are NOT user-reported and never go in 🔥/🙋, whatever the labels.
- Multi-issue PR = user-reported only if ≥1 linked issue has an external author. All-`mzihlmann` → internal (🐛/🧹). Check every linked issue.
- A PR continuing a user's contribution (PR body cites a prior user PR) credits that contributor (`continues @user's #N`) and rises out of plain 🧹.
4. Output the Slack message in a code block for the WYSIWYG composer: `*bold*` headers (single asterisk, not `**`), `- ` bullets, `[#N](url)` links. PR url: `https://github.com/osscontainertools/kaniko/pull/<num>`. No `---` separators, no prose around the block.
- Header: `📋 *Open PRs needing review*`. No reviewer @mentions — pasted mentions don't notify and highlight inconsistently.
- Groups in priority order, drop empty: 🔥 Top priority (user bug `bug`/`regression`) · 🙋 User-requested feature (user `enhancement`) · 🐛 Crash fixes (fuzz/internal) · ⚡ Caching · ♻️ Reproducible builds · 🧹 Maintenance (dead code, dep bumps, deprecation flags).
- Line: `- [#<num>](url) — <what it fixes> — closes #<issue> by @<author> \`+A/-B\``. `by @<author>` only when user-reported. `⚠️ no reviewers` when `reviewRequests` empty. Tag `easy review` for low-risk PRs (dead code, coverage).
- Never warn `large`. The `+A/-B` shown is the reviewable diff: exclude `vendor/`, `go.mod`/`go.sum`/`modules.txt`, and `golden/`/`testdata/` snapshots. When raw total is inflated, show the code count and note `(rest vendored)` / `(rest golden snapshots)`. Compute via: `gh pr view <num> --json files --jq '[.files[]|select(.path|test("^vendor/|go\\.(mod|sum)|modules\\.txt|golden/|testdata/")|not)]|"+\(map(.additions)|add)/-\(map(.deletions)|add)"'`.
5. If any PR lacks reviewers, flag and ask before assigning the shared set. Never assign without confirmation.
99 changes: 99 additions & 0 deletions cmd/executor/cmd/bake.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
Copyright 2026 OSS Container Tools

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cmd

import (
"fmt"
"strings"

"github.com/osscontainertools/kaniko/pkg/bake"
"github.com/osscontainertools/kaniko/pkg/config"
"github.com/osscontainertools/kaniko/pkg/logging"
"github.com/spf13/cobra"
)

var bakeSet []string

func init() {
AddBakeFlags(bakeCmd, opts, &bakeSet)
addHiddenFlags(bakeCmd)
RootCmd.AddCommand(bakeCmd)
}

func AddBakeFlags(cmd *cobra.Command, opts *config.KanikoOptions, set *[]string) {
AddSharedBuildFlags(cmd, opts)
cmd.Flags().StringArrayVar(set, "set", nil, "Override a bakefile target field: <target>.<field>=<value>. Set it repeatedly for multiple overrides.")
}

func ConfigureFromBakefile(opts *config.KanikoOptions, path string, selection, set []string) error {
bakefile, err := bake.Parse(path)
if err != nil {
return err
}
targets, err := bakefile.Resolve(selection)
if err != nil {
return err
}
overrides := make([]bake.Override, 0, len(set))
for _, s := range set {
o, err := bake.ParseOverride(s)
if err != nil {
return err
}
overrides = append(overrides, o)
}
if err := bake.ApplyOverrides(targets, overrides); err != nil {
return err
}
if len(targets) != 1 {
ids := make([]string, len(targets))
for i, t := range targets {
ids[i] = t.ID
}
return fmt.Errorf("bakefile defines multiple targets, name one to build: %s", strings.Join(ids, ", "))
}
target := targets[0]
if !opts.NoPush && len(target.Destination) == 0 {
return fmt.Errorf("target %q has no destination, set one in the bakefile or use --no-push", target.ID)
}
opts.Target = []string{target.Stage}
for _, d := range target.Destination {
if err := opts.Destinations.Set(d); err != nil {
return err
}
}
return nil
}

var bakeCmd = &cobra.Command{
Use: "bake <bakefile> [target]",
Short: "Build a target defined in a JSON bakefile",
Long: `Build a target defined in a JSON bakefile. The bakefile may define several
targets; name the one to build (it may be omitted when there is only one). The
target's stage and push destination come from the bakefile. Context, dockerfile,
build args and other settings come from the usual flags.`,
Args: cobra.RangeArgs(1, 2),
RunE: func(_ *cobra.Command, args []string) error {
if err := logging.Configure(logLevel, logFormat, logTimestamp); err != nil {
return err
}
if err := ConfigureFromBakefile(opts, args[0], args[1:], bakeSet); err != nil {
return err
}
return runBuild(opts)
},
}
Loading
Loading