databricks-cli/internal
Pieter Noordhuis 23f05f5d67
Set the write bit for files written during template initialization (#2068)
## Changes

This used to work because the permission bits for built-in templates
were hardcoded to 0644 for files and 0755 for directories.

As of #1912 (and the PRs it depends on), built-in templates are no
longer pre-materialized to a temporary directory and read directly from
the embedded filesystem. This built-in filesystem returns 0444 as the
permission bits for the files it contains. These bits are carried over
to the destination filesystem.

This change updates template materialization to always set the owner's
write bit. It doesn't really make sense to write read-only files and
expect users to work with these files in a VCS (note: Git only stores
the executable bit).

The regression shipped as part of v0.235.0 and will be fixed as of
v0.238.0.

## Tests

Unit tests.
2025-01-08 13:18:28 +00:00
..
bugbash Fixed downloading arm64 binaries (#2021) 2024-12-16 17:34:22 +01:00
build Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
mocks Rewrite 'interface{} -> any' (#1959) 2024-12-05 15:37:24 +00:00
testcli Improve test output to include correct location (#2058) 2025-01-02 10:49:21 +01:00
testutil Set the write bit for files written during template initialization (#2068) 2025-01-08 13:18:28 +00:00