| Age | Commit message (Collapse) | Author |
|
PlatformRepository::initialize() (php-version/extension detection) was
never invoked: the RepositoryInterface impl delegated straight to the
inner ArrayRepository without the ensure_initialized lazy-init guard
that sibling repositories (FilesystemRepository, PathRepository) use.
As a result pool.what_provides("php") was always empty, and any
package requiring php failed platform resolution. Also fixes the
trait search() bypassing PlatformRepository's own SEARCH_VENDOR
override.
|
|
PathRepository already implements RepositoryInterface and create_repository
already handles the "path" class, so the prior ignore reason no longer
applies; verify the FilterRepository/PathRepository wrapping via
RepositoryInterfaceHandle::is/downcast_rc.
|
|
Port testNoPluginsDisablesPluginsWhenScriptCommandsExist and
testScriptCommandTakesPriorityOverAbbreviatedBuiltinCommand. Both stay
#[ignore]d because do_run panics at the script-registration todo!()
(application.rs:2461) when composer.json has scripts. Add a test-only
ApplicationHandle::__get_composer accessor so the first test's
getPluginManager assertions can be expressed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Wire a git downloader into the test's DownloadManager (mirroring
Factory::createDownloadManager) so the archive path clones the package
source as PHP does. Both remain #[ignore]'d on PharData tar archiving
(new_with_format/build_from_iterator are todo!() in the php-shim).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The faithful port drives a real HttpDownloader + Loop over a file://
dist URL, but RemoteFilesystem::get_remote_contents is a phase-c stub
returning None, so the download fails with a "could not be downloaded"
TransportException before reaching the ZipArchive "is not a zip
archive" path. Kept #[ignore] with the corrected reason (the previous
curl_multi_init note was wrong, file:// never uses curl).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
These three tests exercise getContents/copy against a file:// URL (and a
real network download for BitBucket). They remain #[ignore] because
get_remote_contents has no stream/file layer yet (TODO(phase-c)) and
returns None, so the calls raise a TransportException. The ignore
reasons are updated to reflect the actual failure point.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port testVendorDirExcludedFromWorkingDir, testUpLevelRelativePaths,
testGeneratesPlatformCheck (all 12 data-provider rows), and both
testAbsoluteSymlinkWith* tests from the Composer suite.
testVendorDirExcludedFromWorkingDir passes. The other four expose
behavioral gaps in shirabe (exclude-from-classmap with up-level/symlink
paths, psr-4 symlink warnings, get_platform_check provider matching), so
they keep their fully-ported bodies but are marked #[ignore] with the
specific incompatibility rather than weakening expectations.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add a minimal shirabe-php-rpc crate that spawns the system PHP as a
child process and asks it for runtime information over a Unix domain
socket, then use it to fill the `--version` PHP line with the real
\PHP_VERSION and \PHP_BINARY instead of fixed placeholder values.
See docs/dev/php-rpc.md for the design and scope.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Model Git::runCommand's mixed $commandOutput parameter with the
RunCommandOutput trait (one impl per PHP mode: discard, by-ref capture,
callable handler), mirroring ProcessExecutor's IntoExecOutput. This moves
the is_callable($commandOutput) value-inspection into the type system and
drops the dependency on the shim's incomplete is_callable.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Give DirectoryIteratorEntry a backing path (mirroring
RecursiveIteratorFileInfo) and make directory_iterator enumerate entries,
returning Result to match PHP DirectoryIterator's UnexpectedValueException
on an unopenable directory. Wire the new Result through DumpCompletionCommand's
get_supported_shells.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the two todo!() placeholders by passing self.inner.io.clone()
to VcsDriverBase::new and Forgejo::new, matching the PHP source's
$this->io arguments and the GitHub/GitLab driver idiom.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
StringInput inherits __toString from ArgvInput in PHP; mirror that with a
Display impl delegating to its inner ArgvInput, and use it in
GlobalCommand::input_to_string.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the remaining todo! in update_requirements_after_resolution by
passing the stability-flags rewriter closure to Locker::update_hash,
porting the static closure from RequireCommand.php.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port AuditCommand::getPackages's non-locked path: build an
InstalledRepository from the local repository and return its packages,
filtered by RootPackage requires when --no-dev is set. The prior
TODO(phase-c) assumption (InstalledRepository::new vs get_local_repository
type mismatch) no longer holds since both sides use RepositoryInterfaceHandle.
Enables the two previously ignored audit command tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
It is faithful to PHP's by-value array/string semantics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The `!@json_decode($children)` guards in addSubNode/removeSubNode were
translated as `is_null() || as_bool() == Some(false)`, which drops PHP's
other falsy cases (empty array/string, "0", 0). At the removeSubNode site
(assoc=true) this diverged from Composer: an empty object node decodes to
an empty array, which PHP treats as falsy and aborts on, but the Rust
guard kept going. Replace both with php_truthy, the faithful rendering of
PHP `!`, preserving the deliberate empty-`{}` behavior difference between
the assoc=false (addSubNode) and assoc=true (removeSubNode) sites.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Auditor::audit took io as &mut dyn IOInterface, forcing the audit and
installer post-audit call sites to hold a borrow_mut() on the shared IO
RefCell for the whole call. During advisory fetching the repositories
write to their own clones of the same handle, so the borrow_mut()
collided with their borrow() and panicked with 'RefCell already mutably
borrowed' on 'audit --locked'. Take the Rc<RefCell<dyn IOInterface>>
handle instead so writes borrow briefly and never overlap. Un-ignore the
locked-audit regression test that this unblocks.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Validate JSON syntax with serde_json's parse errors in JsonFile, and detect
duplicate keys in ConfigValidator with a hand-written serde visitor, dropping
the now-unused JsonParser/Lexer/DuplicateKeyException ports. ParsingException
is kept as the thrown error type and downcast signal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add a no_banned_use linter that forbids importing anyhow::Result, and
update all call sites to reference it via its fully-qualified path so
it is never confused with std::result::Result.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The platform: section is empty because PlatformRepository::get_packages
routes to ArrayRepository::initialize instead of its own initialize, which
needs the still-todo!() runtime::constant() shim. Record the real blocker.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
flattenRepositories must recurse into InstalledRepository (which extends
CompositeRepository in PHP) and ShowCommand must unwrap FilterRepository
when categorizing repos. Without this, installed/locked/platform packages
all fell through to the "available" bucket, dropping the version column
and per-section grouping. Un-ignores 10 show_command tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
execute_batch only awaited prepare(), leaving the install/update/
uninstall + cleanup + repo.write promise chain as a todo!() stub, so
packages were downloaded to cache but never installed into the target
directory. Wire the operation step (mirroring PHP's promise chain),
propagate errors from the install/update/uninstall wrappers instead of
swallowing them with .ok()?, and write the repo after each op.
Un-ignore the create-project functional tests and the install/remove
command tests this unblocks. The remaining --no-install case still fails
on a separate install-path bug; its ignore reason is updated to match.
|
|
Port composer/tests/Composer/Test/InstallerTest.php. testInstaller (the
provideInstaller cases) is fully ported and passes; the three integration
tests port doTestIntegration in full (the .test fixture loader, FactoryMock,
the in-process console Application with install/update commands, and the
PHPUnit assertStringMatchesFormat matcher) and remain #[ignore]'d since the
install pipeline is not yet executable end-to-end.
Add test-only `__`-seams to the concrete types the test depends on, since
their consumers (e.g. Locker takes the concrete InstallationManager) and the
subclass-style mocks have no trait to mock: InstallationManager (recording
mock + as_any), Factory (__create_mock), VersionGuesser, and
InstalledFilesystemRepository. The production path (mock: false) is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implements the todo!() stubs in all_functional_test.rs by faithfully
porting parseTestFile, cleanOutput and the inline %regex% EXPECT matcher,
plus a subprocess runner that drives CARGO_BIN_EXE_shirabe (in place of
PHP's composer.phar) over the reused Fixtures/functional .test files.
The five fixtures are wired as individual #[serial] #[ignore] tests with
per-fixture reasons: the two create-project cases need network + a real
git clone, and the three update cases need the not-yet-implemented Plugin
API. test_build_phar stays an ignored stub since Rust has no phar build.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the todo!() with the PHP_PATH and PHP_PEAR_PHP_BIN env-var
fallbacks and the trailing PATH-based php lookup. The \PHP_BINARY/
\PHP_SAPI branch and the \PHP_BINDIR seed dir are skipped since the
shim does not model the running PHP interpreter, but the final lookup
still resolves php via PATH with empty extra dirs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The CurlDownloader owned a tokio runtime and block_on'd reqwest from its
sync tick(), while the repository/installer/downloader sync bridges each
created another Runtime and block_on'd async fns that reach that leaf.
Driving one Runtime::block_on from within another panics with "Cannot
start a runtime from within a runtime", hit by `require` when fetching
p2 metadata.
Switch CurlDownloader to a blocking reqwest client (its own internal
thread, never nested) and replace the per-call Runtime::new().block_on
bridges with a no-reactor sync_executor::block_on helper. No awaited
future parks on a reactor once the only async I/O is blocking, so the
helper can be nested freely.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The structural methods are inherited from ArrayRepository in PHP, where
the lazy package load is driven by the overridden initialize(). Without
virtual dispatch, each repository now ensures that load via a &self
ensure_initialized() before delegating to the inner ArrayRepository.
This required moving the repositories' lazily-populated state behind
interior mutability (RefCell/Cell) and adding &self find_package_internal
/find_packages_internal helpers on ArrayRepository.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
JsonFormatter is intentionally unported in crates/shirabe/src/json, so
the ignored todo!() stub test serves no purpose. Remove the file and its
module declaration.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Replace the todo!() markTestSkipped placeholders in set_up with a
compile-time cfg gate on the test function, mirroring PHP's setUp
skips on Windows and 32bit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace hand-written mock/stub structs that re-implemented PHPUnit
mock-builder behavior (record-and-verify, manual call counters,
unreachable!() guards) with mockall::mock! locals across:
- package/loader: MockLoader, VersionGuesserMock
- command: ArchiveManager/RepositoryManager/EventDispatcher mocks
- util: ConfigSource/AuthJson mocks (auth_helper, bitbucket, github,
forgejo, gitlab)
- repository/vcs: github_driver NullConfigSource
- installer: CountingInstaller, RecordingBinaryInstaller, and the
DownloadManager mock (formerly common/downloader_stub.rs, now deleted)
- downloader: download_manager create_downloader_mock
Verification (counts/args) now lives in mockall expectations checked on
drop. installation_manager BinaryInstaller is left hand-written because
its as_binary_presence_interface seam returns Some(&mut self), which
mockall cannot express; io_stub and io_mock are left as-is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the four privateBitbucketWithOauthProvider cases that were
stubbed as an ignored todo!(). Extend IOStub with per-question
askAndHideAnswer responses and auth pre-seeding so the stateful OAuth
flow can be driven without willReturnCallback, and inject a mock
HttpDownloader plus no-op config sources to mirror PHPUnit's Config mock.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the previously-ignored test, which dumps installed.php via
FilesystemRepository::write and byte-matches the Composer fixture. The
package link setters needed by configureLinks are now reachable through
the __set_provides/__set_replaces test hatches, so the PHP getPackage +
configureLinks shape can be reproduced faithfully.
Also switch both InstallationManager stubs in this file to a single
mockall mock, replacing the hand-rolled impls and call counter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP var_export breaks NUL bytes out of single-quoted string literals as
`' . "\0" . '` because a raw NUL byte is invalid in PHP source. The
shim embedded the raw byte instead, diverging from Composer's generated
installed.php (where references can contain NUL).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
setCatchErrors is an old-Symfony compatibility shim that exists in
neither Composer's PHP class nor Shirabe, and setAutoExit(false) is the
default in Shirabe, so neither is a reason a test is unportable. Drop
those mentions and point the application_test ignores at the real
blocker: do_run's script-command registration is still a todo!().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add __base_application accessor on ApplicationHandle so the test can
build an ApplicationDescription the way console commands do.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Process::fromShellCommandline and ZipArchive are now ported, so the git
pipeline + zip reading have faithful equivalents. Kept #[ignore]d: the finder
applies .gitattributes rules through BaseExcludeFilter::generate_pattern,
whose (?=$|/) look-ahead regexes the regex crate cannot compile (same blocker
as test_manual_excludes); also needs a git executable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Ported faithfully via PackageHandle::new + __set_extra (now available on
PackageHandle). Kept #[ignore]d: date-based cases expose a shirabe_semver
normalize divergence (v20121020 -> 20121020.0.0.0), not a test-port issue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The FilesystemMock seam (already used by FileDownloaderTest) intercepts
removeDirectoryAsync before any rm -rf, so the prior execute_async blocker
no longer applies. getDownloaderMock gains the optional filesystem param.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The IOMock and ConfigStubBuilder helpers now cover the writeError
verification and the get('disable-tls')=>true stub the PHP test needs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The IOMock helper is now available, so the verify_peer/verify_peer_name
SSL warning case can be exercised instead of left as todo!().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Replace the todo!() stub with a faithful port of StatusCommandTest's
data-provided locally-modified-packages cases (source/dist), kept
#[ignore]d since install does not yet populate vendor/ offline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|