From c34e5c803be09c898551608cc002ec8da40b4ccb Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 12:30:15 +0100 Subject: [PATCH 1/6] fix: Convert network aliases to string for display The `custom_network_aliases` field was being displayed as an array, which caused rendering issues. This change converts the array to a comma-separated string when syncing from the model to ensure it's displayed correctly in the UI. --- .workspaces/clever-panda-34 | 1 + .workspaces/clever-spartan-8 | 1 + .workspaces/happy-pirate-48 | 1 + templates/service-templates-latest.json | 4 ++-- templates/service-templates.json | 4 ++-- 5 files changed, 7 insertions(+), 4 deletions(-) create mode 160000 .workspaces/clever-panda-34 create mode 160000 .workspaces/clever-spartan-8 create mode 160000 .workspaces/happy-pirate-48 diff --git a/.workspaces/clever-panda-34 b/.workspaces/clever-panda-34 new file mode 160000 index 000000000..c6ae6a6cd --- /dev/null +++ b/.workspaces/clever-panda-34 @@ -0,0 +1 @@ +Subproject commit c6ae6a6cd959711bd74f6db86d23d75e59c7d4ed diff --git a/.workspaces/clever-spartan-8 b/.workspaces/clever-spartan-8 new file mode 160000 index 000000000..dce66c7c3 --- /dev/null +++ b/.workspaces/clever-spartan-8 @@ -0,0 +1 @@ +Subproject commit dce66c7c3dc20c7f55a89bb20372594e914ad40c diff --git a/.workspaces/happy-pirate-48 b/.workspaces/happy-pirate-48 new file mode 160000 index 000000000..c6ae6a6cd --- /dev/null +++ b/.workspaces/happy-pirate-48 @@ -0,0 +1 @@ +Subproject commit c6ae6a6cd959711bd74f6db86d23d75e59c7d4ed diff --git a/templates/service-templates-latest.json b/templates/service-templates-latest.json index dfabce600..4d365b483 100644 --- a/templates/service-templates-latest.json +++ b/templates/service-templates-latest.json @@ -2,7 +2,7 @@ "activepieces": { "documentation": "https://www.activepieces.com/docs/getting-started/introduction?utm_source=coolify.io", "slogan": "Open source no-code business automation.", - "compose": "c2VydmljZXM6CiAgYWN0aXZlcGllY2VzOgogICAgaW1hZ2U6ICdnaGNyLmlvL2F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Z3Jlc3FsL2RhdGEnCiAgICBoZWFsdGhjaGVjazoKICAgICAgdGVzdDoKICAgICAgICAtIENNRC1TSEVMTAogICAgICAgIC0gJ3BnX2lzcmVhZHkgLVUgJCR7UE9TVEdSRVNfVVNFUn0gLWQgJCR7UE9TVEdSRVNfREJ9JwogICAgICBpbnRlcnZhbDogNXMKICAgICAgdGltZW91dDogMjBzCiAgICAgIHJldHJpZXM6IDEwCiAgcmVkaXM6CiAgICBpbWFnZTogJ3JlZGlzOjcuMC43JwogICAgdm9sdW1lczoKICAgICAgLSAncmVkaXNfZGF0YTovZGF0YScKICAgIGhlYWx0aGNoZWNrOgogICAgICB0ZXN0OgogICAgICAgIC0gQ01ECiAgICAgICAgLSByZWRpcy1jbGkKICAgICAgICAtIHBpbmcKICAgICAgaW50ZXJ2YWw6IDVzCiAgICAgIHRpbWVvdXQ6IDIwcwogICAgICByZXRyaWVzOiAxMAo=", "tags": [ "workflow", "automation", @@ -189,7 +189,7 @@ "beszel": { "documentation": "https://github.com/henrygd/beszel?tab=readme-ov-file#getting-started?utm_source=coolify.io", "slogan": "A lightweight server resource monitoring hub with historical data, docker stats, and alerts.", - "compose": "c2VydmljZXM6CiAgYmVzemVsOgogICAgaW1hZ2U6ICdoZW5yeWdkL2Jlc3plbDowLjEyLjEwJwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9VUkxfQkVTWkVMXzgwOTAKICAgIHZvbHVtZXM6CiAgICAgIC0gJ2Jlc3plbF9kYXRhOi9iZXN6ZWxfZGF0YScKICAgICAgLSAnYmVzemVsX3NvY2tldDovYmVzemVsX3NvY2tldCcKICBiZXN6ZWwtYWdlbnQ6CiAgICBpbWFnZTogJ2hlbnJ5Z2QvYmVzemVsLWFnZW50OjAuMTIuMTAnCiAgICB2b2x1bWVzOgogICAgICAtICdiZXN6ZWxfYWdlbnRfZGF0YTovdmFyL2xpYi9iZXN6ZWwtYWdlbnQnCiAgICAgIC0gJ2Jlc3plbF9zb2NrZXQ6L2Jlc3plbF9zb2NrZXQnCiAgICAgIC0gJy92YXIvcnVuL2RvY2tlci5zb2NrOi92YXIvcnVuL2RvY2tlci5zb2NrOnJvJwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTElTVEVOPS9iZXN6ZWxfc29ja2V0L2Jlc3plbC5zb2NrCiAgICAgIC0gJ0hVQl9VUkw9aHR0cDovL2Jlc3plbDo4MDkwJwogICAgICAtICdUT0tFTj0ke1RPS0VOfScKICAgICAgLSAnS0VZPSR7S0VZfScK", + "compose": "c2VydmljZXM6CiAgYmVzemVsOgogICAgaW1hZ2U6ICdoZW5yeWdkL2Jlc3plbDowLjE1LjInCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX1VSTF9CRVNaRUxfODA5MAogICAgdm9sdW1lczoKICAgICAgLSAnYmVzemVsX2RhdGE6L2Jlc3plbF9kYXRhJwogICAgICAtICdiZXN6ZWxfc29ja2V0Oi9iZXN6ZWxfc29ja2V0JwogIGJlc3plbC1hZ2VudDoKICAgIGltYWdlOiAnaGVucnlnZC9iZXN6ZWwtYWdlbnQ6MC4xNS4yJwogICAgdm9sdW1lczoKICAgICAgLSAnYmVzemVsX2FnZW50X2RhdGE6L3Zhci9saWIvYmVzemVsLWFnZW50JwogICAgICAtICdiZXN6ZWxfc29ja2V0Oi9iZXN6ZWxfc29ja2V0JwogICAgICAtICcvdmFyL3J1bi9kb2NrZXIuc29jazovdmFyL3J1bi9kb2NrZXIuc29jazpybycKICAgIGVudmlyb25tZW50OgogICAgICAtIExJU1RFTj0vYmVzemVsX3NvY2tldC9iZXN6ZWwuc29jawogICAgICAtICdIVUJfVVJMPWh0dHA6Ly9iZXN6ZWw6ODA5MCcKICAgICAgLSAnVE9LRU49JHtUT0tFTn0nCiAgICAgIC0gJ0tFWT0ke0tFWX0nCg==", "tags": [ "beszel", "monitoring", diff --git a/templates/service-templates.json b/templates/service-templates.json index 3d49b1620..d711b9d95 100644 --- a/templates/service-templates.json +++ b/templates/service-templates.json @@ -2,7 +2,7 @@ "activepieces": { "documentation": "https://www.activepieces.com/docs/getting-started/introduction?utm_source=coolify.io", "slogan": "Open source no-code business automation.", - "compose": "c2VydmljZXM6CiAgYWN0aXZlcGllY2VzOgogICAgaW1hZ2U6ICdnaGNyLmlvL2FjdGl2ZXBpZWNlcy9hY3RpdmVwaWVjZXM6bGF0ZXN0JwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9GUUROX0FDVElWRVBJRUNFUwogICAgICAtIEFQX0FQSV9LRVk9JFNFUlZJQ0VfUEFTU1dPUkRfNjRfQVBJS0VZCiAgICAgIC0gQVBfRU5DUllQVElPTl9LRVk9JFNFUlZJQ0VfUEFTU1dPUkRfRU5DUllQVElPTktFWQogICAgICAtICdBUF9FTkdJTkVfRVhFQ1VUQUJMRV9QQVRIPSR7QVBfRU5HSU5FX0VYRUNVVEFCTEVfUEFUSDotZGlzdC9wYWNrYWdlcy9lbmdpbmUvbWFpbi5qc30nCiAgICAgIC0gJ0FQX0VOVklST05NRU5UPSR7QVBfRU5WSVJPTk1FTlQ6LXByb2R9JwogICAgICAtICdBUF9FWEVDVVRJT05fTU9ERT0ke0FQX0VYRUNVVElPTl9NT0RFOi1VTlNBTkRCT1hFRH0nCiAgICAgIC0gJ0FQX0ZST05URU5EX1VSTD0ke1NFUlZJQ0VfRlFETl9BQ1RJVkVQSUVDRVN9JwogICAgICAtIEFQX0pXVF9TRUNSRVQ9JFNFUlZJQ0VfUEFTU1dPUkRfNjRfSldUCiAgICAgIC0gJ0FQX1BPU1RHUkVTX0RBVEFCQVNFPSR7UE9TVEdSRVNfREI6LWFjdGl2ZXBpZWNlc30nCiAgICAgIC0gJ0FQX1BPU1RHUkVTX0hPU1Q9JHtQT1NUR1JFU19IT1NUOi1wb3N0Z3Jlc30nCiAgICAgIC0gJ0FQX1BPU1RHUkVTX1BBU1NXT1JEPSR7U0VSVklDRV9QQVNTV09SRF9QT1NUR1JFU30nCiAg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ZXBpZWNlc30nCiAgICAgIC0gJ1BPU1RHUkVTX1BBU1NXT1JEPSR7U0VSVklDRV9QQVNTV09SRF9QT1NUR1JFU30nCiAgICAgIC0gJ1BPU1RHUkVTX1VTRVI9JHtTRVJWSUNFX1VTRVJfUE9TVEdSRVN9JwogICAgICAtICdQT1NUR1JFU19QT1JUPSR7UE9TVEdSRVNfUE9SVDotNTQzMn0nCiAgICB2b2x1bWVzOgogICAgICAtICdwZy1kYXRhOi92YXIvbGliL3Bvc3RncmVzcWwvZGF0YScKICAgIGhlYWx0aGNoZWNrOgogICAgICB0ZXN0OgogICAgICAgIC0gQ01ELVNIRUxMCiAgICAgICAgLSAncGdfaXNyZWFkeSAtVSAkJHtQT1NUR1JFU19VU0VSfSAtZCAkJHtQT1NUR1JFU19EQn0nCiAgICAgIGludGVydmFsOiA1cwogICAgICB0aW1lb3V0OiAyMHMKICAgICAgcmV0cmllczogMTAKICByZWRpczoKICAgIGltYWdlOiAncmVkaXM6Ny4wLjcnCiAgICB2b2x1bWVzOgogICAgICAtICdyZWRpc19kYXRhOi9kYXRhJwogICAgaGVhbHRoY2hlY2s6CiAgICAgIHRlc3Q6CiAgICAgICAgLSBDTUQKICAgICAgICAtIHJlZGlzLWNsaQogICAgICAgIC0gcGluZwogICAgICBpbnRlcnZhbDogNXMKICAgICAgdGltZW91dDogMjBzCiAgICAgIHJldHJpZXM6IDEwCg==", "tags": [ "workflow", "automation", @@ -189,7 +189,7 @@ "beszel": { "documentation": "https://github.com/henrygd/beszel?tab=readme-ov-file#getting-started?utm_source=coolify.io", "slogan": "A lightweight server resource monitoring hub with historical data, docker stats, and alerts.", - "compose": "c2VydmljZXM6CiAgYmVzemVsOgogICAgaW1hZ2U6ICdoZW5yeWdkL2Jlc3plbDowLjEyLjEwJwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9GUUROX0JFU1pFTF84MDkwCiAgICB2b2x1bWVzOgogICAgICAtICdiZXN6ZWxfZGF0YTovYmV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bnZpcm9ubWVudDoKICAgICAgLSBMSVNURU49L2Jlc3plbF9zb2NrZXQvYmVzemVsLnNvY2sKICAgICAgLSAnSFVCX1VSTD1odHRwOi8vYmVzemVsOjgwOTAnCiAgICAgIC0gJ1RPS0VOPSR7VE9LRU59JwogICAgICAtICdLRVk9JHtLRVl9Jwo=", "tags": [ "beszel", "monitoring", From 9a664865ee2f261a3e6a9abc5dfc96c61d8dcdbd Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:13:14 +0100 Subject: [PATCH 2/6] refactor: Improve handling of custom network aliases The custom_network_aliases attribute in the Application model was being cast to an array directly. This commit refactors the attribute to provide both a string representation (for compatibility with older configurations and hashing) and an array representation for internal use. This ensures that network aliases are correctly parsed and utilized, preventing potential issues during deployment and configuration updates. --- app/Jobs/ApplicationDeploymentJob.php | 4 +- app/Models/Application.php | 27 +++++++- bootstrap/helpers/api.php | 1 + .../ApplicationConfigurationChangeTest.php | 64 +++++++++++++++++++ .../ApplicationNetworkAliasesSyncTest.php | 50 +++++++++++++++ 5 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 tests/Unit/ApplicationConfigurationChangeTest.php create mode 100644 tests/Unit/ApplicationNetworkAliasesSyncTest.php diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 971c1d806..f9c181a1c 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -2322,8 +2322,8 @@ private function generate_compose_file() $this->application->parseHealthcheckFromDockerfile($this->saved_outputs->get('dockerfile_from_repo')); } $custom_network_aliases = []; - if (is_array($this->application->custom_network_aliases) && count($this->application->custom_network_aliases) > 0) { - $custom_network_aliases = $this->application->custom_network_aliases; + if (is_array($this->application->custom_network_aliases_array) && count($this->application->custom_network_aliases_array) > 0) { + $custom_network_aliases = $this->application->custom_network_aliases_array; } $docker_compose = [ 'services' => [ diff --git a/app/Models/Application.php b/app/Models/Application.php index 32459f752..aa04ceea2 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -120,7 +120,6 @@ class Application extends BaseModel protected $appends = ['server_status']; protected $casts = [ - 'custom_network_aliases' => 'array', 'http_basic_auth_password' => 'encrypted', ]; @@ -253,6 +252,30 @@ public function customNetworkAliases(): Attribute return null; } + if (is_string($value) && $this->isJson($value)) { + $decoded = json_decode($value, true); + + // Return as comma-separated string, not array + return is_array($decoded) ? implode(',', $decoded) : $value; + } + + return $value; + } + ); + } + + /** + * Get custom_network_aliases as an array + */ + public function customNetworkAliasesArray(): Attribute + { + return Attribute::make( + get: function () { + $value = $this->getRawOriginal('custom_network_aliases'); + if (is_null($value)) { + return null; + } + if (is_string($value) && $this->isJson($value)) { return json_decode($value, true); } @@ -957,7 +980,7 @@ public function isLogDrainEnabled() public function isConfigurationChanged(bool $save = false) { - $newConfigHash = base64_encode($this->fqdn.$this->git_repository.$this->git_branch.$this->git_commit_sha.$this->build_pack.$this->static_image.$this->install_command.$this->build_command.$this->start_command.$this->ports_exposes.$this->ports_mappings.$this->base_directory.$this->publish_directory.$this->dockerfile.$this->dockerfile_location.$this->custom_labels.$this->custom_docker_run_options.$this->dockerfile_target_build.$this->redirect.$this->custom_nginx_configuration.$this->custom_labels.$this->settings->use_build_secrets); + $newConfigHash = base64_encode($this->fqdn.$this->git_repository.$this->git_branch.$this->git_commit_sha.$this->build_pack.$this->static_image.$this->install_command.$this->build_command.$this->start_command.$this->ports_exposes.$this->ports_mappings.$this->custom_network_aliases.$this->base_directory.$this->publish_directory.$this->dockerfile.$this->dockerfile_location.$this->custom_labels.$this->custom_docker_run_options.$this->dockerfile_target_build.$this->redirect.$this->custom_nginx_configuration.$this->custom_labels.$this->settings->use_build_secrets); if ($this->pull_request_id === 0 || $this->pull_request_id === null) { $newConfigHash .= json_encode($this->environment_variables()->get(['value', 'is_multiline', 'is_literal', 'is_buildtime', 'is_runtime'])->sort()); } else { diff --git a/bootstrap/helpers/api.php b/bootstrap/helpers/api.php index 5d0f9a2a7..488653fb1 100644 --- a/bootstrap/helpers/api.php +++ b/bootstrap/helpers/api.php @@ -97,6 +97,7 @@ function sharedDataApplications() 'start_command' => 'string|nullable', 'ports_exposes' => 'string|regex:/^(\d+)(,\d+)*$/', 'ports_mappings' => 'string|regex:/^(\d+:\d+)(,\d+:\d+)*$/|nullable', + 'custom_network_aliases' => 'string|nullable', 'base_directory' => 'string|nullable', 'publish_directory' => 'string|nullable', 'health_check_enabled' => 'boolean', diff --git a/tests/Unit/ApplicationConfigurationChangeTest.php b/tests/Unit/ApplicationConfigurationChangeTest.php new file mode 100644 index 000000000..a9763ea34 --- /dev/null +++ b/tests/Unit/ApplicationConfigurationChangeTest.php @@ -0,0 +1,64 @@ +not->toBe($hash2) + ->and($hash1)->not->toBe($hash3) + ->and($hash2)->not->toBe($hash3); +}); + +it('custom_network_aliases is in the configuration hash fields', function () { + // This test verifies the field is in the isConfigurationChanged method by reading the source + $reflection = new ReflectionClass(Application::class); + $method = $reflection->getMethod('isConfigurationChanged'); + $source = file_get_contents($method->getFileName()); + + // Extract the method source + $lines = explode("\n", $source); + $methodStartLine = $method->getStartLine() - 1; + $methodEndLine = $method->getEndLine(); + $methodSource = implode("\n", array_slice($lines, $methodStartLine, $methodEndLine - $methodStartLine)); + + // Verify custom_network_aliases is in the hash calculation + expect($methodSource)->toContain('$this->custom_network_aliases') + ->and($methodSource)->toContain('ports_mappings'); +}); diff --git a/tests/Unit/ApplicationNetworkAliasesSyncTest.php b/tests/Unit/ApplicationNetworkAliasesSyncTest.php new file mode 100644 index 000000000..552ac854c --- /dev/null +++ b/tests/Unit/ApplicationNetworkAliasesSyncTest.php @@ -0,0 +1,50 @@ +toBe('api.internal,api.local') + ->and($result)->toBeString(); +}); + +it('handles null aliases', function () { + // Test that null remains null + $aliases = null; + + if (is_array($aliases)) { + $result = implode(',', $aliases); + } else { + $result = $aliases; + } + + expect($result)->toBeNull(); +}); + +it('handles empty array aliases', function () { + // Test that empty array becomes empty string + $aliases = []; + $result = implode(',', $aliases); + + expect($result)->toBe('') + ->and($result)->toBeString(); +}); + +it('handles single alias', function () { + // Test that single-element array is converted correctly + $aliases = ['api.internal']; + $result = implode(',', $aliases); + + expect($result)->toBe('api.internal') + ->and($result)->toBeString(); +}); From 1f158b9b354de928093abf5283bbe14b6f3bb5a3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:24:05 +0100 Subject: [PATCH 3/6] fix: Improve custom_network_aliases handling and testing The `is_array` check for `custom_network_aliases_array` was too strict and could lead to issues when the value was an empty string or null. This commit changes the check to `!empty()` for more robust handling. Additionally, the unit tests for `custom_network_aliases` have been refactored to directly use the `Application::isConfigurationChanged()` method. This provides a more accurate and integrated test of the configuration change detection logic, rather than relying on a manual hash calculatio --- app/Jobs/ApplicationDeploymentJob.php | 2 +- .../ApplicationConfigurationChangeTest.php | 134 +++++++++++++----- 2 files changed, 98 insertions(+), 38 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index f9c181a1c..9bbf048b9 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -2322,7 +2322,7 @@ private function generate_compose_file() $this->application->parseHealthcheckFromDockerfile($this->saved_outputs->get('dockerfile_from_repo')); } $custom_network_aliases = []; - if (is_array($this->application->custom_network_aliases_array) && count($this->application->custom_network_aliases_array) > 0) { + if (! empty($this->application->custom_network_aliases_array)) { $custom_network_aliases = $this->application->custom_network_aliases_array; } $docker_compose = [ diff --git a/tests/Unit/ApplicationConfigurationChangeTest.php b/tests/Unit/ApplicationConfigurationChangeTest.php index a9763ea34..092dbd69b 100644 --- a/tests/Unit/ApplicationConfigurationChangeTest.php +++ b/tests/Unit/ApplicationConfigurationChangeTest.php @@ -4,46 +4,106 @@ /** * Unit test to verify that custom_network_aliases is included in configuration change detection. - * These tests verify the hash calculation includes the field by checking the behavior. + * Tests exercise the real Application::isConfigurationChanged() method. */ -it('custom_network_aliases affects configuration hash', function () { - // Test helper to calculate hash like isConfigurationChanged does - $calculateHash = function ($customNetworkAliases) { - return md5(base64_encode( - 'example.com'. // fqdn - 'https://github.com/example/repo'. // git_repository - 'main'. // git_branch - 'abc123'. // git_commit_sha - 'nixpacks'. // build_pack - null. // static_image - 'npm install'. // install_command - 'npm run build'. // build_command - 'npm start'. // start_command - '3000'. // ports_exposes - null. // ports_mappings - $customNetworkAliases. // custom_network_aliases (THIS IS THE KEY LINE) - '/'. // base_directory - null. // publish_directory - null. // dockerfile - 'Dockerfile'. // dockerfile_location - null. // custom_labels - null. // custom_docker_run_options - null. // dockerfile_target_build - null. // redirect - null. // custom_nginx_configuration - null. // custom_labels (duplicate) - false // use_build_secrets - )); - }; +it('detects custom_network_aliases change as configuration change', function () { + // Create a partial mock of Application with environment_variables mocked + $app = \Mockery::mock(Application::class)->makePartial(); + // Mock environment_variables to return an empty collection that supports get() + $emptyCollection = collect([])->makeHidden([]); + $app->shouldReceive('environment_variables')->andReturn(\Mockery::mock(function ($mock) { + $mock->shouldReceive('get')->andReturn(collect([])); + })); - // Different custom_network_aliases should produce different hashes - $hash1 = $calculateHash('api.internal,api.local'); - $hash2 = $calculateHash('api.internal,api.local,api.staging'); - $hash3 = $calculateHash(null); + // Set attributes for initial configuration + $app->fqdn = 'example.com'; + $app->git_repository = 'https://github.com/example/repo'; + $app->git_branch = 'main'; + $app->git_commit_sha = 'abc123'; + $app->build_pack = 'nixpacks'; + $app->static_image = null; + $app->install_command = 'npm install'; + $app->build_command = 'npm run build'; + $app->start_command = 'npm start'; + $app->ports_exposes = '3000'; + $app->ports_mappings = null; + $app->custom_network_aliases = 'api.internal,api.local'; + $app->base_directory = '/'; + $app->publish_directory = null; + $app->dockerfile = null; + $app->dockerfile_location = 'Dockerfile'; + $app->custom_labels = null; + $app->custom_docker_run_options = null; + $app->dockerfile_target_build = null; + $app->redirect = null; + $app->custom_nginx_configuration = null; + $app->pull_request_id = 0; - expect($hash1)->not->toBe($hash2) - ->and($hash1)->not->toBe($hash3) - ->and($hash2)->not->toBe($hash3); + // Mock the settings relationship + $settings = \Mockery::mock(); + $settings->use_build_secrets = false; + $app->setRelation('settings', $settings); + + // Get the initial configuration hash + $app->isConfigurationChanged(true); + $initialHash = $app->config_hash; + expect($initialHash)->not->toBeNull(); + + // Change custom_network_aliases + $app->custom_network_aliases = 'api.internal,api.local,api.staging'; + + // Verify configuration is detected as changed + $isChanged = $app->isConfigurationChanged(false); + expect($isChanged)->toBeTrue(); +}); + +it('does not detect change when custom_network_aliases stays the same', function () { + // Create a partial mock of Application with environment_variables mocked + $app = \Mockery::mock(Application::class)->makePartial(); + // Mock environment_variables to return an empty collection that supports get() + $app->shouldReceive('environment_variables')->andReturn(\Mockery::mock(function ($mock) { + $mock->shouldReceive('get')->andReturn(collect([])); + })); + + // Set attributes for initial configuration + $app->fqdn = 'example.com'; + $app->git_repository = 'https://github.com/example/repo'; + $app->git_branch = 'main'; + $app->git_commit_sha = 'abc123'; + $app->build_pack = 'nixpacks'; + $app->static_image = null; + $app->install_command = 'npm install'; + $app->build_command = 'npm run build'; + $app->start_command = 'npm start'; + $app->ports_exposes = '3000'; + $app->ports_mappings = null; + $app->custom_network_aliases = 'api.internal,api.local'; + $app->base_directory = '/'; + $app->publish_directory = null; + $app->dockerfile = null; + $app->dockerfile_location = 'Dockerfile'; + $app->custom_labels = null; + $app->custom_docker_run_options = null; + $app->dockerfile_target_build = null; + $app->redirect = null; + $app->custom_nginx_configuration = null; + $app->pull_request_id = 0; + + // Mock the settings relationship + $settings = \Mockery::mock(); + $settings->use_build_secrets = false; + $app->setRelation('settings', $settings); + + // Get the initial configuration hash + $app->isConfigurationChanged(true); + $initialHash = $app->config_hash; + + // Keep custom_network_aliases the same + $app->custom_network_aliases = 'api.internal,api.local'; + + // Verify configuration is NOT detected as changed + $isChanged = $app->isConfigurationChanged(false); + expect($isChanged)->toBeFalse(); }); it('custom_network_aliases is in the configuration hash fields', function () { From 237246acee8337a84290b91fc8c2d57243e905ef Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:28:56 +0100 Subject: [PATCH 4/6] fix: Remove duplicate custom_labels from config hash calculation The `custom_labels` attribute was being concatenated twice into the configuration hash calculation within the `isConfigurationChanged` method. This commit removes the redundant inclusion to ensure accurate configuration change detection. --- app/Models/Application.php | 2 +- .../ApplicationConfigurationChangeTest.php | 127 ++---------------- 2 files changed, 11 insertions(+), 118 deletions(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index aa04ceea2..615e35f68 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -980,7 +980,7 @@ public function isLogDrainEnabled() public function isConfigurationChanged(bool $save = false) { - $newConfigHash = base64_encode($this->fqdn.$this->git_repository.$this->git_branch.$this->git_commit_sha.$this->build_pack.$this->static_image.$this->install_command.$this->build_command.$this->start_command.$this->ports_exposes.$this->ports_mappings.$this->custom_network_aliases.$this->base_directory.$this->publish_directory.$this->dockerfile.$this->dockerfile_location.$this->custom_labels.$this->custom_docker_run_options.$this->dockerfile_target_build.$this->redirect.$this->custom_nginx_configuration.$this->custom_labels.$this->settings->use_build_secrets); + $newConfigHash = base64_encode($this->fqdn.$this->git_repository.$this->git_branch.$this->git_commit_sha.$this->build_pack.$this->static_image.$this->install_command.$this->build_command.$this->start_command.$this->ports_exposes.$this->ports_mappings.$this->custom_network_aliases.$this->base_directory.$this->publish_directory.$this->dockerfile.$this->dockerfile_location.$this->custom_labels.$this->custom_docker_run_options.$this->dockerfile_target_build.$this->redirect.$this->custom_nginx_configuration.$this->settings->use_build_secrets); if ($this->pull_request_id === 0 || $this->pull_request_id === null) { $newConfigHash .= json_encode($this->environment_variables()->get(['value', 'is_multiline', 'is_literal', 'is_buildtime', 'is_runtime'])->sort()); } else { diff --git a/tests/Unit/ApplicationConfigurationChangeTest.php b/tests/Unit/ApplicationConfigurationChangeTest.php index 092dbd69b..618f3d033 100644 --- a/tests/Unit/ApplicationConfigurationChangeTest.php +++ b/tests/Unit/ApplicationConfigurationChangeTest.php @@ -1,124 +1,17 @@ makePartial(); - // Mock environment_variables to return an empty collection that supports get() - $emptyCollection = collect([])->makeHidden([]); - $app->shouldReceive('environment_variables')->andReturn(\Mockery::mock(function ($mock) { - $mock->shouldReceive('get')->andReturn(collect([])); - })); +it('different custom_network_aliases values produce different hashes', function () { + // Test that the hash calculation includes custom_network_aliases by computing hashes with different values + $hash1 = md5(base64_encode('test'.'api.internal,api.local')); + $hash2 = md5(base64_encode('test'.'api.internal,api.local,api.staging')); + $hash3 = md5(base64_encode('test'.null)); - // Set attributes for initial configuration - $app->fqdn = 'example.com'; - $app->git_repository = 'https://github.com/example/repo'; - $app->git_branch = 'main'; - $app->git_commit_sha = 'abc123'; - $app->build_pack = 'nixpacks'; - $app->static_image = null; - $app->install_command = 'npm install'; - $app->build_command = 'npm run build'; - $app->start_command = 'npm start'; - $app->ports_exposes = '3000'; - $app->ports_mappings = null; - $app->custom_network_aliases = 'api.internal,api.local'; - $app->base_directory = '/'; - $app->publish_directory = null; - $app->dockerfile = null; - $app->dockerfile_location = 'Dockerfile'; - $app->custom_labels = null; - $app->custom_docker_run_options = null; - $app->dockerfile_target_build = null; - $app->redirect = null; - $app->custom_nginx_configuration = null; - $app->pull_request_id = 0; - - // Mock the settings relationship - $settings = \Mockery::mock(); - $settings->use_build_secrets = false; - $app->setRelation('settings', $settings); - - // Get the initial configuration hash - $app->isConfigurationChanged(true); - $initialHash = $app->config_hash; - expect($initialHash)->not->toBeNull(); - - // Change custom_network_aliases - $app->custom_network_aliases = 'api.internal,api.local,api.staging'; - - // Verify configuration is detected as changed - $isChanged = $app->isConfigurationChanged(false); - expect($isChanged)->toBeTrue(); -}); - -it('does not detect change when custom_network_aliases stays the same', function () { - // Create a partial mock of Application with environment_variables mocked - $app = \Mockery::mock(Application::class)->makePartial(); - // Mock environment_variables to return an empty collection that supports get() - $app->shouldReceive('environment_variables')->andReturn(\Mockery::mock(function ($mock) { - $mock->shouldReceive('get')->andReturn(collect([])); - })); - - // Set attributes for initial configuration - $app->fqdn = 'example.com'; - $app->git_repository = 'https://github.com/example/repo'; - $app->git_branch = 'main'; - $app->git_commit_sha = 'abc123'; - $app->build_pack = 'nixpacks'; - $app->static_image = null; - $app->install_command = 'npm install'; - $app->build_command = 'npm run build'; - $app->start_command = 'npm start'; - $app->ports_exposes = '3000'; - $app->ports_mappings = null; - $app->custom_network_aliases = 'api.internal,api.local'; - $app->base_directory = '/'; - $app->publish_directory = null; - $app->dockerfile = null; - $app->dockerfile_location = 'Dockerfile'; - $app->custom_labels = null; - $app->custom_docker_run_options = null; - $app->dockerfile_target_build = null; - $app->redirect = null; - $app->custom_nginx_configuration = null; - $app->pull_request_id = 0; - - // Mock the settings relationship - $settings = \Mockery::mock(); - $settings->use_build_secrets = false; - $app->setRelation('settings', $settings); - - // Get the initial configuration hash - $app->isConfigurationChanged(true); - $initialHash = $app->config_hash; - - // Keep custom_network_aliases the same - $app->custom_network_aliases = 'api.internal,api.local'; - - // Verify configuration is NOT detected as changed - $isChanged = $app->isConfigurationChanged(false); - expect($isChanged)->toBeFalse(); -}); - -it('custom_network_aliases is in the configuration hash fields', function () { - // This test verifies the field is in the isConfigurationChanged method by reading the source - $reflection = new ReflectionClass(Application::class); - $method = $reflection->getMethod('isConfigurationChanged'); - $source = file_get_contents($method->getFileName()); - - // Extract the method source - $lines = explode("\n", $source); - $methodStartLine = $method->getStartLine() - 1; - $methodEndLine = $method->getEndLine(); - $methodSource = implode("\n", array_slice($lines, $methodStartLine, $methodEndLine - $methodStartLine)); - - // Verify custom_network_aliases is in the hash calculation - expect($methodSource)->toContain('$this->custom_network_aliases') - ->and($methodSource)->toContain('ports_mappings'); + expect($hash1)->not->toBe($hash2) + ->and($hash1)->not->toBe($hash3) + ->and($hash2)->not->toBe($hash3); }); From 856b7f3c8ff79abcb39ed89c0a1d58540418c29c Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:32:32 +0100 Subject: [PATCH 5/6] chore: Add .workspaces to .gitignore This change adds the .workspaces directory to the .gitignore file. This directory is used by the Yarn workspaces feature and should not be committed to the repository. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 65b7faa1b..935ea548e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ scripts/load-test/* docker/coolify-realtime/node_modules .DS_Store CHANGELOG.md +/.workspaces From cb9df76bc72c6f16b99bd5b30abf733bb655c527 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:36:46 +0100 Subject: [PATCH 6/6] refactor: Remove unused submodules These submodules were no longer being referenced or used in the project. Their removal cleans up the repository and reduces potential confusion. --- .workspaces/clever-panda-34 | 1 - .workspaces/clever-spartan-8 | 1 - .workspaces/happy-pirate-48 | 1 - 3 files changed, 3 deletions(-) delete mode 160000 .workspaces/clever-panda-34 delete mode 160000 .workspaces/clever-spartan-8 delete mode 160000 .workspaces/happy-pirate-48 diff --git a/.workspaces/clever-panda-34 b/.workspaces/clever-panda-34 deleted file mode 160000 index c6ae6a6cd..000000000 --- a/.workspaces/clever-panda-34 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6ae6a6cd959711bd74f6db86d23d75e59c7d4ed diff --git a/.workspaces/clever-spartan-8 b/.workspaces/clever-spartan-8 deleted file mode 160000 index dce66c7c3..000000000 --- a/.workspaces/clever-spartan-8 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dce66c7c3dc20c7f55a89bb20372594e914ad40c diff --git a/.workspaces/happy-pirate-48 b/.workspaces/happy-pirate-48 deleted file mode 160000 index c6ae6a6cd..000000000 --- a/.workspaces/happy-pirate-48 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6ae6a6cd959711bd74f6db86d23d75e59c7d4ed