From 77fdd523554e18abc3a834bbd52527f015bc4aa8 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Fri, 22 May 2026 10:43:48 +0300 Subject: Add VyOSElasticModernHost + placeholder engine stub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Host class mirrors PhabricatorElasticsearchHost's surface. Engine is a stub providing only getEngineIdentifier() and getHostType() so the host's tests can construct an engine instance; real engine implementation lands in subsequent commits. All six abstract methods of PhabricatorFulltextStorageEngine are implemented (four as throwing stubs to be replaced in E7/E8). .arcconfig gains "src/" in the load list so arc unit can discover the extension library; test case extends PhutilTestCase (no DB needed for pure-PHP host property assertions). 🤖 Generated by [robots](https://vyos.io) --- .../VyOSElasticModernFulltextStorageEngine.php | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/engine/VyOSElasticModernFulltextStorageEngine.php (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php new file mode 100644 index 0000000..d10bac7 --- /dev/null +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -0,0 +1,40 @@ + Date: Fri, 22 May 2026 10:52:57 +0300 Subject: H1: Apply code-quality fixes from review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Engine class marked final (matches host class declaration; no design intent to subclass). - testConfigOverrides now also asserts host and port (these were the most-likely-to-be-misconfigured fields; previously set but unverified). 🤖 Generated by [robots](https://vyos.io) --- src/__tests__/VyOSElasticModernHostTestCase.php | 2 ++ src/engine/VyOSElasticModernFulltextStorageEngine.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') diff --git a/src/__tests__/VyOSElasticModernHostTestCase.php b/src/__tests__/VyOSElasticModernHostTestCase.php index 1c5ef95..80b82c2 100644 --- a/src/__tests__/VyOSElasticModernHostTestCase.php +++ b/src/__tests__/VyOSElasticModernHostTestCase.php @@ -30,6 +30,8 @@ final class VyOSElasticModernHostTestCase 'path' => '/myphorge', 'version' => 8, )); + $this->assertEqual('es.example.com', $host->getHost()); + $this->assertEqual(9200, $host->getPort()); $this->assertEqual('https', $host->getProtocol()); $this->assertEqual('/myphorge', $host->getPath()); $this->assertEqual(8, $host->getVersion()); diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php index d10bac7..755bc2d 100644 --- a/src/engine/VyOSElasticModernFulltextStorageEngine.php +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -4,7 +4,7 @@ * Placeholder for the engine class. Real implementation grows in Phase 3-4. * Tasks E1-E8 replace the throwing stubs below with working code. */ -class VyOSElasticModernFulltextStorageEngine +final class VyOSElasticModernFulltextStorageEngine extends PhabricatorFulltextStorageEngine { public function getEngineIdentifier() { -- cgit v1.2.3 From 5e97aa48c13f75537915018754339b2336f14c1a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 09:59:41 +0000 Subject: H1: keep placeholder engine undiscoverable --- src/__tests__/VyOSElasticModernHostTestCase.php | 17 +++++++++++++---- src/engine/VyOSElasticModernFulltextStorageEngine.php | 6 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') diff --git a/src/__tests__/VyOSElasticModernHostTestCase.php b/src/__tests__/VyOSElasticModernHostTestCase.php index 80b82c2..a727a94 100644 --- a/src/__tests__/VyOSElasticModernHostTestCase.php +++ b/src/__tests__/VyOSElasticModernHostTestCase.php @@ -1,10 +1,19 @@ assertTrue($class->isAbstract()); + } + public function testDisplayName() { - $engine = new VyOSElasticModernFulltextStorageEngine(); + $engine = new VyOSElasticModernHostTestEngine(); $host = new VyOSElasticModernHost($engine); $this->assertEqual( 'Elasticsearch (modern)', @@ -12,7 +21,7 @@ final class VyOSElasticModernHostTestCase } public function testConfigDefaults() { - $engine = new VyOSElasticModernFulltextStorageEngine(); + $engine = new VyOSElasticModernHostTestEngine(); $host = new VyOSElasticModernHost($engine); $host->setConfig(array()); $this->assertEqual('http', $host->getProtocol()); @@ -21,7 +30,7 @@ final class VyOSElasticModernHostTestCase } public function testConfigOverrides() { - $engine = new VyOSElasticModernFulltextStorageEngine(); + $engine = new VyOSElasticModernHostTestEngine(); $host = new VyOSElasticModernHost($engine); $host->setConfig(array( 'host' => 'es.example.com', @@ -38,7 +47,7 @@ final class VyOSElasticModernHostTestCase } public function testGetURI() { - $engine = new VyOSElasticModernFulltextStorageEngine(); + $engine = new VyOSElasticModernHostTestEngine(); $host = new VyOSElasticModernHost($engine); $host->setConfig(array( 'host' => 'es.example.com', diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php index 755bc2d..f11eeab 100644 --- a/src/engine/VyOSElasticModernFulltextStorageEngine.php +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -1,10 +1,10 @@