feat(shared-variables): add server-scoped shared environment variables#9356
Closed
andrasbacsai wants to merge 18 commits intonextfrom
Closed
feat(shared-variables): add server-scoped shared environment variables#9356andrasbacsai wants to merge 18 commits intonextfrom
andrasbacsai wants to merge 18 commits intonextfrom
Conversation
…R_UUID) These are not visible on shared env page but user can use these variables like they use the COOLIFY_RESOURCE_UUID
Use `$this->mainServer` when resolving environment variable values across deployment env generation (runtime, buildtime, nixpacks, args, and secrets hash) so shared server-scoped values are applied consistently. Also add `server_id` to `SharedEnvironmentVariable::$fillable` and normalize the Livewire Blade file newline.
… Server Extract duplicated inline StandaloneDocker attribute arrays in the Server boot lifecycle into a dedicated method, eliminating repetition between the root-server (id=0) and normal-server paths. Also harden the shared_environment_variables migration by wrapping DDL statements in DB::transaction() and using DROP CONSTRAINT IF EXISTS to make the migration safely re-runnable. Add unit test covering the extracted method to verify uuid is always present in bootstrap attributes.
…for server variables Allow SharedVariables Livewire components (Environment, Project, Server) to accept UUID parameters directly via mount() instead of relying solely on route parameters. This enables Livewire component testing without a live route context. Also adds comment field support when saving/updating server shared environment variables, guards PostgreSQL-specific migration statements from running under SQLite (test environment compatibility), and expands the feature test suite with server shared variable scenarios including inline comment preservation and update behaviour.
Member
Author
|
created by mistake oops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
serverscope to shared environment variables, accessible at/shared-variables/server/{server_uuid}COOLIFY_SERVER_UUIDandCOOLIFY_SERVER_NAMEvariables for every server (new and existing via migration){{server.ENV_NAME}}syntax$this->mainServer) across all env generation paths — fixes build-server scenario where$this->servercould point to the build server insteadServer::environment_variables()relationship andgetResolvedValueWithServer($server)method onEnvironmentVariableto inject server context at deployment timeTeam,Project,Environment) to explicittypefilter instead of implicit nullable column checksServer::defaultStandaloneDockerAttributes()helper to deduplicate bootstrap codeSharedVariables\Server\IndexandSharedVariables\Server\Showwith normal/developer viewsBreaking Changes
{{server.EnvName}}references to resolve literally as{{server.EnvName}}since the server scope won't exist in older codeRelated to #7764