Skip to content

add fileSystemType - #331

Open
mcakircali wants to merge 2 commits into
developfrom
feature/FDB-738-nfs-support
Open

add fileSystemType#331
mcakircali wants to merge 2 commits into
developfrom
feature/FDB-738-nfs-support

Conversation

@mcakircali

@mcakircali mcakircali commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/eckit/pull-requests/PR-331

@codecov-commenter

codecov-commenter commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.46809% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.64%. Comparing base (7f792f3) to head (8d8ec81).

Files with missing lines Patch % Lines
tests/filesystem/test_localpathname.cc 76.00% 6 Missing ⚠️
src/eckit/filesystem/LocalPathName.cc 61.53% 5 Missing ⚠️
tests/filesystem/test_filespace_strategies.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #331      +/-   ##
===========================================
+ Coverage    67.58%   67.64%   +0.05%     
===========================================
  Files         1182     1183       +1     
  Lines        61862    62123     +261     
  Branches      4675     4680       +5     
===========================================
+ Hits         41810    42021     +211     
- Misses       20052    20102      +50     

☔ 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.

Copilot AI 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.

🟡 Changes recommended

The new fileSystemType() implementation/test behaviour is inconsistent across supported platforms (notably FreeBSD/unsupported OS paths) and can lead to failing tests or silent “unknown” results where an error is expected.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a new fileSystemType() query to LocalPathName/PathName (plumbed through BasePathName/BasePathNameT) and introduces tests to validate the returned filesystem type and error behaviour.

Changes:

  • Add fileSystemType() to the PathName/LocalPathName public APIs and propagate it through the BasePathName polymorphic layer.
  • Implement LocalPathName::fileSystemType() using statfs() (Linux magic-to-name mapping; macOS via f_fstypename).
  • Add/adjust filesystem tests and update a filesystem test fake to include the new method.
File summaries
File Description
tests/filesystem/test_localpathname.cc Adds a test case for fileSystemType() behaviour and error handling.
tests/filesystem/test_filespace_strategies.cc Updates FakeFileSystem with a stub fileSystemType() to satisfy the new API surface.
src/eckit/filesystem/PathName.h Declares PathName::fileSystemType() with documentation.
src/eckit/filesystem/PathName.cc Implements PathName::fileSystemType() by delegating to the underlying BasePathName.
src/eckit/filesystem/LocalPathName.h Declares LocalPathName::fileSystemType() with documentation.
src/eckit/filesystem/LocalPathName.cc Implements LocalPathName::fileSystemType() via statfs() and adds Linux filesystem magic mapping.
src/eckit/filesystem/BasePathName.h Extends the BasePathName interface with pure-virtual fileSystemType().
src/eckit/filesystem/BasePathNameT.h Adds the fileSystemType() override to BasePathNameT.
src/eckit/filesystem/BasePathNameT.cc Implements BasePathNameT<T>::fileSystemType() by delegating to T.
Review details

Suppressed comments (2)

src/eckit/filesystem/LocalPathName.cc:940

  • fileSystemType() currently only calls statfs() on Linux/macOS. On FreeBSD this will fall through to the unsupported-platform branch even though statfs() is available, and the new test would fail there. Consider enabling the statfs() implementation for FreeBSD as well.
#if defined(__linux__) || defined(__APPLE__)

src/eckit/filesystem/LocalPathName.cc:965

  • On unsupported platforms this returns the literal string "unknown", which contradicts the header contract (documents an error) and makes missing/invalid paths silently succeed. It should fail explicitly (e.g. NotImplemented) when the filesystem cannot be interrogated on this platform.
#else
    return "unknown";
#endif
  • Files reviewed: 9/9 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/eckit/filesystem/LocalPathName.cc Outdated
Comment thread tests/filesystem/test_localpathname.cc Outdated
Comment thread src/eckit/filesystem/LocalPathName.h
Comment thread src/eckit/filesystem/PathName.h
improve fileSystemType

improve test fileSystemType

test real nfs if found
@mcakircali
mcakircali force-pushed the feature/FDB-738-nfs-support branch from 4d1e8b2 to 74b90ce Compare September 3, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants