[edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.

Ashley E Desimone posted 1 patch 3 years, 11 months ago
Failed in applying to current master (apply log)
edkrepo/commands/clone_command.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
[edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.
Posted by Ashley E Desimone 3 years, 11 months ago
Raise an invalid parameters exception when a project is not found.

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
 edkrepo/commands/clone_command.py | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_command.py
index 179aaf7..3f2e6e1 100644
--- a/edkrepo/commands/clone_command.py
+++ b/edkrepo/commands/clone_command.py
@@ -17,6 +17,7 @@ from edkrepo.common.common_repo_functions import clone_repos, sparse_checkout, v
 from edkrepo.common.common_repo_functions import update_editor_config, combinations_in_manifest
 from edkrepo.common.common_repo_functions import write_included_config, write_conditional_include
 from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersException, EdkrepoManifestInvalidException
+from edkrepo.common.edkrepo_exception import EdkrepoManifestNotFoundException
 from edkrepo.common.humble import CLONE_INVALID_WORKSPACE, CLONE_INVALID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG
 from edkrepo.common.humble import SPARSE_CHECKOUT, CLONE_INVALID_LOCAL_ROOTS
 from edkrepo.common.workspace_maintenance.workspace_maintenance import case_insensitive_single_match
@@ -81,12 +82,15 @@ class CloneCommand(EdkrepoCommand):
             os.makedirs(workspace_dir)
 
         cfg, user_cfg, conflicts = list_available_manifest_repos(config['cfg_file'], config['user_cfg_file'])
-        manifest_repo, source_cfg, global_manifest_path = find_project_in_all_indices(args.ProjectNameOrManifestFile,
-                                                                  config['cfg_file'],
-                                                                  config['user_cfg_file'],
-                                                                  PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
-                                                                  SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManifestFile),
-                                                                  args.source_manifest_repo)
+        try:
+            manifest_repo, source_cfg, global_manifest_path = find_project_in_all_indices(args.ProjectNameOrManifestFile,
+                                                                    config['cfg_file'],
+                                                                    config['user_cfg_file'],
+                                                                    PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
+                                                                    SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManifestFile),
+                                                                    args.source_manifest_repo)
+        except EdkrepoManifestNotFoundException:
+            raise EdkrepoInvalidParametersException(CLONE_INVALID_PROJECT_ARG)
 
         # If this manifest is in a defined manifest repository validate the manifest within the manifest repo
         if manifest_repo in cfg:
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59706): https://edk2.groups.io/g/devel/message/59706
Mute This Topic: https://groups.io/mt/74239702/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.
Posted by Bjorge, Erik C 3 years, 11 months ago
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone@intel.com> 
Sent: Friday, May 15, 2020 4:44 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.

Raise an invalid parameters exception when a project is not found.

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
 edkrepo/commands/clone_command.py | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_command.py
index 179aaf7..3f2e6e1 100644
--- a/edkrepo/commands/clone_command.py
+++ b/edkrepo/commands/clone_command.py
@@ -17,6 +17,7 @@ from edkrepo.common.common_repo_functions import clone_repos, sparse_checkout, v  from edkrepo.common.common_repo_functions import update_editor_config, combinations_in_manifest  from edkrepo.common.common_repo_functions import write_included_config, write_conditional_include  from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersException, EdkrepoManifestInvalidException
+from edkrepo.common.edkrepo_exception import 
+EdkrepoManifestNotFoundException
 from edkrepo.common.humble import CLONE_INVALID_WORKSPACE, CLONE_INVALID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG  from edkrepo.common.humble import SPARSE_CHECKOUT, CLONE_INVALID_LOCAL_ROOTS  from edkrepo.common.workspace_maintenance.workspace_maintenance import case_insensitive_single_match @@ -81,12 +82,15 @@ class CloneCommand(EdkrepoCommand):
             os.makedirs(workspace_dir)
 
         cfg, user_cfg, conflicts = list_available_manifest_repos(config['cfg_file'], config['user_cfg_file'])
-        manifest_repo, source_cfg, global_manifest_path = find_project_in_all_indices(args.ProjectNameOrManifestFile,
-                                                                  config['cfg_file'],
-                                                                  config['user_cfg_file'],
-                                                                  PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
-                                                                  SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManifestFile),
-                                                                  args.source_manifest_repo)
+        try:
+            manifest_repo, source_cfg, global_manifest_path = find_project_in_all_indices(args.ProjectNameOrManifestFile,
+                                                                    config['cfg_file'],
+                                                                    config['user_cfg_file'],
+                                                                    PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
+                                                                    SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManifestFile),
+                                                                    args.source_manifest_repo)
+        except EdkrepoManifestNotFoundException:
+            raise 
+ EdkrepoInvalidParametersException(CLONE_INVALID_PROJECT_ARG)
 
         # If this manifest is in a defined manifest repository validate the manifest within the manifest repo
         if manifest_repo in cfg:
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59708): https://edk2.groups.io/g/devel/message/59708
Mute This Topic: https://groups.io/mt/74239702/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.
Posted by Nate DeSimone 3 years, 11 months ago
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Desimone, Ashley E <ashley.e.desimone@intel.com>
> Sent: Friday, May 15, 2020 4:44 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error
> handling.
> 
> Raise an invalid parameters exception when a project is not found.
> 
> Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  edkrepo/commands/clone_command.py | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/edkrepo/commands/clone_command.py
> b/edkrepo/commands/clone_command.py
> index 179aaf7..3f2e6e1 100644
> --- a/edkrepo/commands/clone_command.py
> +++ b/edkrepo/commands/clone_command.py
> @@ -17,6 +17,7 @@ from edkrepo.common.common_repo_functions
> import clone_repos, sparse_checkout, v  from
> edkrepo.common.common_repo_functions import update_editor_config,
> combinations_in_manifest  from
> edkrepo.common.common_repo_functions import write_included_config,
> write_conditional_include  from edkrepo.common.edkrepo_exception
> import EdkrepoInvalidParametersException,
> EdkrepoManifestInvalidException
> +from edkrepo.common.edkrepo_exception import
> +EdkrepoManifestNotFoundException
>  from edkrepo.common.humble import CLONE_INVALID_WORKSPACE,
> CLONE_INVALID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG  from
> edkrepo.common.humble import SPARSE_CHECKOUT,
> CLONE_INVALID_LOCAL_ROOTS  from
> edkrepo.common.workspace_maintenance.workspace_maintenance import
> case_insensitive_single_match @@ -81,12 +82,15 @@ class
> CloneCommand(EdkrepoCommand):
>              os.makedirs(workspace_dir)
> 
>          cfg, user_cfg, conflicts = list_available_manifest_repos(config['cfg_file'],
> config['user_cfg_file'])
> -        manifest_repo, source_cfg, global_manifest_path =
> find_project_in_all_indices(args.ProjectNameOrManifestFile,
> -                                                                  config['cfg_file'],
> -                                                                  config['user_cfg_file'],
> -
> PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
> -
> SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManif
> estFile),
> -                                                                  args.source_manifest_repo)
> +        try:
> +            manifest_repo, source_cfg, global_manifest_path =
> find_project_in_all_indices(args.ProjectNameOrManifestFile,
> +                                                                    config['cfg_file'],
> +                                                                    config['user_cfg_file'],
> +
> PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
> +
> SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManif
> estFile),
> +                                                                    args.source_manifest_repo)
> +        except EdkrepoManifestNotFoundException:
> +            raise
> + EdkrepoInvalidParametersException(CLONE_INVALID_PROJECT_ARG)
> 
>          # If this manifest is in a defined manifest repository validate the
> manifest within the manifest repo
>          if manifest_repo in cfg:
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59727): https://edk2.groups.io/g/devel/message/59727
Mute This Topic: https://groups.io/mt/74239702/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error handling.
Posted by Nate DeSimone 3 years, 11 months ago
Pushed: f8ded3c3

> -----Original Message-----
> From: Desimone, Ashley E <ashley.e.desimone@intel.com>
> Sent: Friday, May 15, 2020 4:44 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Improve clone error
> handling.
> 
> Raise an invalid parameters exception when a project is not found.
> 
> Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  edkrepo/commands/clone_command.py | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/edkrepo/commands/clone_command.py
> b/edkrepo/commands/clone_command.py
> index 179aaf7..3f2e6e1 100644
> --- a/edkrepo/commands/clone_command.py
> +++ b/edkrepo/commands/clone_command.py
> @@ -17,6 +17,7 @@ from edkrepo.common.common_repo_functions
> import clone_repos, sparse_checkout, v  from
> edkrepo.common.common_repo_functions import update_editor_config,
> combinations_in_manifest  from
> edkrepo.common.common_repo_functions import write_included_config,
> write_conditional_include  from edkrepo.common.edkrepo_exception
> import EdkrepoInvalidParametersException,
> EdkrepoManifestInvalidException
> +from edkrepo.common.edkrepo_exception import
> +EdkrepoManifestNotFoundException
>  from edkrepo.common.humble import CLONE_INVALID_WORKSPACE,
> CLONE_INVALID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG  from
> edkrepo.common.humble import SPARSE_CHECKOUT,
> CLONE_INVALID_LOCAL_ROOTS  from
> edkrepo.common.workspace_maintenance.workspace_maintenance import
> case_insensitive_single_match @@ -81,12 +82,15 @@ class
> CloneCommand(EdkrepoCommand):
>              os.makedirs(workspace_dir)
> 
>          cfg, user_cfg, conflicts = list_available_manifest_repos(config['cfg_file'],
> config['user_cfg_file'])
> -        manifest_repo, source_cfg, global_manifest_path =
> find_project_in_all_indices(args.ProjectNameOrManifestFile,
> -                                                                  config['cfg_file'],
> -                                                                  config['user_cfg_file'],
> -
> PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
> -
> SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManif
> estFile),
> -                                                                  args.source_manifest_repo)
> +        try:
> +            manifest_repo, source_cfg, global_manifest_path =
> find_project_in_all_indices(args.ProjectNameOrManifestFile,
> +                                                                    config['cfg_file'],
> +                                                                    config['user_cfg_file'],
> +
> PROJ_NOT_IN_REPO.format(args.ProjectNameOrManifestFile),
> +
> SOURCE_MANIFEST_REPO_NOT_FOUND.format(args.ProjectNameOrManif
> estFile),
> +                                                                    args.source_manifest_repo)
> +        except EdkrepoManifestNotFoundException:
> +            raise
> + EdkrepoInvalidParametersException(CLONE_INVALID_PROJECT_ARG)
> 
>          # If this manifest is in a defined manifest repository validate the
> manifest within the manifest repo
>          if manifest_repo in cfg:
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59728): https://edk2.groups.io/g/devel/message/59728
Mute This Topic: https://groups.io/mt/74239702/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-