From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.8639.1589074760453973652 for ; Sat, 09 May 2020 18:39:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=RPd8PU6M; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: spwrmm3yd7cr8ExmoMBnwhQFYkm1P3F29umzU+vtanz430k+qdFwVAJfnVp0SDFjE9QnTF7szw 2T8ieKoKlcGg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2020 18:39:19 -0700 IronPort-SDR: 7kEXuz7BSE9jwjtHgtgnYGJUshIl61IaN2fSPitfKZg1crCLQjb6G1CApSEb3yc3vD+CKYftx/ 6Gcdbk+pbIzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,373,1583222400"; d="scan'208";a="340186537" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga001.jf.intel.com with ESMTP; 09 May 2020 18:39:19 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 9 May 2020 18:39:19 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX159.amr.corp.intel.com (10.22.240.24) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 9 May 2020 18:39:19 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 9 May 2020 18:39:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QO9RifYBO37S1ET7wk8mlSuFVi9yNN/ChVqQjn0vReRk+nY4e3zO/R+7cIW9Hj0oWRMNIic/lytIVfkN02xM2qG5zfhg4wnIkOuw8NtnyvBhlFEKV0IFTQw/GOLfWsRs1LBodatUBMB3Li9PDYR8sboQOuYRewpee6RgI2PybKtI/n2F559qYhRomBue2fEgzzTJhtnsC4VuCLVQE/IVggE6k+s8+m9nBPfQQ+24efK8as0UTED/2epumD/ylUeaLhM2B9M3GiUgdjZ9UMdKTS6Nfs3//Di3Lz/QEcffkitnrmqfrGdfFDsJvW3p3DdSN+0mV0ZJdUVCGnl7EtHI+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TMKd8/MDDUFfjtmBHQ2S+wWVfGoeaqcv5Uv2kYxI5CY=; b=Fe3SKgU8sp3aSwwPv4jSPKlnuZxKwWtbKbCa0bYNeph4eNCgYdCIF/kWzEmBCPc9ksVeVkjaJPVdrA2lx/WpjoYqdtiglPLfnqj8lxKfEV8bP+cHbIo1kuGyfHUCGaZEKzrcJSS8xFwcdp+bGfyjCqVsxrvyjoqriyICcWKWRiFWEqQf0ID/mVsHa4MvhFrncNSmoLcZMf/2YU54HoLw3FuNAdgaAaOMq/ghLk+Ni+I8Eih1mA6cj/VNiQUnPJ8YmiTJga9LEe03j7RuhTefqP0CWd+mpEQcC7W8PWWaRJes8rA8rjKUm0mMwlDGagzbnDqVshMSZ9ZzxVSzMqEQqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TMKd8/MDDUFfjtmBHQ2S+wWVfGoeaqcv5Uv2kYxI5CY=; b=RPd8PU6MfewRgSnQOGXsjWyNTfRGenNrXLwFgpZUYb2WdqEuFVBnK08u43nCnCegLoL0dvXsKljw3bW+soqCzCinrmXpeK7CbfbMQ4MEQNwxUmOtoCoi2/Aa4m+ZbPcXZhyCAYx7JqPWPyecTF9OG4ua1Spo8Hb5Yb/0CNJ2q9U= Received: from BL0PR11MB3489.namprd11.prod.outlook.com (2603:10b6:208:75::29) by BL0PR11MB3395.namprd11.prod.outlook.com (2603:10b6:208:6c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Sun, 10 May 2020 01:39:16 +0000 Received: from BL0PR11MB3489.namprd11.prod.outlook.com ([fe80::d0f8:bfd7:bae2:3e42]) by BL0PR11MB3489.namprd11.prod.outlook.com ([fe80::d0f8:bfd7:bae2:3e42%7]) with mapi id 15.20.2979.033; Sun, 10 May 2020 01:39:16 +0000 From: "Nate DeSimone" To: "Desimone, Ashley E" , "devel@edk2.groups.io" CC: "Pandya, Puja" , "Bjorge, Erik C" , Bret Barkelew , "Agyeman, Prince" Subject: Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Update Create-Pin to be support multiple manifest repositories Thread-Topic: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Update Create-Pin to be support multiple manifest repositories Thread-Index: AQHWI/TzHln/CYFwLECETvPyTm88Waigjcpw Date: Sun, 10 May 2020 01:39:15 +0000 Message-ID: References: <20200506222249.19028-1-ashley.e.desimone@intel.com> <20200506222249.19028-2-ashley.e.desimone@intel.com> In-Reply-To: <20200506222249.19028-2-ashley.e.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmFhOTdlZDUtMzJjYS00NmRkLTkwNzctY2JhM2FjYTMyNmUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUmUxc1ltVDYraFdFZjluXC9CMXNoaFc1VmdjMHREcXExM25QWllNZllWODBsbEE2VUlkdzZ2cmZFbVlYNUdPYkoifQ== dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a30e435e-a457-4ae7-ad84-08d7f482f35b x-ms-traffictypediagnostic: BL0PR11MB3395: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:519; x-forefront-prvs: 039975700A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eOAIbDq2JADNi23tfTjauU/ugmWThPETLqhaFAIjHKfAfFGEPjZ60BgU9LPmCnOyIdsAkWFZvTntZ+pJK5zJfzre42Kfu5DsMgA/Y8VKxTxKJhpwwdQCTdgVvfPZuEY45iXEaPjCFUTSJpjf1lze29jZlBKSwHnfKrwDn3SIJlpDHkm35R6cZRXb5Y1VzGmP7TE7sea0KSJjDAbYUl8/L29BlGIZ2gnL7xFtH5TqaSQWSQbPDidEe/IuDgTo+0QInRU6/cWdkr5AXKkoZXVzA9FklrvI+4QjDymb+8AvK8rGb+1QxGElD5eBMdhtJQWfVuScOwUVXPZF8/GnUJfrFY/iW2KlMZq+7CIfqAZK2NIEudptyGXkaK9wjZhSwul2v/aL6gSgtQlkAtxLsY98kYbI2z5nZ6TIm48IwmAqIeKhtOxBApo4pF//UoSHPMxMdgl/9Z97DfqY/67/bSrJT70QwNOCpYh3ckW1yBmuGzuDfhDHPp0Xsaf0AZ4GG1xUHN3cVa4CH+YJRhBQQpbCEQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR11MB3489.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(366004)(136003)(376002)(396003)(39860400002)(346002)(33430700001)(66476007)(2906002)(76116006)(66446008)(110136005)(9686003)(66946007)(107886003)(52536014)(4326008)(15650500001)(55016002)(54906003)(26005)(8936002)(186003)(71200400001)(64756008)(33440700001)(6506007)(66556008)(5660300002)(316002)(478600001)(7696005)(8676002)(33656002)(86362001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: iTdwOZ6hhRvCt0fI1cSJYhUC18eYHqKu+gdL5222Laa5SD9bDqGabg6epJFkdr2yeL1V2RZIIhfw3U7fVolJL6ETZSzWnvE9vHFPYOREmRI37oMWHI6myTYivlVD14bT4XniA+O6YFA61z3qpeWmiggvvC3goDwICGDsKZgDbyo82wJmotv0NKfp1F5sJiy3NctP6d5VHsTql0Gj32i0A5r7AFMBEWKMLtzUOvraH8iAyZbvq7WD7UK/zBke0EaiJuk4CsSLtM3HGpwEaxTcjWHlBoZ9g81HxrYU5GFNKdYXBp7VqXlbZIddBpax1ensZgfwuqdZ0aqZPUTgirNAixia51m1Gib7JXsvUQPkJGbjkzd8tX+bCfxRHb89s2WMJuP/0JSOKE4AeFwWgaBjQ/lJld6oGGcB3d9A5co5pbcHZieS7CAOJ5yd22SraM114OVszIhPZkVCAXrKGK7LgtpI0k7hWYS6fQvvkAM6u40= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a30e435e-a457-4ae7-ad84-08d7f482f35b X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2020 01:39:15.7104 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W5cm5Xby+XbL6K52zgnXBelvZ8oTz0sMkQXFGoq+454OUkmhRdSV8DOwXA8WnKiPKwSOpMtwTf+/hIELYcWpwfqBz+zulH5ykyuSjWvb8Gs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3395 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ashley, Feedback inline below. Thanks, Nate > -----Original Message----- > From: Desimone, Ashley E > Sent: Wednesday, May 6, 2020 3:23 PM > To: devel@edk2.groups.io > Cc: Desimone, Nathaniel L ; Pandya, Puja > ; Bjorge, Erik C ; Bret > Barkelew ; Agyeman, Prince > > Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Update Create-Pin to be > support multiple manifest repositories >=20 > Update the create pin command to select and interact with only the > workspaces source manifest repository. >=20 > Signed-off-by: Ashley E Desimone > Cc: Nate DeSimone > Cc: Puja Pandya > Cc: Erik Bjorge > Cc: Bret Barkelew > Cc: Prince Agyeman > --- > edkrepo/commands/create_pin_command.py | 26 > ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) >=20 > diff --git a/edkrepo/commands/create_pin_command.py > b/edkrepo/commands/create_pin_command.py > index f8618e5..5b77649 100644 > --- a/edkrepo/commands/create_pin_command.py > +++ b/edkrepo/commands/create_pin_command.py > @@ -12,14 +12,16 @@ from collections import namedtuple >=20 > from git import Repo >=20 > -from edkrepo.commands.edkrepo_command import EdkrepoCommand > +from edkrepo.commands.edkrepo_command import EdkrepoCommand, > +SourceManifestRepoArgument > import edkrepo.commands.arguments.create_pin_args as arguments -from > edkrepo.common.common_repo_functions import > pull_latest_manifest_repo from edkrepo.common.edkrepo_exception > import EdkrepoManifestInvalidException, > EdkrepoInvalidParametersException from > edkrepo.common.edkrepo_exception import > EdkrepoWorkspaceCorruptException from edkrepo.common.humble import > WRITING_PIN_FILE, GENERATING_PIN_DATA, GENERATING_REPO_DATA, > BRANCH, COMMIT from edkrepo.common.humble import > COMMIT_MESSAGE, PIN_PATH_NOT_PRESENT, PIN_FILE_ALREADY_EXISTS, > PATH_AND_FILEPATH_USED from edkrepo.common.humble import > MISSING_REPO > +from > edkrepo.common.workspace_maintenance.manifest_repos_maintenance > +import find_project_in_all_indices from > +edkrepo.common.workspace_maintenance.manifest_repos_maintenance > import > +pull_workspace_manifest_repo from > +edkrepo.common.workspace_maintenance.humble.manifest_repos_main > tenance_ > +humble import PROJ_NOT_IN_REPO, > SOURCE_MANIFEST_REPO_NOT_FOUND > from edkrepo.config.config_factory import get_workspace_manifest, > get_workspace_path from edkrepo_manifest_parser.edk_manifest import > ManifestXml >=20 > @@ -49,6 +51,7 @@ class CreatePinCommand(EdkrepoCommand): > 'positional': False, > 'required': False, > 'help-text': arguments.PUSH_HELP}) > + args.append(SourceManifestRepoArgument) > return metadata >=20 > def run_command(self, args, config): > @@ -56,14 +59,25 @@ class CreatePinCommand(EdkrepoCommand): > if args.push and os.path.dirname(args.PinFileName): > raise > EdkrepoInvalidParametersException(PATH_AND_FILEPATH_USED) >=20 > - pull_latest_manifest_repo(args, config) > workspace_path =3D get_workspace_path() > manifest =3D get_workspace_manifest() >=20 > + manifest_repo, cfg, manifest_repo_path =3D > find_project_in_all_indices(manifest.project_info.codename, > + = config['cfg_file'], > + = config['user_cfg_file'], > + > PROJ_NOT_IN_REPO.format(manifest.project_info.codename), > + > SOURCE_MANIFEST_REPO_NOT_FOUND.format(manifest.project_info.cod > ename), > + = args.source_manifest_repo) > + pull_workspace_manifest_repo(manifest, config['cfg_file'], > + config['user_cfg_file'], args.source_manifest_repo, False) > + > + if 'user' not in cfg: > + manifest_repo_path =3D > config['cfg_file'].manifest_repo_abs_path(manifest_repo) > + else: > + manifest_repo_path =3D > + config['user_cfg_file'].manifest_repo_abs_path(manifest_repo) Please wrap this manifest repo update + manifest repo path retrieval code w= ith "if args.push". We only need to mess around with the manifest repo if w= e are actually going to push the pin file. If we are not pushing it, then d= on't bother. There are a bunch of corner cases that could happen here like = HTTP/SSH connections not working, loose manifest files, etc. that don't nee= d to work just to create the new XML file. This will also have the side ben= efit of significantly increasing the performance of this command if the pus= h flag is not given. > # If the push flag is enabled use general_config.pin_path to det= ermine > global manifest relative location to save > # pin file to. > if args.push and manifest.general_config.pin_path is not None: > - pin_dir =3D > os.path.join(config['cfg_file'].manifest_repo_abs_local_path, > os.path.normpath(manifest.general_config.pin_path)) > + pin_dir =3D os.path.join(manifest_repo_path, > + os.path.normpath(manifest.general_config.pin_path)) > pin_file_name =3D os.path.join(pin_dir, args.PinFileName) > elif args.push and manifest.general_config.pin_path is None: > raise EdkrepoManifestInvalidException(PIN_PATH_NOT_PRESENT) > @@ -104,7 +118,7 @@ class CreatePinCommand(EdkrepoCommand): >=20 > # commit and push the pin file > if args.push: > - manifest_repo =3D > Repo(config['cfg_file'].manifest_repo_abs_local_path) > + manifest_repo =3D Repo(manifest_repo_path) > # Create a local branch with the same name as the pin file a= rg and > check it out before attempting the push > # to master > master_branch =3D manifest_repo.active_branch @@ -124,4 +138= ,4 @@ > class CreatePinCommand(EdkrepoCommand): > manifest_repo.git.push('origin', 'HEAD:master') > finally: > manifest_repo.heads[master_branch.name].checkout() > - manifest_repo.delete_head(local_branch, '-D') > \ No newline at end of file > + manifest_repo.delete_head(local_branch, '-D') > -- > 2.16.2.windows.1