diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e773f22..580194c55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,25 @@ All notable changes to this project will be documented in this file. ### 🚀 Features +- *(database)* Disable MongoDB SSL by default in migration + +### 🚜 Refactor + +- *(proxy)* Improve port availability checks with multiple methods +- *(database)* Update MongoDB SSL configuration for improved security +- *(database)* Enhance SSL configuration handling for various databases +- *(notifications)* Update Telegram button URL for staging environment +- *(models)* Remove unnecessary cloud check in isEnabled method +- *(database)* Streamline event listeners in Redis General component +- *(database)* Remove redundant database status display in MongoDB view +- *(database)* Update import statements for Auth in database components +- *(database)* Require PEM key file for SSL certificate regeneration +- *(database)* Change MySQL daemon command to MariaDB daemon + +## [4.0.0-beta.399] - 2025-03-25 + +### 🚀 Features + - *(service)* Neon - *(migration)* Add `ssl_certificates` table and model - *(migration)* Add ssl setting to `standalone_postgresqls` table diff --git a/app/Http/Controllers/Api/DeployController.php b/app/Http/Controllers/Api/DeployController.php index 870f7fdce..65ed11d9c 100644 --- a/app/Http/Controllers/Api/DeployController.php +++ b/app/Http/Controllers/Api/DeployController.php @@ -143,6 +143,7 @@ class DeployController extends Controller new OA\Parameter(name: 'tag', in: 'query', description: 'Tag name(s). Comma separated list is also accepted.', schema: new OA\Schema(type: 'string')), new OA\Parameter(name: 'uuid', in: 'query', description: 'Resource UUID(s). Comma separated list is also accepted.', schema: new OA\Schema(type: 'string')), new OA\Parameter(name: 'force', in: 'query', description: 'Force rebuild (without cache)', schema: new OA\Schema(type: 'boolean')), + new OA\Parameter(name: 'pr', in: 'query', description: 'Pull Request Id for deploying specific PR builds. Cannot be used with tag parameter.', schema: new OA\Schema(type: 'integer')), ], responses: [ @@ -185,26 +186,32 @@ class DeployController extends Controller public function deploy(Request $request) { $teamId = getTeamIdFromToken(); + + if (is_null($teamId)) { + return invalidTokenResponse(); + } + $uuids = $request->query->get('uuid'); $tags = $request->query->get('tag'); $force = $request->query->get('force') ?? false; + $pr = $request->query->get('pr') ? max((int) $request->query->get('pr'), 0) : 0; if ($uuids && $tags) { return response()->json(['message' => 'You can only use uuid or tag, not both.'], 400); } - if (is_null($teamId)) { - return invalidTokenResponse(); + if ($tags && $pr) { + return response()->json(['message' => 'You can only use tag or pr, not both.'], 400); } if ($tags) { return $this->by_tags($tags, $teamId, $force); } elseif ($uuids) { - return $this->by_uuids($uuids, $teamId, $force); + return $this->by_uuids($uuids, $teamId, $force, $pr); } return response()->json(['message' => 'You must provide uuid or tag.'], 400); } - private function by_uuids(string $uuid, int $teamId, bool $force = false) + private function by_uuids(string $uuid, int $teamId, bool $force = false, int $pr = 0) { $uuids = explode(',', $uuid); $uuids = collect(array_filter($uuids)); @@ -217,7 +224,7 @@ class DeployController extends Controller foreach ($uuids as $uuid) { $resource = getResourceByUuid($uuid, $teamId); if ($resource) { - ['message' => $return_message, 'deployment_uuid' => $deployment_uuid] = $this->deploy_resource($resource, $force); + ['message' => $return_message, 'deployment_uuid' => $deployment_uuid] = $this->deploy_resource($resource, $force, $pr); if ($deployment_uuid) { $deployments->push(['message' => $return_message, 'resource_uuid' => $uuid, 'deployment_uuid' => $deployment_uuid->toString()]); } else { @@ -282,7 +289,7 @@ class DeployController extends Controller return response()->json(['message' => 'No resources found with this tag.'], 404); } - public function deploy_resource($resource, bool $force = false): array + public function deploy_resource($resource, bool $force = false, int $pr = 0): array { $message = null; $deployment_uuid = null; @@ -296,6 +303,7 @@ class DeployController extends Controller application: $resource, deployment_uuid: $deployment_uuid, force_rebuild: $force, + pull_request_id: $pr, ); $message = "Application {$resource->name} deployment queued."; break; diff --git a/openapi.json b/openapi.json index 819f229cc..1d7d69fe7 100644 --- a/openapi.json +++ b/openapi.json @@ -4477,6 +4477,14 @@ "schema": { "type": "boolean" } + }, + { + "name": "pr", + "in": "query", + "description": "Pull request ID", + "schema": { + "type": "integer" + } } ], "responses": { diff --git a/openapi.yaml b/openapi.yaml index c965e9fe2..7cddb7b55 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3152,6 +3152,12 @@ paths: description: 'Force rebuild (without cache)' schema: type: boolean + - + name: pr + in: query + description: 'Pull request id' + schema: + type: integer responses: '200': description: "Get deployment(s) UUID's"