Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer package:file, package:file_testing #598

Merged
merged 217 commits into from
Oct 4, 2024
Merged

Conversation

devoncarew
Copy link
Member

@devoncarew devoncarew commented Oct 4, 2024

  • move and fix workflow files
  • enable 'Allow merge commits' in GitHub settings; merge the PR with 'Create a merge commit'; disable 'Allow merge commits'
  • push tags to GitHub using git tag --list 'file*' | xargs git push origin
  • follow up with a PR adding links to the top-level readme table
  • transfer issues by running dart run pkgs/repo_manage/bin/report.dart transfer-issues --source-repo dart-lang/file --target-repo dart-lang/tools --add-label package:file --apply-changes
  • update the auto-publishing settings on pub.dev/packages/file
  • add a commit to https://github.com/dart-lang/file/ with it's readme pointing to the monorepo
  • archive https://github.com/dart-lang/file/

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

matanlurey and others added 30 commits January 30, 2016 19:31
Add README, fix c9.sh.

Checkpoint.

Initial new pass.

Override.
feat: sync file system; more tests; stricter code analysis
feat: allow sharing backing store across in-memory file systems
* v.next interface for package:file/file.dart

This changes the interface to chiefly expose the FileSystem
abstraction and deal in native dart:io types where at all possible:

- Expose all dart:io file-system static methods as instance methods
  on `FileSystem`, to allow injectable implementations (e.g. in-memory,
  local, mock, etc.)
- Create FileSystemEntity, File, Directory, Link as abstract classes
  that implement their native counterparts and add any extra methods
  we choose in this library (initially, only `get fileSystem => Filesystem`)

By going this route, it implies that each FileSystem implementation will
need to provide types that implement both the sync and async APIs (since
they implement the interfaces in native dart:io). However, I still plan
to provide SynchronousFileSystem & AsynchronousFileSystem, which will simply
throw UnsupportedError for the APIs they don't support.

This change will allow existing libraries/apps to seamlessly start using
FileSystem as a drop-in replacement for existing direct dart:io usage.
This implements most of the in-memory file system. The only
part that's not complete is memory_file.dart. The rest of the impl,
plus tests, will follow for both the in-memory implementation and
the local backend in an upcoming change.
This completes the implementation of the in-memory FileSystem
backend. Next change will add tests.
- Add stub tests for Directory. Please review for coverage;
  impl will come later
- Rename tests to follow common pattern
- Fix some cases where we weren't matching the behavior of
  dart:io libraries
Move memory tests to common tests.

This change prepares us to be able to run all file system
tests against multiple implementations of the interface.
The goal is to be able to test the local file system impl
against all tests, and run the exact same tests against
the in-memory impl, thus ensuring (a) the in-memory impl
has test coverage, and (b) that it behaves identical in
its API to the local dart:io variant.

This change does not touch any code - just restructures
things.
This change uses conditional imports to support browser-based
Dart usage of this package. For non-VM users, this will export
the subset of the dart:io interface that is required by this
package, whereas VM users will simply get dart:io itself.
…ile#21)

These classes will also be the basis of a ChrootFileSystem,
which is forthcoming.
- Add ChrootFileSystem.
- Wire up local_test.dart to use it
While the original intent of ChrootFileSystem was inspired by the
idea that we could use it to test LocalFileSystem (chroot'ed to a
tmp folder), it turns out that ChrootFileSystem adds too much
abstraction and gets in the way of actually testing LocalFileSystem.

ChrootFileSystem is still valuable in its own right, but this change
updates local_test.dart to test LocalFileSystem without the need
for ChrootFileSystem, by factoring common_tests.dart to accept a
root folder argument and do all its work in that folder.
jamesderlin and others added 20 commits May 12, 2023 13:52
* Make `FileSystem.isLink` actually work

`FileSystem.isLink` called `FileSystem.type` with the default
argument of `followLinks: true`.  This is obviously wrong since it
would mean that `isLink` would never return true (except maybe for
broken symbolic links).

Make `FileSystem.isLink` use `followLinks: false`.  This is what
`dart:io`'s `FileSystemEntity.isLink` is documented to do.

Partially addresses https://github.com/google/file.dart/issues/8.

* Reorganize isFile/isDirectory/isLink tests

Reorganize the isFile/isDirectory/isLink tests so that the test names
are more appropriate.
…g/file#213)

* Fix MemoryFileSystem to treat an empty path as non-existent

`_MemoryFileSystem.findNode` returns `reference?.directory` if given
the root path or an empty path.  However, an empty path should
be treated as non-existent, not as a directory.  Instead explicitly
return `null` as a special case when given an empty path.

Partially addresses https://github.com/google/file.dart/issues/198.

* Make _MemoryFileSystem._current nullable
Route stream errors to the stream completer rather than the file completer.

Fixes dart-lang/file#219
…int>> again (dart-lang/file#217)

* Make MemoryFile.openRead and _ChrootFile.openRead return Stream<List<int>> again

This is equivalent to dart-archive/file.dart#168,
but I foolishly neglected to make corresponding changes for all
file system types.

Fixes https://github.com/google/file.dart/issues/193.

* Apply suggestions from natebosch

Co-authored-by: Nate Bosch <[email protected]>

---------

Co-authored-by: Nate Bosch <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@8e5e7e5...f43a0e5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/dart-lang/setup-dart/releases)
- [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md)
- [Commits](dart-lang/setup-dart@d6a63da...b64355a)

---
updated-dependencies:
- dependency-name: dart-lang/setup-dart
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@f43a0e5...b4ffde6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.2.
- [Release notes](https://github.com/dart-lang/setup-dart/releases)
- [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md)
- [Commits](dart-lang/setup-dart@b64355a...fedb126)

---
updated-dependencies:
- dependency-name: dart-lang/setup-dart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@b4ffde6...9bb5618)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9bb5618...0ad4b8f)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.2 to 1.6.4.
- [Release notes](https://github.com/dart-lang/setup-dart/releases)
- [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md)
- [Commits](dart-lang/setup-dart@fedb126...f0ead98)

---
updated-dependencies:
- dependency-name: dart-lang/setup-dart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@0ad4b8f...a5ac7e5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.4 to 1.6.5.
- [Release notes](https://github.com/dart-lang/setup-dart/releases)
- [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md)
- [Commits](dart-lang/setup-dart@f0ead98...0a8a0fc)

---
updated-dependencies:
- dependency-name: dart-lang/setup-dart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@a5ac7e5...692973e)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@692973e...d632683)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions github-actions bot added the type-infra A repository infrastructure change or enhancement label Oct 4, 2024
Copy link

google-cla bot commented Oct 4, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

github-actions bot commented Oct 4, 2024

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Package publish validation ✔️
Package Version Status
package:cli_config 0.2.1-wip WIP (no publish necessary)
package:coverage 1.9.2 already published at pub.dev
package:extension_discovery 2.1.0 already published at pub.dev
package:file 7.0.1-wip WIP (no publish necessary)
package:file_testing 3.0.1-wip WIP (no publish necessary)
package:graphs 2.3.3-wip WIP (no publish necessary)
package:mime 2.0.0 already published at pub.dev
package:oauth2 2.0.4-wip WIP (no publish necessary)
package:source_map_stack_trace 2.1.3-wip WIP (no publish necessary)
package:unified_analytics 6.1.4 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@devoncarew devoncarew merged commit acc440e into main Oct 4, 2024
18 of 20 checks passed
@devoncarew devoncarew deleted the merge-file-package branch October 4, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-coverage-check type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.