Skip to content

Commit aac73a5

Browse files
committed
Merge remote-tracking branch 'origin/main' into contrib
2 parents 1d8045c + 4962aa0 commit aac73a5

File tree

215 files changed

+7448
-3999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+7448
-3999
lines changed

.github/workflows/bump-dependency.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,27 @@ jobs:
173173
174174
if (pull.keepAlive) process.exit(0);
175175
176+
const checkSuiteRes = await github.rest.checks.listSuitesForRef({
177+
owner,
178+
repo,
179+
ref: pull.headRef,
180+
});
181+
182+
if (checkSuiteRes.data) {
183+
for (const suite of checkSuiteRes.data.check_suites) {
184+
console.log("suite id:", suite.id);
185+
console.log("suite app slug:", suite.app.slug);
186+
console.log("suite status:", suite.status);
187+
console.log("suite conclusion:", suite.conclusion);
188+
if (suite.app.slug === "github-actions") {
189+
if (suite.status !== "completed" || suite.conclusion !== "success") {
190+
console.log(`Leaving pr open due to status:${suite.status} conclusion${suite.conclusion}`);
191+
process.exit(0);
192+
}
193+
}
194+
}
195+
}
196+
176197
console.log(`Closing open pr ${pull.number}`);
177198
await github.rest.issues.createComment({
178199
issue_number: pull.number,

.github/workflows/cd-release-pgo.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,26 @@ jobs:
170170
asset_path: go/out/install.sh
171171
asset_name: install.sh
172172
asset_content_type: text/plain
173+
- name: Upload Linux AMD64 RPM
174+
id: upload-linux-amd64-rpm
175+
uses: dolthub/upload-release-asset@v2
176+
env:
177+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
with:
179+
upload_url: ${{ steps.create_release.outputs.upload_url }}
180+
asset_path: go/out/dolt-${{ needs.format-version.outputs.version }}-1.x86_64.rpm
181+
asset_name: dolt-${{ needs.format-version.outputs.version }}-1.x86_64.rpm
182+
asset_content_type: application/zip
183+
- name: Upload Linux ARM64 RPM
184+
id: upload-linux-arm64-rpm
185+
uses: dolthub/upload-release-asset@v2
186+
env:
187+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188+
with:
189+
upload_url: ${{ steps.create_release.outputs.upload_url }}
190+
asset_path: go/out/dolt-${{ needs.format-version.outputs.version }}-1.aarch64.rpm
191+
asset_name: dolt-${{ needs.format-version.outputs.version }}-1.aarch64.rpm
192+
asset_content_type: application/zip
173193

174194
create-windows-msi:
175195
needs: [format-version, create-pgo-release]

.github/workflows/ci-bats-macos.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ jobs:
8989
- name: Install Maven
9090
working-directory: ./.ci_bin
9191
run: |
92-
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz
93-
tar -xf apache-maven-3.9.11-bin.tar.gz
94-
echo "$(pwd)/apache-maven-3.9.11/bin" >> $GITHUB_PATH
92+
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.12-bin.tar.gz
93+
tar -xf apache-maven-3.9.12-bin.tar.gz
94+
echo "$(pwd)/apache-maven-3.9.12/bin" >> $GITHUB_PATH
9595
- name: Install Hadoop
9696
working-directory: ./.ci_bin
9797
run: |

.github/workflows/ci-bats-unix-remote.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ jobs:
7878
if: ${{ env.use_credentials != 'true' }}
7979
working-directory: ./.ci_bin
8080
run: |
81-
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz
82-
tar -xf apache-maven-3.9.11-bin.tar.gz
83-
echo "$(pwd)/apache-maven-3.9.11/bin" >> $GITHUB_PATH
81+
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz
82+
tar -xf apache-maven-3.9.12-bin.tar.gz
83+
echo "$(pwd)/apache-maven-3.9.12/bin" >> $GITHUB_PATH
8484
- name: Install Hadoop
8585
if: ${{ env.use_credentials != 'true' }}
8686
working-directory: ./.ci_bin

.github/workflows/ci-bats-unix.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ jobs:
9494
- name: Install Maven
9595
working-directory: ./.ci_bin
9696
run: |
97-
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz
98-
tar -xf apache-maven-3.9.11-bin.tar.gz
99-
echo "$(pwd)/apache-maven-3.9.11/bin" >> $GITHUB_PATH
97+
curl -LO https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz
98+
tar -xf apache-maven-3.9.12-bin.tar.gz
99+
echo "$(pwd)/apache-maven-3.9.12/bin" >> $GITHUB_PATH
100100
- name: Install Hadoop
101101
working-directory: ./.ci_bin
102102
run: |

go/cmd/dolt/cli/arg_parser_helpers.go

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ func ParseAuthor(authorStr string) (string, string, error) {
4646
return name, email, nil
4747
}
4848

49-
const (
50-
SyncBackupId = "sync"
51-
SyncBackupUrlId = "sync-url"
52-
RestoreBackupId = "restore"
53-
AddBackupId = "add"
54-
RemoveBackupId = "remove"
55-
RemoveBackupShortId = "rm"
56-
)
57-
5849
var branchForceFlagDesc = "Reset {{.LessThan}}branchname{{.GreaterThan}} to {{.LessThan}}startpoint{{.GreaterThan}}, even if {{.LessThan}}branchname{{.GreaterThan}} exists already. Without {{.EmphasisLeft}}-f{{.EmphasisRight}}, {{.EmphasisLeft}}dolt branch{{.EmphasisRight}} refuses to change an existing branch. In combination with {{.EmphasisLeft}}-d{{.EmphasisRight}} (or {{.EmphasisLeft}}--delete{{.EmphasisRight}}), allow deleting the branch irrespective of its merged status. In combination with -m (or {{.EmphasisLeft}}--move{{.EmphasisRight}}), allow renaming the branch even if the new branch name already exists, the same applies for {{.EmphasisLeft}}-c{{.EmphasisRight}} (or {{.EmphasisLeft}}--copy{{.EmphasisRight}})."
5950

6051
// CreateCommitArgParser creates the argparser shared dolt commit cli and DOLT_COMMIT.
@@ -97,6 +88,7 @@ func CreateMergeArgParser() *argparser.ArgParser {
9788
return errors.New("Error: Dolt does not support merging from multiple commits. You probably meant to checkout one and then merge from the other.")
9889
}
9990
ap.SupportsFlag(NoFFParam, "", "Create a merge commit even when the merge resolves as a fast-forward.")
91+
ap.SupportsFlag(FFOnlyParam, "", "Refuse to merge unless the current HEAD is already up to date or the merge can be resolved as a fast-forward.")
10092
ap.SupportsFlag(SquashParam, "", "Merge changes to the working set without updating the commit history")
10193
ap.SupportsString(MessageArg, "m", "msg", "Use the given {{.LessThan}}msg{{.GreaterThan}} as the commit message.")
10294
ap.SupportsFlag(AbortParam, "", "Abort the in-progress merge and return the working set to the state before the merge started.")
@@ -227,6 +219,7 @@ func CreatePullArgParser() *argparser.ArgParser {
227219
ap.ArgListHelp = append(ap.ArgListHelp, [2]string{"remoteBranch", "The name of a branch on the specified remote to be merged into the current working set."})
228220
ap.SupportsFlag(SquashParam, "", "Merge changes to the working set without updating the commit history")
229221
ap.SupportsFlag(NoFFParam, "", "Create a merge commit even when the merge resolves as a fast-forward.")
222+
ap.SupportsFlag(FFOnlyParam, "", "Refuse to merge unless the current HEAD is already up to date or the merge can be resolved as a fast-forward.")
230223
ap.SupportsFlag(ForceFlag, "f", "Update from the remote HEAD even if there are errors.")
231224
ap.SupportsFlag(CommitFlag, "", "Perform the merge and commit the result. This is the default option, but can be overridden with the --no-commit flag. Note that this option does not affect fast-forward merges, which don't create a new merge commit, and if any merge conflicts or constraint violations are detected, no commit will be attempted.")
232225
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.")
@@ -320,6 +313,7 @@ func CreateDiffArgParser(isTableFunction bool) *argparser.ArgParser {
320313
ap.SupportsString(FormatFlag, "r", "result output format", "How to format diff output. Valid values are tabular, sql, json. Defaults to tabular.")
321314
ap.SupportsString(WhereParam, "", "column", "filters columns based on values in the diff. See {{.EmphasisLeft}}dolt diff --help{{.EmphasisRight}} for details.")
322315
ap.SupportsInt(LimitParam, "", "record_count", "limits to the first N diffs.")
316+
ap.SupportsString(FilterParam, "", "diff_type", "filters results based on the type of change (added, modified, renamed, dropped). 'removed' is accepted as an alias for 'dropped'.")
323317
ap.SupportsFlag(StagedFlag, "", "Show only the staged data changes.")
324318
ap.SupportsFlag(CachedFlag, "c", "Synonym for --staged")
325319
ap.SupportsFlag(MergeBase, "", "Uses merge base of the first commit and second commit (or HEAD if not supplied) as the first commit")
@@ -391,36 +385,21 @@ func CreateGlobalArgParser(name string) *argparser.ArgParser {
391385
return ap
392386
}
393387

394-
var awsParams = []string{dbfactory.AWSRegionParam, dbfactory.AWSCredsTypeParam, dbfactory.AWSCredsFileParam, dbfactory.AWSCredsProfile}
388+
var AwsParams = []string{dbfactory.AWSRegionParam, dbfactory.AWSCredsTypeParam, dbfactory.AWSCredsFileParam, dbfactory.AWSCredsProfile}
395389
var ossParams = []string{dbfactory.OSSCredsFileParam, dbfactory.OSSCredsProfile}
396390

397-
func ProcessBackupArgs(apr *argparser.ArgParseResults, scheme, backupUrl string) (map[string]string, error) {
398-
params := map[string]string{}
399-
400-
var err error
401-
switch scheme {
402-
case dbfactory.AWSScheme:
403-
err = AddAWSParams(backupUrl, apr, params)
404-
case dbfactory.OSSScheme:
405-
err = AddOSSParams(backupUrl, apr, params)
406-
default:
407-
err = VerifyNoAwsParams(apr)
408-
}
409-
return params, err
410-
}
411-
412391
func AddAWSParams(remoteUrl string, apr *argparser.ArgParseResults, params map[string]string) error {
413392
isAWS := strings.HasPrefix(remoteUrl, "aws")
414393

415394
if !isAWS {
416-
for _, p := range awsParams {
395+
for _, p := range AwsParams {
417396
if _, ok := apr.GetValue(p); ok {
418397
return fmt.Errorf("%s param is only valid for aws cloud remotes in the format aws://dynamo-table:s3-bucket/database", p)
419398
}
420399
}
421400
}
422401

423-
for _, p := range awsParams {
402+
for _, p := range AwsParams {
424403
if val, ok := apr.GetValue(p); ok {
425404
params[p] = val
426405
}
@@ -450,7 +429,7 @@ func AddOSSParams(remoteUrl string, apr *argparser.ArgParseResults, params map[s
450429
}
451430

452431
func VerifyNoAwsParams(apr *argparser.ArgParseResults) error {
453-
if awsParams := apr.GetValues(awsParams...); len(awsParams) > 0 {
432+
if awsParams := apr.GetValues(AwsParams...); len(awsParams) > 0 {
454433
awsParamKeys := make([]string, 0, len(awsParams))
455434
for k := range awsParams {
456435
awsParamKeys = append(awsParamKeys, k)

go/cmd/dolt/cli/flags.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const (
5353
NoCommitFlag = "no-commit"
5454
NoEditFlag = "no-edit"
5555
NoFFParam = "no-ff"
56+
FFOnlyParam = "ff-only"
5657
NoPrettyFlag = "no-pretty"
5758
NoTLSFlag = "no-tls"
5859
NoJsonMergeFlag = "dont-merge-json"
@@ -99,6 +100,7 @@ const (
99100
SummaryFlag = "summary"
100101
WhereParam = "where"
101102
LimitParam = "limit"
103+
FilterParam = "filter"
102104
MergeBase = "merge-base"
103105
DiffMode = "diff-mode"
104106
ReverseFlag = "reverse"

go/cmd/dolt/commands/admin/journal_inspect.go

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"os"
2020
"path/filepath"
21+
"time"
2122

2223
"github.com/sirupsen/logrus"
2324

@@ -47,7 +48,12 @@ func (cmd JournalInspectCmd) Docs() *cli.CommandDocumentation {
4748
ShortDesc: "Inspect a Dolt journal file and display information about it",
4849
LongDesc: `This tool is intented for debugging Dolt journal files. Since it is intended to debug potentially
4950
corrupted files, it is best run from a location which doesn't attempt to load databases. Ie, go to /tmp, and run
50-
dolt admin journal-inspect /path/to/journal/file`,
51+
dolt admin journal-inspect /path/to/journal/file
52+
53+
When using the --filter-roots or --filter-chunks options, a new journal file will be created next to the original
54+
file with the .filtered extension. This new journal will be identical to the original except that it will not contain
55+
records of the specified type with any of the specified hashes. Multiple hashes can be provided as a comma-separated
56+
list. The two filter options can be used together to filter both root and chunk records.`,
5157
Synopsis: []string{
5258
"<journal-path>",
5359
},
@@ -61,10 +67,12 @@ func (cmd JournalInspectCmd) ArgParser() *argparser.ArgParser {
6167
ap.SupportsFlag("verbose", "v", "Display verbose output during inspection (same as -r -c")
6268
ap.SupportsFlag("crc-scan", "", "Scan invalid sections for valid CRCs. SLOW.")
6369
ap.SupportsFlag("snappy-scan", "", "Scan invalid sections for snappy tags and content headers.")
70+
ap.SupportsString("filter-roots", "", "hashcode1,hashcode2,...", "Create filtered copy of journal excluding the specified root hashes (comma-separated)")
71+
ap.SupportsString("filter-chunks", "", "hashcode1,hashcode2,...", "Create filtered copy of journal excluding the specified chunk hashes (comma-separated)")
6472
return ap
6573
}
6674

67-
func (cmd JournalInspectCmd) Exec(_ context.Context, commandStr string, args []string, dEnv *env.DoltEnv, cliCtx cli.CliContext) int {
75+
func (cmd JournalInspectCmd) Exec(_ context.Context, commandStr string, args []string, _ *env.DoltEnv, _ cli.CliContext) int {
6876
ap := cmd.ArgParser()
6977
usage, _ := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, cli.CommandDocumentationContent{}, ap))
7078
apr := cli.ParseArgsOrDie(ap, args, usage)
@@ -93,6 +101,8 @@ func (cmd JournalInspectCmd) Exec(_ context.Context, commandStr string, args []s
93101

94102
crcScan := apr.Contains("crc-scan")
95103
snappScan := apr.Contains("snappy-scan")
104+
filterRootsStr := apr.GetValueOrDefault("filter-roots", "")
105+
filterChunksStr := apr.GetValueOrDefault("filter-chunks", "")
96106

97107
if _, err := os.Stat(journalPath); os.IsNotExist(err) {
98108
cli.PrintErrln("Error: Journal file does not exist:", journalPath)
@@ -105,6 +115,31 @@ func (cmd JournalInspectCmd) Exec(_ context.Context, commandStr string, args []s
105115
return 1
106116
}
107117

118+
// Handle filter mode
119+
if filterRootsStr != "" || filterChunksStr != "" {
120+
result, exitCode := nbs.JournalFilter(absPath, filterRootsStr, filterChunksStr)
121+
if exitCode != 0 {
122+
return exitCode
123+
}
124+
125+
// Only print shell commands if a filtered file was actually created
126+
if result.OutputPath != "" && result.FilteredRecords > 0 {
127+
// Print shell commands to replace the journal file
128+
now := time.Now()
129+
dateString := now.Format("2006_01_02_150405")
130+
131+
cli.Println("")
132+
cli.Printf("Filtered file: %s\n", result.OutputPath)
133+
cli.Println("")
134+
cli.Println("To replace the original journal file, run these commands:")
135+
cli.Printf("cp %s %s_saved_%s\n", result.OriginalPath, result.OriginalPath, dateString)
136+
cli.Printf("mv %s %s\n", result.OutputPath, result.OriginalPath)
137+
cli.Printf("rm %s\n", filepath.Join(filepath.Dir(result.OriginalPath), "journal.idx"))
138+
}
139+
140+
return 0
141+
}
142+
108143
// JournalInspect returns an exit code. It's entire purpose it to print errors, after all.
109144
return nbs.JournalInspect(absPath, seeRoots, seeChunks, crcScan, snappScan)
110145
}

go/cmd/dolt/commands/assist.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/dolthub/dolt/go/libraries/doltcore/dconfig"
3737
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
3838
"github.com/dolthub/dolt/go/libraries/doltcore/env"
39+
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/overrides"
3940
"github.com/dolthub/dolt/go/libraries/utils/argparser"
4041
)
4142

@@ -581,6 +582,7 @@ func jsonMessage(role string, content string) ([]byte, error) {
581582
}
582583

583584
func getCreateTableStatements(ctx *sql.Context, sqlEngine *engine.SqlEngine, dEnv *env.DoltEnv) (string, error) {
585+
formatter := overrides.SchemaFormatterFromContext(ctx)
584586
sb := strings.Builder{}
585587

586588
root, err := dEnv.WorkingRoot(ctx)
@@ -590,7 +592,7 @@ func getCreateTableStatements(ctx *sql.Context, sqlEngine *engine.SqlEngine, dEn
590592

591593
tables, err := root.GetTableNames(ctx, doltdb.DefaultSchemaName, true)
592594
for _, table := range tables {
593-
_, iter, _, err := sqlEngine.Query(ctx, fmt.Sprintf("SHOW CREATE TABLE %s", sql.QuoteIdentifier(table)))
595+
_, iter, _, err := sqlEngine.Query(ctx, fmt.Sprintf("SHOW CREATE TABLE %s", formatter.QuoteIdentifier(table)))
594596
if err != nil {
595597
return "", err
596598
}

0 commit comments

Comments
 (0)