Skip to content

feat(mount id): Support custom mount ID and rationalize only-dir early - #4991

Merged
abhishek10004 merged 6 commits into
masterfrom
abhishek/update_mount_id
Aug 5, 2026
Merged

abhishek10004 merged 6 commits into
masterfrom
abhishek/update_mount_id

Conversation

@abhishek10004

@abhishek10004 abhishek10004 commented Aug 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR introduces support for specifying a custom Mount ID to be included in mount instance id and refactors only-dir path rationalization so that it is normalized early during configuration processing.

Key Changes

1. Custom Mount ID Support in Logs

  • Configuration: Added mount-id (mountId) support to the command-line flags and configuration parameters.
  • Mount Instance ID Generation: Updated MountInstanceID in internal/logger to combine fsName, an auto-generated UUID, and an optional custom ID (<fsName>-<customID>-<uuid> when configured, or <fsName>-<uuid> when empty).
  • Loggers: Updated log file initialization (InitLogFile), default logger updates (UpdateDefaultLogger), and legacy fuse loggers (NewLegacyLogger) to accept and attach the custom mount ID attribute (gcsfuse-mount-id).

2. Early Rationalization of only-dir

  • Configuration Rationalization: Added resolveOnlyDir in cfg/rationalize.go to sanitize and normalize OnlyDir early (removing leading/trailing slashes and resolving relative segments like ..).
  • Downstream Simplification: Removed redundant path trimming and sanitization from cmd/legacy_main.go, internal/gcsx/bucket_manager.go, and internal/storage/storage_handle.go.

Testing

  • Added unit tests for MountInstanceID formatting with and without customID (internal/logger/logger_test.go).
  • Added unit tests for resolveOnlyDir sanitization edge cases (cfg/rationalize_test.go).

Link to the issue in case of a bug fix.

b/535703440

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

@abhishek10004
abhishek10004 requested a review from a team as a code owner August 4, 2026 15:32
@abhishek10004
abhishek10004 requested a review from geertj August 4, 2026 15:32
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Aug 4, 2026

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

Copy link
Copy Markdown
Contributor

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 mount-id configuration option to append a custom identifier to the mount ID in logs, and normalizes the OnlyDir path configuration to clean relative paths. The reviewer feedback highlights two main issues: first, cfg/config.go is an auto-generated file and should not be modified manually; second, the implementation of fsName in cmd/legacy_main.go needs to be more robust to handle leading/trailing slashes and GKE environments correctly to avoid duplicate path segments.

Comment thread cfg/config.go Resolved
Comment thread cmd/legacy_main.go Resolved
@abhishek10004 abhishek10004 changed the title feat(logger feat(logger): Support custom mount ID, include only-dir in fsName and rationalize only-dir early Aug 4, 2026
Comment thread cfg/params.yaml Resolved
@abhishek10004 abhishek10004 changed the title feat(logger): Support custom mount ID, include only-dir in fsName and rationalize only-dir early feat(logger): Support custom mount ID and rationalize only-dir early Aug 5, 2026
@abhishek10004 abhishek10004 changed the title feat(logger): Support custom mount ID and rationalize only-dir early feat(mount id): Support custom mount ID and rationalize only-dir early Aug 5, 2026
Comment thread cfg/rationalize_test.go Resolved
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.78%. Comparing base (20de2f9) to head (18ee26d).

Files with missing lines Patch % Lines
cmd/legacy_main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4991      +/-   ##
==========================================
- Coverage   83.79%   83.78%   -0.02%     
==========================================
  Files         173      173              
  Lines       21316    21318       +2     
==========================================
- Hits        17862    17861       -1     
- Misses       2774     2776       +2     
- Partials      680      681       +1     
Flag Coverage Δ
unittests 83.78% <78.57%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@abhishek10004
abhishek10004 enabled auto-merge (squash) August 5, 2026 10:59
@abhishek10004
abhishek10004 merged commit 05c5292 into master Aug 5, 2026
21 checks passed
@meet2mky
meet2mky deleted the abhishek/update_mount_id branch August 5, 2026 11:19
kislaykishore pushed a commit that referenced this pull request Aug 9, 2026
#4991)

Adding support for specifying a custom Mount ID to be included in mount instance id and refactors only-dir path rationalization so that it is normalized early during configuration processing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants

⌂ 换网址