nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: phoenixframework/phoenix
Pull request #3031 (2018-08-20 20:42:35)

Fix app config in namespaced umbrella apps
To address https://github.com/phoenixframework/phoenix/issues/3019

chrismccord: Thank you! Can you add a test-case? <3 <3 <3
mikeover: Sure, would you mind pointing me in the right direction? Where would this test belong?
chrismccord: https://github.com/phoenixframework/phoenix/blob/master/test/mix/tasks/phx.gen.html_test.exs#L271
mikeover: @chrismccord Added a test in the installer instead, please see https://github.com/phoenixframework/phoenix/pull/3031/commits/5bad464102ca75b283708caba96c0661edcade6a
mikeover: @chrismccord Rebased, has a test case, and ready to go.
mikeover: Thanks @chvanikoff - https://github.com/phoenixframework/phoenix/pull/3031/commits/5ed04e7605e194dbe1f0fb4f8ce2e62ac3816392 better?

Patch:
diff --git a/installer/templates/phx_umbrella/apps/app_name/config/config.exs b/installer/templates/phx_umbrella/apps/app_name/config/config.exs
index 47ec5f406..e88b16afd 100644
--- a/installer/templates/phx_umbrella/apps/app_name/config/config.exs
+++ b/installer/templates/phx_umbrella/apps/app_name/config/config.exs
@@ -2,8 +2,10 @@
 # should only configure the :<%= app_name %> application itself
 # and only for organization purposes. All other config goes to
 # the umbrella root.
-use Mix.Config<%= if ecto do %>
+use Mix.Config<%= if namespaced? || ecto do %>
 
-config :<%= app_name %>, ecto_repos: [<%= app_module %>.Repo]<% end %>
+config :<%= app_name %><%= if namespaced? do %>,
+  namespace: <%= app_module %><% end %><%= if ecto do %>,
+  ecto_repos: [<%= app_module %>.Repo]<% end %><% end %>
 
 import_config "#{Mix.env()}.exs"


Test patch:
diff --git a/installer/test/phx_new_umbrella_test.exs b/installer/test/phx_new_umbrella_test.exs
index 2930acf1a..f75391f0d 100644
--- a/installer/test/phx_new_umbrella_test.exs
+++ b/installer/test/phx_new_umbrella_test.exs
@@ -311,6 +311,7 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do
       assert_file "custom_path_umbrella/apps/phx_umb/mix.exs", ~r/mod: {PhoteuxBlog.Application, \[\]}/
       assert_file "custom_path_umbrella/apps/phx_umb_web/lib/phx_umb_web/application.ex", ~r/defmodule PhoteuxBlogWeb.Application/
       assert_file "custom_path_umbrella/apps/phx_umb_web/mix.exs", ~r/mod: {PhoteuxBlogWeb.Application, \[\]}/
+      assert_file "custom_path_umbrella/apps/phx_umb/config/config.exs", ~r/namespace: PhoteuxBlog/
     end
   end