| Age | Commit message (Collapse) | Author |
|
Empty PhpMixed::Array now serializes as [], so the several places that build a
PHP `new \stdClass` via an empty Array were emitting [] where Composer writes
{}. Use PhpMixed::Object for those empty-object cases:
- InitCommand: require / require-dev
- Locker::fixupJsonDataType: stability-flags / platform / platform-dev
- JsonConfigSource fallback: require/config keys that must stay objects
Align the affected test expectations with Composer: JsonFile::read() decodes
with assoc=true, collapsing the on-disk {} back to [], so reads expect [].
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP heredocs drop the newline before the closing marker, so a two-blank-line
fragment must port to "\n\n", not "\n\n\n", and the static initializer needs a
"\n" after the $initializer placeholder. This makes autoload_real.php and
autoload_static.php byte-identical to Composer's output. Rewrite the templates
as raw strings mirroring the PHP heredocs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP arrays do not distinguish an empty map from an empty list, and
json_encode([]) always emits []. The Serialize impl emitted {} for an
empty associative array, which diverged from Composer when computing
the lock file content-hash for a composer.json with an empty require.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Several tests read process-global env vars and set/clear them via
TearDown but were not #[serial], so parallel execution could race.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port 11 categories of previously-ignored Composer tests now reachable with
the mockall crate: DownloadManager, VCS/Perforce/File downloaders,
VersionSelector, PlatformRepository, Auditor, installer/FilesystemRepository,
RootPackageLoader, util auth/http, commands, and Cache.
Extract test seams additively on concrete structs as *Interface traits
(Runtime, HhvmDetector, VersionGuesser, RepositorySet, Perforce,
BinaryInstaller) plus mock-field seams (Cache, Filesystem); consumers take
trait objects. Mocks are defined locally in the test crates via
mockall::mock!, since automock-generated mocks are cfg(test)-gated and
invisible across the integration-test boundary.
dataProviders are ported in full; tests blocked by unported shims stay
#[ignore] with documented reasons rather than reduced or weakened.
Fix product bugs surfaced by the ports:
- util/github: use the exception code, not the HTTP status, for 401/403
- advisory: serialize empty audit maps as [] to match PHP json_encode
- repository/filesystem and downloader/file: fix RefCell double-borrow panics
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Three porting mismatches caused show/info output to diverge from PHP:
- "not found" hint appended " in /composer.json" whenever the
working-dir key existed; PHP uses isset(), which is false for the
null default. Now only appended when the value is non-null.
- printPackages and generatePackageTree inserted "" for a missing
description instead of null, so isset() rendered a spurious trailing
space (and JSON emitted "" instead of null). Both now preserve null.
Un-ignores the eight rendering-gap tests these fix (plus one already
passing), and rewrites the remaining ignore reasons to name the real
blocker (package categorization, --no-dev filtering, RefCell borrow,
installer resolution) instead of a stale generic message.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The jsonschema crate reports a missing required property against its
parent object, leaving the instance path empty at the root. This skipped
the "PROPERTY : MESSAGE" formatting that Composer produces. Append the
missing property name to the path so the output shape matches.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Composer/PartialComposer exposed its RepositoryManager, InstallationManager,
EventDispatcher, Locker, DownloadManager, AutoloadGenerator and ArchiveManager
as concrete types, but Composer's public setters (setDownloadManager() etc.)
let plugins swap in subclasses. Introduce a *Interface trait per manager and
store each as Rc<RefCell<dyn ...Interface>> so a replacement is honored.
Only Composer's slots and the sinks fed from its accessors become trait
objects; managers injected concretely at construction keep their concrete
references, matching PHP semantics. Fluent setters on the affected classes now
return () and Locker::update_hash is de-generified to a boxed FnOnce so the
traits stay object-safe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
|
|
The ApplicationTester harness is in place, so port the four command
test bodies that were todo!() stubs and replace the stale "requires
ApplicationTester ... not implemented" ignore reasons with the actual
remaining Phase-C blockers. test_install_command_errors now passes;
the rest stay #[ignore] pending installer registration, the update
command InputDefinition, and the InstallationManager::execute port.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
file_put_contents_if_modified held a filesystem borrow_mut() receiver
while its argument re-borrowed the same RefCell via dump_to_php_code(),
panicking with "RefCell already borrowed". Build the file contents
before taking the borrow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
getMissingRequirementInfo created an empty InstalledRepository (both
repos were left commented out as a stub), so every locked requirement
was reported as "not present in the lock file". Pass [lockedRepo,
rootRepo] to the constructor as the PHP does.
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 compiler confirms none of the call sites invoke a &mut self method
on the returned Composer, so the exclusive RefMut borrow was never
needed and only risked borrow check conflict. Switch every site to the
shared composer_full borrow and drop the now-dead composer_full_mut
helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Holding a RefMut<Composer> across execute() conflicted with the shared
borrow taken inside EventDispatcher::get_script_listeners, panicking with
"RefCell already mutably borrowed". All accessors used here take &self, so
a shared borrow suffices.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
The cli_tests suite runs the real CLI; under a TTY Composer's do_run logic
keeps interaction enabled, so `init` blocks on stdin. Holding the #[serial]
mutex while blocked made later tests (e.g. audit) appear to time out.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Matches the SymfonyStyle fix: ConsoleOutput is the sole ConsoleOutputInterface
implementor, so the instanceof check reduces to an AsAny downcast. get_error_output
now resolves correctly for non-console outputs instead of hitting todo!().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
ShowCommand::configure registered an empty set_definition (placeholder), so every
show invocation failed with option/argument-does-not-exist. Port the full
argument/option list (package, version, --all/--locked/--installed/--platform/
--available/--self/--tree/--latest/--outdated/--format/... ) from PHP
ShowCommand::configure. Completion-suggestion closures and the format allowed-value
list are dropped to match the current InputArgument/InputOption API.
Un-ignores 14 ShowCommandTest cases; the remaining 28 keep faithful bodies but
stay ignored (show-rendering output gaps and remote-HTTP paths), reasons updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PRE_POOL_CREATE todo
RemoveCommand::execute held composer_full_mut across deactivate_installed_plugins
and event dispatch, both of which re-enter the same RefCell (composer.rs:500/446);
it only uses &self getters, so borrow it immutably.
PoolBuilder dispatched PluginEvents::PRE_POOL_CREATE by building an event that
required moving the (unclonable) repositories/Request — left as todo!(). The
event is purely plugin-facing and its result is never read in the no-plugin path
(Pool::new reads self.packages directly), so skip it with a TODO(plugin) note.
Removes the composer.rs re-entrancy and two todo!()s from the remove install
path; remove's tests now reach the unregistered-installers blocker (factory.rs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
execute nested the already-built InstalledRepository inside a second
InstalledRepository, tripping the assertion that an InstalledRepository may not
contain another. PHP adds a PlatformRepository to the existing composite via
addRepository; do the same.
Un-ignores CheckPlatformReqsCommandTest::test_failed_platform_requirement.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
show/remove/global/audit/check-platform-reqs/status/self-update/validate tests
Faithfully port the remaining stubbed command test bodies from their PHP
counterparts (expected values verbatim). Newly passing: remove (6), global (2),
check-platform-reqs (1), status (1), audit (1), self-update (1).
Tests whose ported bodies reach a genuine unported src path keep faithful bodies
but stay #[ignore] with precise reasons. Dominant blockers surfaced:
- ShowCommand::configure stub (empty set_definition) blocks all 42 show tests
- Composer-handle RefCell re-entrancy in the Installer (composer.rs:500) and
Factory::create_composer (composer.rs:446) paths
- check_platform_reqs nests InstalledRepository in InstalledRepository
- audit's non-locked branch (audit_command.rs:285) and write_error3 re-entrancy
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
style
is_console_output_interface downcasts dyn OutputInterface to the concrete
ConsoleOutput (the sole ConsoleOutputInterface implementor) via AsAny, mirroring
the existing ConsoleSectionOutput check. create_table now passes the customized
TableStyle directly through StyleName::Style instead of discarding it.
Un-ignores LicensesCommandTest::test_format_summary.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
These no-longer-panic after the table/command chokepoint fixes; diagnose and
require still panic and stay ignored.
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 Table helper modeled a row's cells as PhpMixed and recovered the concrete
TableCell/TableSeparator types via runtime instance_of, leaving the entire
mixed/array bridge (to_row_vec, cell_colspan, row_get, ...) as todo!(). Replace
that with proper Row/Cell enums:
Row = HeaderDivider | Separator(TableSeparator) | Cells(Vec<Cell>)
Cell = Null | Value(String) | Cell(TableCell) | Separator(TableSeparator)
The internal header/body boundary that PHP detects by object identity
($divider === $row) becomes the dedicated Row::HeaderDivider variant. Style
arguments (PHP string|TableStyle) become a StyleName enum, so Table::new no
longer panics in resolve_style's instance_of stub; TableStyle derives Clone so
named styles resolve from the registry.
PhpMixed-based callers (SymfonyStyle::table, render_table, auditor's sanitize)
bridge via From<PhpMixed> for Cell/Row at the boundary.
Un-ignores LicensesCommandTest text-format cases (4) and
BaseDependencyCommandTest::why; output matches PHP exactly. Removes ~15 impl
todo!()s in the Table helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Unblocked by the Config::merge list-form repositories fix.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Compiled Rust never loads a class by name, so the registered callback is dropped.
Return success so callers that register an autoloader during startup can proceed.
Kept the TODO(phase-d) comment: this is an unblocking stub, not a faithful
implementation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
execute only calls &self getters on the Composer, but borrowed it via
composer_full_mut. The held RefMut deadlocked the re-entrant shared borrow
taken by EventDispatcher::dispatch -> get_script_listeners ->
PartialComposerHandle::borrow_partial, panicking on every invocation.
Un-ignores all 12 DumpAutoloadCommandTest cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
RepositoryCommand's JSON-arg detection used the un-delimited regex r"^\s*\{";
the PHP source is the delimited '{^\s*\{}', which compile_php_pattern requires.
Config::merge only extracted repositories from PhpMixed::Array; a JSON array
decodes to PhpMixed::List (an array with integer keys in PHP) and was silently
dropped. Handle List by mapping to integer string keys.
Un-ignores all 10 remaining RepositoryCommandTest cases (16/16 pass).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Faithfully port repository, base_dependency, exec, dump_autoload, run_script,
licenses command tests from their PHP counterparts (expected values verbatim).
Newly passing: repository (6), base_dependency (5), exec (2). Tests whose ported
bodies hit a genuine unported path (HTTP/curl, event-dispatch re-entrancy,
spl_autoload_register, php_uname, instance_of, un-delimited Preg patterns,
Config::merge dropping list repos) keep faithful bodies but stay #[ignore] with
precise reasons; no assertions weakened.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
testSearch (HTTP layer)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Discovered via a full --include-ignored run: these tests have real (non-stub)
bodies and pass now, either because their blocker was since implemented (e.g.
config_command's stream_set_blocking via libc) or the ignore was stale.
Covers composer, config, forgejo_url, config_command, default_policy,
transaction, installed_repository, github_driver, version_bumper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Override OperationInterface::get_package for Install/Uninstall/MarkAlias*
operations so trait-object dispatch no longer hits the default todo!(), and
implement Rule::is_caused_by_lock's locked-repository lookup via
Request::get_locked_repository (LockArrayRepository::get_packages is infallible).
Change PackageInterface::get_type to return String (matching PHP getType():
string) so AliasPackage can delegate live to its aliasOf handle across the
RefCell instead of an impossible &str borrow.
Un-ignores 25 SolverTest cases; 2 alias cases stay ignored pending a real
solver alias-resolution discrepancy.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The stashed binary_installer port was blocked on posix_getpwuid (reached via
Platform::is_virtual_box_guest); implement it via getpwuid(3) extern "C". The
4 install-and-exec tests now pass with the stream I/O and Process cwd fixes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add create_installed_json/create_composer_lock test helpers. Port command (8),
repository path/forgejo/perforce/vcs (11), and fossil/hg/download_manager (13)
tests. Fix production porting bugs: root_package_loader/forgejo_url/version_bumper
regex delimiters, repository_manager create_repository_by_class, array_loader
isset, licenses_command RefCell borrow; implement disk_free_space and
touch2/touch3 via libc.
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 fcntl/select extern "C" declarations and a PhpResource::raw_fd seam so the
symfony Process pipe loop can read a live child's stdout/stderr. Fix fread on a
non-blocking fd (WouldBlock -> "") and the Process null-cwd default. Real
subprocess output capture now works; un-ignore the process_executor tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port command (9), util gitlab/forgejo/tls (6), package (6), repository (3)
tests. Implement TlsHelper. Fix porting bugs: config_command extra merge,
RootAliasPackage setters, ValidatingArrayLoader isset, repository_factory name
generation, forgejo exception code, version_parser error chaining.
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 the libcurl-shim CurlDownloader with a reqwest+tokio implementation per
the .ken sketch, resolving the construction panic that blocked command tests
(mock path via __new_mock is untouched). Port remote_filesystem (7), hg/svn
driver (4), zip_archiver/git_exclude_filter (4) tests. Fix hg/svn/git_exclude
regex-delimiter and svn result-propagation porting bugs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port autoload_generator (24), bitbucket (14), suggested_packages (11),
git_driver (6), archive_manager (3), and a bump command test. Fix the
ApplicationTester output-capture root cause (php://memory streams must be
readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE
'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable
scalars; fix preg_quote angle-bracket escaping and class-map parser regexes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port auth_helper (14), library_installer (8), console_io (7), zip_downloader (3),
git_bitbucket_driver (3) tests. Implement date_create/strtotime for the ISO8601/
RFC3339/relative formats Composer uses (unknown input -> None, no silent guess).
Fix production bugs: Question::is_assoc list-vs-assoc, auth_helper gitlab-domains
list handling, LibraryInstaller RefCell double-borrow, ZipArchive::extract_to
ErrorException propagation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port perforce (36), locker (10), composer_repository (7), installation_manager
(6), file_downloader (5), and event_dispatcher (6) tests via the mock infra.
Fix production porting bugs surfaced en route: BufferIO::get_output look-behind
regex, ComposerRepository list-form package iteration and initialize dispatch,
gethostname and spl_autoload_functions shims; add EventDispatcher get_listeners
test seam.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port git, version_guesser, gitlab_driver, github_driver, and git_downloader
tests using the ProcessExecutor/HttpDownloader mocks and IO/Config stubs.
Fix production regex-porting bugs surfaced by the now-reachable paths:
Url::sanitize and Response::find_header_value had non-delimited PCRE patterns;
implement array_search_mixed non-strict branch and a datetime format mapping.
Add HttpDownloader::__new_mock so mocked downloaders skip curl construction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|