Set the write bit for files written during template initialization#2068
Merged
Set the write bit for files written during template initialization#2068
Conversation
This used to work because the permission bits for builtin templates were hardcoded to 0644 for files and 0755 for directories. As of #1912 (and the PRs it depends on), builtin templates are no longer pre-materialized to a temporary directory and read directly from the embedded filesystem. It turns out that this builtin 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.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
pietern
commented
Jan 2, 2025
shreyas-goenka
approved these changes
Jan 2, 2025
andrewnester
reviewed
Jan 3, 2025
pietern
added a commit
that referenced
this pull request
Jan 8, 2025
Bundles: * Fix finding Python within virtualenv on Windows ([#2034](#2034)). * Include missing field descriptions in JSON schema ([#2045](#2045)). * Add validation for volume referenced from `artifact_path` ([#2050](#2050)). * Handle `${workspace.file_path}` references in source-linked deployments ([#2046](#2046)). * Set the write bit for files written during template initialization ([#2068](#2068)).
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 8, 2025
Bundles: * Fix finding Python within virtualenv on Windows ([#2034](#2034)). * Include missing field descriptions in JSON schema ([#2045](#2045)). * Add validation for volume referenced from `artifact_path` ([#2050](#2050)). * Handle `${workspace.file_path}` references in source-linked deployments ([#2046](#2046)). * Set the write bit for files written during template initialization ([#2068](#2068)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.