Skip to content

feat(consistent symlink): create openReader helper method on symlink inode to read the object contents to decipher target#4432

Merged
anushka567 merged 2 commits intomasterfrom
symlink-inode-read-method
Mar 25, 2026
Merged

feat(consistent symlink): create openReader helper method on symlink inode to read the object contents to decipher target#4432
anushka567 merged 2 commits intomasterfrom
symlink-inode-read-method

Conversation

@anushka567
Copy link
Copy Markdown
Member

@anushka567 anushka567 commented Mar 3, 2026

Description

The PR adds a helper method, openReader, to the SymlinkInode struct to allow reading the content of the backing GCS object . This is necessary because, in the new consistent symlink design, the symlink target is stored as the object's content rather than in custom metadata .

For more context, refer to go/sts-consistent-symlink-handling-in-gcsfuse

Link to the issue in case of a bug fix.

b/489246084

Testing details

  1. Manual - Yes.
  2. Unit tests - Added
  3. Integration tests - NA. Will be covered once implementation is complete.

Any backward incompatible change? If so, please explain.

No.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.73%. Comparing base (1484b06) to head (af5110d).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4432      +/-   ##
==========================================
+ Coverage   83.67%   83.73%   +0.05%     
==========================================
  Files         163      163              
  Lines       20077    20092      +15     
==========================================
+ Hits        16800    16824      +24     
+ Misses       2652     2645       -7     
+ Partials      625      623       -2     
Flag Coverage Δ
unittests 83.73% <100.00%> (+0.05%) ⬆️

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 update-symlink-inode-metadata-attr branch from f31eb44 to 654ab8e Compare March 16, 2026 16:31
@anushka567 anushka567 force-pushed the update-symlink-inode-metadata-attr branch from 654ab8e to fa634a5 Compare March 24, 2026 06:41
@anushka567 anushka567 force-pushed the symlink-inode-read-method branch from 4161d66 to 01f908f Compare March 25, 2026 05:28
@anushka567 anushka567 changed the base branch from update-symlink-inode-metadata-attr to master March 25, 2026 05:30
@anushka567 anushka567 force-pushed the symlink-inode-read-method branch from 01f908f to cb13716 Compare March 25, 2026 05:47
@anushka567 anushka567 force-pushed the symlink-inode-read-method branch from cb13716 to 5c8cc5f Compare March 25, 2026 05:55
@anushka567 anushka567 marked this pull request as ready for review March 25, 2026 06:00
@anushka567 anushka567 requested a review from a team as a code owner March 25, 2026 06:00
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Mar 25, 2026
@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 enhances the SymlinkInode structure by introducing a new openReader helper method. This method is designed to read the content of the GCS object that represents a symlink, which is a critical component for the new consistent symlink design. By storing symlink targets directly within the object's content, this change streamlines how symlink data is accessed and managed, laying the groundwork for more robust symlink functionality.

Highlights

  • Symlink Content Reading: Introduced openReader helper method to SymlinkInode for reading the content of the backing GCS object.
  • Consistent Symlink Design: This change supports the new consistent symlink design where the symlink target is stored as the object's content instead of custom metadata.
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.

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 a new openReader method for SymlinkInode to facilitate reading the target of a symlink from GCS. This method includes specific error handling to detect and wrap gcs.NotFoundError into a gcsfuse_errors.FileClobberedError when a file clobbering scenario is identified. Corresponding internal tests have been added to validate the functionality of openReader, including cases for successful reads and clobbered files. A review comment points out that the error handling logic in openReader involves redundant wrapping, which can lead to verbose and confusing error messages, and suggests a simplification to improve clarity.

Comment thread internal/fs/inode/symlink.go Outdated
@anushka567 anushka567 merged commit 03aeb6c into master Mar 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consistent-symlink-support remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants