dolthub / dolthub/dolt

Separate directory creation concern from `GetAbsRemoteUrl`

Open
#10,127 0 comments 0 reactions 0 assignees View on GitHub
version control
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

The `getAbsFileRemoteUrl` function in `remotes.go` creates missing directories when processing file:// remote URLs. This side-effect is inappropriate for a URL normalization function. Removing this behavior breaks multiple tests that depend on the implicit directory creation, including clone operations, fetch operations, and remote management commands.
```
not ok 145 auto_increment: newly cloned database
not ok 378 clone-drop: clone a database and then drop it
not ok 378 clone-drop: sql-server: clone a database and then drop it
not ok 908 fetch: fetch --prune deletes remote refs not on remote
not ok 913 fetch: fetching from empty remote
not ok 1751 merge: setting DOLT_AUTHOR_DATE and DOLT_COMMITTER_DATE
not ok 1856 nonlocal: remote ref
not ok 2041 remotes-file-system: Add a file system remote with a bad path
not ok 2081 remotes-push-pull: pull with DOLT_AUTHOR_DATE and DOLT_COMMITER_DATE doesn't overwrite commit timestamps
not ok 2168 remotes: fetch --prune deletes remote refs not on remote
not ok 2236 replication: commit --amend
not ok 2334 shallow-clone: shallow clone with a file path
not ok 2335 shallow-clone: fast forward merge
not ok 2335 shallow-clone: simple merge
not ok 2335 shallow-clone: no-op merge
not ok 2335 shallow-clone: push to a new remote should error
not ok 2604 sql-fetch: fetch --prune deletes remote refs not on remote
TestDoltCheckout
TestDoltCheckoutPrepared
```

Directory creation should be handled explicitly by callers or through a separate function. For example, `dolt_backup.go` currently relies on `PrepareDB` to create directories for file:// URLs ([pr](https://github.com/dolthub/dolt/pull/10110/files#r2558499295)).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in remotes.go at getAbsFileRemoteUrl and trace the callers that currently depend on its implicit directory creation. Read dolt_backup.go and PrepareDB, then run the listed clone, fetch, remote, and checkout tests. Done means directory creation is handled explicitly rather than by URL normalization, with those operations still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.