[config_types.Path] Deprecate Path.join()

Use Path.joinpath() instead, like with pathlib.Path.

Bug: 329113288
Change-Id: I9ae89f6fe2c28eff76defcaa92a84237c2f67701
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/5467193
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
diff --git a/recipe.warnings b/recipe.warnings
index c0287aa..12f7388 100644
--- a/recipe.warnings
+++ b/recipe.warnings
@@ -128,6 +128,21 @@
 }
 
 warning {
+  name: "PATH_JOIN_DEPRECATED"
+  description: "config_types.Path.join() is deprecated."
+  description: ""
+  description: "Use config_types.Path.joinpath() instead. Or, use"
+  description: "api.path.join(), or the / operator."
+  description: ""
+  description: "This is part of a larger effort to replace config_types.Path"
+  description: "with pathlib.Path. Since the interfaces of the two classes are"
+  description: "not identical, config_types.Path is being made to look more"
+  description: "like pathlib.Path."
+  deadline: "2024-06-01"
+  google_issue { id: 329113288 }
+}
+
+warning {
   name: "PYTHON2_DEPRECATED"
   description: "Python2 is deprecated."
   description: ""
diff --git a/recipe_engine/config_types.py b/recipe_engine/config_types.py
index 75639b6..57693e9 100644
--- a/recipe_engine/config_types.py
+++ b/recipe_engine/config_types.py
@@ -364,6 +364,8 @@
         *[p for p in itertools.chain(self.pieces, pieces) if p])
 
   def join(self, *pieces: str) -> Path:
+    from recipe_engine.internal.warn import record
+    record.GLOBAL.record_execution_warning('PATH_JOIN_DEPRECATED')
     return self.joinpath(*pieces)
 
   def is_parent_of(self, other: Path) -> bool: