Skip to content

feat(consistent symlink): changes for CreateSymlink flow for updated representation#4424

Merged
anushka567 merged 4 commits intomasterfrom
create-symlink-changes
Mar 16, 2026
Merged

feat(consistent symlink): changes for CreateSymlink flow for updated representation#4424
anushka567 merged 4 commits intomasterfrom
create-symlink-changes

Conversation

@anushka567
Copy link
Copy Markdown
Member

@anushka567 anushka567 commented Mar 2, 2026

Description

This PR implements the creation phase of the updated GCS symlink representation in GCSFuse to align with the standard used by other GCS clients like Storage Transfer Service (STS) . When enabled via a flag, new symlinks will be created as GCS objects where the target path is stored in the object content and marked with the standard metadata key goog-reserved-file-is-symlink: true .

Context: go/sts-consistent-symlink-handling-in-gcsfuse

Link to the issue in case of a bug fix.

b/488952518

Testing details

  1. Manual - Yes.
  2. Unit tests - Included.
  3. Integration tests - Automated.

Any backward incompatible change? If so, please explain.

No.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.30%. Comparing base (632897e) to head (ee858ec).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4424       +/-   ##
===========================================
+ Coverage        0   83.30%   +83.30%     
===========================================
  Files           0      163      +163     
  Lines           0    19997    +19997     
===========================================
+ Hits            0    16659    +16659     
- Misses          0     2718     +2718     
- Partials        0      620      +620     
Flag Coverage Δ
unittests 83.30% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anushka567 anushka567 force-pushed the create-symlink-changes branch from 0b8f1cd to 4287bf6 Compare March 16, 2026 08:28
@anushka567 anushka567 added execute-integration-tests-on-zb To run E2E tests on zonal bucket. execute-integration-tests Run only integration tests labels Mar 16, 2026
@anushka567 anushka567 marked this pull request as ready for review March 16, 2026 08:34
@anushka567 anushka567 requested a review from a team as a code owner March 16, 2026 08:34
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to how GCSFuse handles symlink creation, moving towards a standardized representation that is compatible with other Google Cloud Storage clients. The change allows symlink targets to be stored directly in the object content and marked with a specific metadata key, improving interoperability and consistency across GCS services. This new behavior is opt-in via a configuration flag, ensuring backward compatibility while enabling future-proof symlink management.

Highlights

  • Standard Symlink Representation: Implemented the creation phase for a new standard GCS symlink representation, aligning GCSFuse with other GCS clients like Storage Transfer Service (STS). When enabled via a flag, new symlinks will store their target path in the object content and be marked with the goog-reserved-file-is-symlink: true metadata key.
  • Configurable Symlink Behavior: Introduced a new configuration flag, ExperimentalEnableStandardSymlinks, to control whether the new standard symlink representation is used during creation. This allows for a gradual rollout and testing of the new behavior.
  • Object Creation API Update: Modified the createNewObject function to accept content, enabling symlink targets to be stored directly within the GCS object's content when using the standard representation.
  • New Test Coverage: Added a new unit test, TestCreateChildSymlink_StandardSymlinkEnabled, to verify the correct creation and metadata handling of symlinks using the new standard representation.
Changelog
  • internal/fs/inode/dir.go
    • Added isStandardSymlinkRepresentationEnabled boolean field to the dirInode struct.
    • Updated NewDirInode to initialize isStandardSymlinkRepresentationEnabled from cfg.ExperimentalEnableStandardSymlinks.
    • Modified createNewObject function signature to include a content parameter.
    • Updated calls to createNewObject in CreateChildFile, CreateChildSymlink, and CreateChildDir to pass appropriate content.
    • Implemented conditional logic within CreateChildSymlink to use either the legacy gcsfuse_symlink_target metadata or the new goog-reserved-file-is-symlink: true metadata with target in content, based on the isStandardSymlinkRepresentationEnabled flag.
  • internal/fs/inode/dir_test.go
    • Added TestCreateChildSymlink_StandardSymlinkEnabled test case to validate the creation of symlinks using the new standard representation, including checks for metadata and content.
  • internal/fs/inode/symlink.go
    • Defined a new constant StandardSymlinkMetadataKey with the value goog-reserved-file-is-symlink.
Activity
  • No activity (comments, reviews) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for creating symlinks using the standard GCS representation, controlled by the experimental-enable-standard-symlinks flag. The changes correctly modify the CreateChildSymlink flow to store the symlink target in the object's content and set the goog-reserved-file-is-symlink: true metadata key. The changes are logical and include a new unit test to verify the creation logic.

However, a critical piece of functionality is missing: the logic to read and identify these new symlinks is not implemented. Specifically, inode.IsSymlink and inode.NewSymlinkInode are not updated to handle the new format. This means that while gcsfuse can create these symlinks, it cannot recognize them when they are read back from GCS (e.g., during a directory listing or file lookup on a cold cache). They will be incorrectly treated as regular files.

I've added a comment to the new unit test suggesting an extension that would expose this issue. Addressing this is crucial for the feature to be complete and usable.

Comment thread internal/fs/inode/dir_test.go
@anushka567 anushka567 changed the base branch from flag-for-symlink to master March 16, 2026 08:45
@anushka567 anushka567 force-pushed the create-symlink-changes branch from 4287bf6 to ee858ec Compare March 16, 2026 08:49
Comment thread internal/fs/inode/symlink.go
@anushka567 anushka567 merged commit d724e63 into master Mar 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consistent-symlink-support execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants