Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
90e7b69
Checkpoint. Not right at all
macneale4 Feb 4, 2026
552046e
neil fixes some tests
macneale4 Feb 6, 2026
73023f5
two tests which work in isolation, but fail together
macneale4 Feb 6, 2026
ae88712
resetting test harness should clear system variables
macneale4 Feb 6, 2026
f81d185
More debugging
macneale4 Feb 6, 2026
6c644ca
Fixing tests. Looks like rebase --skip-tests doesn't work
macneale4 Feb 6, 2026
3422d0e
Add skip_verification flag to RebaseState
macneale4 Feb 9, 2026
b5f9ab9
Add the ability to carry skipVerification flag through rebase steps
macneale4 Feb 9, 2026
240c443
settle on --skip-verification
macneale4 Feb 10, 2026
050c8e8
move to skip verification term everywhere
macneale4 Feb 10, 2026
1c22c23
Broken tests. checkpoint
macneale4 Feb 10, 2026
82ab968
Fix test message
macneale4 Feb 10, 2026
338517a
CLI Tests with rebase
macneale4 Feb 10, 2026
93dd3f6
add --skip-verification flag to commit and merge cli commands
macneale4 Feb 10, 2026
33158a1
Neil Cleans up after claude
macneale4 Feb 10, 2026
dd41a1e
Fix commit test
macneale4 Feb 10, 2026
6f8102e
Move test helpers into the one place they are used
macneale4 Feb 11, 2026
439b554
rename session variable, remove dead code, fix test strings
macneale4 Feb 11, 2026
abf30aa
Simplify more
macneale4 Feb 11, 2026
9319daa
note to investigate
macneale4 Feb 11, 2026
8272ad1
fix hardcoded flag in rebase
macneale4 Feb 11, 2026
da09b6b
Fix bats formatting
macneale4 Feb 11, 2026
31a2f6a
More commit_verification.bats formatting goodness
macneale4 Feb 11, 2026
b655ee9
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
macneale4 Feb 11, 2026
707e42f
Fix messages in commit_verification.bats
macneale4 Feb 11, 2026
94eddc5
Remove nonsense row len check
macneale4 Feb 11, 2026
3663d95
test workarounds
macneale4 Feb 12, 2026
ca6143c
The batch_mode test may be fixed with the defaultSkippedQueries
macneale4 Feb 12, 2026
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
5 changes: 5 additions & 0 deletions go/cmd/dolt/cli/arg_parser_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func CreateCommitArgParser(supportsBranchFlag bool) *argparser.ArgParser {
ap.SupportsFlag(UpperCaseAllFlag, "A", "Adds all tables and databases (including new tables) in the working set to the staged set.")
ap.SupportsFlag(AmendFlag, "", "Amend previous commit")
ap.SupportsOptionalString(SignFlag, "S", "key-id", "Sign the commit using GPG. If no key-id is provided the key-id is taken from 'user.signingkey' the in the configuration")
ap.SupportsFlag(SkipVerificationFlag, "", "Skip commit verification")
if supportsBranchFlag {
ap.SupportsString(BranchParam, "", "branch", "Commit to the specified branch instead of the current branch.")
}
Expand Down Expand Up @@ -96,6 +97,7 @@ func CreateMergeArgParser() *argparser.ArgParser {
ap.SupportsFlag(NoCommitFlag, "", "Perform the merge and stop just before creating a merge commit. Note this will not prevent a fast-forward merge; use the --no-ff arg together with the --no-commit arg to prevent both fast-forwards and merge commits.")
ap.SupportsFlag(NoEditFlag, "", "Use an auto-generated commit message when creating a merge commit. The default for interactive CLI sessions is to open an editor.")
ap.SupportsString(AuthorParam, "", "author", "Specify an explicit author using the standard A U Thor {{.LessThan}}author@example.com{{.GreaterThan}} format.")
ap.SupportsFlag(SkipVerificationFlag, "", "Skip commit verification before merge")

return ap
}
Expand All @@ -116,6 +118,7 @@ func CreateRebaseArgParser() *argparser.ArgParser {
ap.SupportsFlag(AbortParam, "", "Abort an interactive rebase and return the working set to the pre-rebase state")
ap.SupportsFlag(ContinueFlag, "", "Continue an interactive rebase after adjusting the rebase plan")
ap.SupportsFlag(InteractiveFlag, "i", "Start an interactive rebase")
ap.SupportsFlag(SkipVerificationFlag, "", "Skip commit verification before rebase")
return ap
}

Expand Down Expand Up @@ -190,6 +193,7 @@ func CreateCherryPickArgParser() *argparser.ArgParser {
ap.SupportsFlag(AllowEmptyFlag, "", "Allow empty commits to be cherry-picked. "+
"Note that use of this option only keeps commits that were initially empty. "+
"Commits which become empty, due to a previous commit, will cause cherry-pick to fail.")
ap.SupportsFlag(SkipVerificationFlag, "", "Skip commit verification before cherry-pick")
ap.TooManyArgsErrorFunc = func(receivedArgs []string) error {
return errors.New("cherry-picking multiple commits is not supported yet.")
}
Expand Down Expand Up @@ -227,6 +231,7 @@ func CreatePullArgParser() *argparser.ArgParser {
ap.SupportsString(UserFlag, "", "user", "User name to use when authenticating with the remote. Gets password from the environment variable {{.EmphasisLeft}}DOLT_REMOTE_PASSWORD{{.EmphasisRight}}.")
ap.SupportsFlag(PruneFlag, "p", "After fetching, remove any remote-tracking references that don't exist on the remote.")
ap.SupportsFlag(SilentFlag, "", "Suppress progress information.")
ap.SupportsFlag(SkipVerificationFlag, "", "Skip commit verification before merge")
return ap
}

Expand Down
1 change: 1 addition & 0 deletions go/cmd/dolt/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const (
SilentFlag = "silent"
SingleBranchFlag = "single-branch"
SkipEmptyFlag = "skip-empty"
SkipVerificationFlag = "skip-verification"
SoftResetParam = "soft"
SquashParam = "squash"
StagedFlag = "staged"
Expand Down
4 changes: 4 additions & 0 deletions go/cmd/dolt/commands/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ func constructParametrizedDoltCommitQuery(msg string, apr *argparser.ArgParseRes
writeToBuffer("--skip-empty")
}

if apr.Contains(cli.SkipVerificationFlag) {
writeToBuffer("--skip-verification")
}

cfgSign := cliCtx.Config().GetStringOrDefault("sqlserver.global.gpgsign", "")
if apr.Contains(cli.SignFlag) || strings.ToLower(cfgSign) == "true" {
writeToBuffer("--gpg-sign")
Expand Down
4 changes: 4 additions & 0 deletions go/cmd/dolt/commands/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ func constructInterpolatedDoltMergeQuery(apr *argparser.ArgParseResults, cliCtx
params = append(params, msg)
}

if apr.Contains(cli.SkipVerificationFlag) {
writeToBuffer("--skip-verification", false)
}

if !apr.Contains(cli.AbortParam) && !apr.Contains(cli.SquashParam) {
writeToBuffer("?", true)
params = append(params, apr.Arg(0))
Expand Down
17 changes: 16 additions & 1 deletion go/gen/fb/serial/workingset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions go/libraries/doltcore/cherry_pick/cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type CherryPickOptions struct {
// and Dolt cherry-pick implementations, the default action is to fail when an empty commit is specified. In Git
// and Dolt rebase implementations, the default action is to keep commits that start off as empty.
EmptyCommitHandling doltdb.EmptyCommitHandling

// SkipVerification controls whether test validation should be skipped before creating commits.
SkipVerification bool
}

// NewCherryPickOptions creates a new CherryPickOptions instance, filled out with default values for cherry-pick.
Expand All @@ -61,6 +64,7 @@ func NewCherryPickOptions() CherryPickOptions {
CommitMessage: "",
CommitBecomesEmptyHandling: doltdb.ErrorOnEmptyCommit,
EmptyCommitHandling: doltdb.ErrorOnEmptyCommit,
SkipVerification: false,
}
}

Expand Down Expand Up @@ -159,9 +163,10 @@ func CreateCommitStagedPropsFromCherryPickOptions(ctx *sql.Context, options Cher
}

commitProps := actions.CommitStagedProps{
Date: originalMeta.Time(),
Name: originalMeta.Name,
Email: originalMeta.Email,
Date: originalMeta.Time(),
Name: originalMeta.Name,
Email: originalMeta.Email,
SkipVerification: options.SkipVerification,
}

if options.CommitMessage != "" {
Expand Down
12 changes: 10 additions & 2 deletions go/libraries/doltcore/doltdb/workingset.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type RebaseState struct {
// rebasingStarted is true once the rebase plan has been started to execute. Once rebasingStarted is true, the
// value in lastAttemptedStep has been initialized and is valid to read.
rebasingStarted bool
// skipVerification indicates whether test validation should be skipped during rebase operations.
skipVerification bool
}

// Branch returns the name of the branch being actively rebased. This is the branch that will be updated to point
Expand Down Expand Up @@ -120,6 +122,10 @@ func (rs RebaseState) WithRebasingStarted(rebasingStarted bool) *RebaseState {
return &rs
}

func (rs RebaseState) SkipVerification() bool {
return rs.skipVerification
}

type MergeState struct {
// the source commit
commit *Commit
Expand Down Expand Up @@ -322,13 +328,14 @@ func (ws WorkingSet) StartMerge(commit *Commit, commitSpecStr string) *WorkingSe
// the branch that is being rebased, and |previousRoot| is root value of the branch being rebased. The HEAD and STAGED
// root values of the branch being rebased must match |previousRoot|; WORKING may be a different root value, but ONLY
// if it contains only ignored tables.
func (ws WorkingSet) StartRebase(ctx *sql.Context, ontoCommit *Commit, branch string, previousRoot RootValue, commitBecomesEmptyHandling EmptyCommitHandling, emptyCommitHandling EmptyCommitHandling) (*WorkingSet, error) {
func (ws WorkingSet) StartRebase(ctx *sql.Context, ontoCommit *Commit, branch string, previousRoot RootValue, commitBecomesEmptyHandling EmptyCommitHandling, emptyCommitHandling EmptyCommitHandling, skipVerification bool) (*WorkingSet, error) {
ws.rebaseState = &RebaseState{
ontoCommit: ontoCommit,
preRebaseWorking: previousRoot,
branch: branch,
commitBecomesEmptyHandling: commitBecomesEmptyHandling,
emptyCommitHandling: emptyCommitHandling,
skipVerification: skipVerification,
}

ontoRoot, err := ontoCommit.GetRootValue(ctx)
Expand Down Expand Up @@ -549,6 +556,7 @@ func newWorkingSet(ctx context.Context, name string, vrw types.ValueReadWriter,
emptyCommitHandling: EmptyCommitHandling(dsws.RebaseState.EmptyCommitHandling(ctx)),
lastAttemptedStep: dsws.RebaseState.LastAttemptedStep(ctx),
rebasingStarted: dsws.RebaseState.RebasingStarted(ctx),
skipVerification: dsws.RebaseState.SkipVerification(ctx),
}
}

Expand Down Expand Up @@ -646,7 +654,7 @@ func (ws *WorkingSet) writeValues(ctx context.Context, db *DoltDB, meta *datas.W

rebaseState = datas.NewRebaseState(preRebaseWorking.TargetHash(), dCommit.Addr(), ws.rebaseState.branch,
uint8(ws.rebaseState.commitBecomesEmptyHandling), uint8(ws.rebaseState.emptyCommitHandling),
ws.rebaseState.lastAttemptedStep, ws.rebaseState.rebasingStarted)
ws.rebaseState.lastAttemptedStep, ws.rebaseState.rebasingStarted, ws.rebaseState.skipVerification)
}

return &datas.WorkingSetSpec{
Expand Down
116 changes: 108 additions & 8 deletions go/libraries/doltcore/env/actions/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
package actions

import (
"fmt"
"io"
"strings"
"time"

gms "github.com/dolthub/go-mysql-server"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/dolt/go/libraries/doltcore/diff"
Expand All @@ -25,14 +29,42 @@ import (
)

type CommitStagedProps struct {
Message string
Date time.Time
AllowEmpty bool
SkipEmpty bool
Amend bool
Force bool
Name string
Email string
Message string
Date time.Time
AllowEmpty bool
SkipEmpty bool
Amend bool
Force bool
Name string
Email string
SkipVerification bool
}

const (
// System variable name, defined here to avoid circular imports
DoltCommitVerificationGroups = "dolt_commit_verification_groups"
)

// GetCommitRunTestGroups returns the test groups to run for commit operations
// Returns empty slice if no tests should be run, ["*"] if all tests should be run,
// or specific group names if only those groups should be run
func GetCommitRunTestGroups() []string {
_, val, ok := sql.SystemVariables.GetGlobal(DoltCommitVerificationGroups)
if !ok {
return nil
}
if stringVal, ok := val.(string); ok && stringVal != "" {
if stringVal == "*" {
return []string{"*"}
}
// Split by comma and trim whitespace
groups := strings.Split(stringVal, ",")
for i, group := range groups {
groups[i] = strings.TrimSpace(group)
}
return groups
}
return nil
}

// GetCommitStaged returns a new pending commit with the roots and commit properties given.
Expand Down Expand Up @@ -114,10 +146,78 @@ func GetCommitStaged(
}
}

if !props.SkipVerification {
testGroups := GetCommitRunTestGroups()
if len(testGroups) > 0 {
err := runCommitVerification(ctx, testGroups)
if err != nil {
return nil, err
}
}
}

meta, err := datas.NewCommitMetaWithUserTS(props.Name, props.Email, props.Message, props.Date)
if err != nil {
return nil, err
}

return db.NewPendingCommit(ctx, roots, mergeParents, props.Amend, meta)
}

func runCommitVerification(ctx *sql.Context, testGroups []string) error {
type sessionInterface interface {
sql.Session
GenericProvider() sql.MutableDatabaseProvider
}

session, ok := ctx.Session.(sessionInterface)
if !ok {
return fmt.Errorf("session does not provide database provider interface")
}

provider := session.GenericProvider()
engine := gms.NewDefault(provider)

return runTestsUsingDtablefunctions(ctx, engine, testGroups)
}

// runTestsUsingDtablefunctions runs tests using the dtablefunctions package against the staged root
func runTestsUsingDtablefunctions(ctx *sql.Context, engine *gms.Engine, testGroups []string) error {
Comment on lines +184 to +185
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(minor) This name confused me for a minute... something like "runTestsUsingDoltTestRun" might be more self describing, instead of including the Go package where the table function is stored.

if len(testGroups) == 0 {
return nil
}

var allFailures []string

for _, group := range testGroups {
query := fmt.Sprintf("SELECT * FROM dolt_test_run('%s')", group)
_, iter, _, err := engine.Query(ctx, query)
if err != nil {
return fmt.Errorf("failed to run dolt_test_run for group %s: %w", group, err)
}

for {
row, rErr := iter.Next(ctx)
if rErr == io.EOF {
break
}
if rErr != nil {
return fmt.Errorf("error reading test results: %w", rErr)
}

// Extract status (column 3)
status := fmt.Sprintf("%v", row[3])
if status != "PASS" {
testName := fmt.Sprintf("%v", row[0])
message := fmt.Sprintf("%v", row[4])
allFailures = append(allFailures, fmt.Sprintf("%s (%s)", testName, message))
}
}
}

if len(allFailures) > 0 {
return fmt.Errorf("commit verification failed: %s", strings.Join(allFailures, ", "))
}

return nil
}
Loading
Loading