From 7513202199080aa7c00bd94003d99b56c36ef473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Bara=C3=BAna?= Date: Tue, 19 Aug 2025 11:31:56 -0300 Subject: [PATCH] Improve error message for unauthorized deploy (#3048) --- lib/livebook/teams/requests.ex | 2 +- test/livebook_teams/cli/deploy_test.exs | 2 +- test/livebook_teams/web/session_live_test.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/livebook/teams/requests.ex b/lib/livebook/teams/requests.ex index cd1f5d450..57eda9ad6 100644 --- a/lib/livebook/teams/requests.ex +++ b/lib/livebook/teams/requests.ex @@ -8,7 +8,7 @@ defmodule Livebook.Teams.Requests do @deploy_key_prefix Teams.Constants.deploy_key_prefix() @error_message "Something went wrong, try again later or please file a bug if it persists" @unauthorized_error_message "You are not authorized to perform this action, make sure you have the access and you are not in a Livebook App Server/Offline instance" - @unauthorized_app_deployment_error_message "You are not authorized to perform this action, make sure you have the access to deploy apps to this deployment group" + @unauthorized_app_deployment_error_message "Deployment not authorized, check deploy permissions for this deployment group" @typep api_result :: {:ok, map()} | error_result() @typep error_result :: {:error, map() | String.t()} | {:transport_error, String.t()} diff --git a/test/livebook_teams/cli/deploy_test.exs b/test/livebook_teams/cli/deploy_test.exs index bd73f16e9..ba928f62c 100644 --- a/test/livebook_teams/cli/deploy_test.exs +++ b/test/livebook_teams/cli/deploy_test.exs @@ -152,7 +152,7 @@ defmodule LivebookCLI.Integration.DeployTest do assert output =~ "* Preparing to deploy notebook #{slug}.livemd" assert output =~ - "* Test CLI Deploy App failed to deploy. Transport error: You are not authorized to perform this action, make sure you have the access to deploy apps to this deployment group" + "* Test CLI Deploy App failed to deploy. Transport error: Deployment not authorized, check deploy permissions for this deployment group" refute_receive {:app_deployment_started, %{ diff --git a/test/livebook_teams/web/session_live_test.exs b/test/livebook_teams/web/session_live_test.exs index 0bf98cf13..067cd626a 100644 --- a/test/livebook_teams/web/session_live_test.exs +++ b/test/livebook_teams/web/session_live_test.exs @@ -688,7 +688,7 @@ defmodule LivebookWeb.Integration.SessionLiveTest do |> render_click() assert render(view) =~ - "You are not authorized to perform this action, make sure you have the access to deploy apps to this deployment group" + "Deployment not authorized, check deploy permissions for this deployment group" end end end