From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web09.15223.1605409011676126224 for ; Sat, 14 Nov 2020 18:56:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=sm1p3TIC; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: YYRDV7rL0QK29YUz4ulx0YSSkacX7doa+mSUzkFVS7wiX13VBVEMgDQnujgi8GCi5iGjUS6zMS l7tysPhbZ9mw== X-IronPort-AV: E=McAfee;i="6000,8403,9805"; a="170717724" X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="170717724" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2020 18:56:48 -0800 IronPort-SDR: Wo5cyHWxSKNa2dJYM4yYf8fEa3vlpcEjGXmI1OYkAGcYQ2keTi0kKBAq1iWZbisJ0tw5vzd0yU RE29SnWPeYTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="367126686" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 14 Nov 2020 18:56:48 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 14 Nov 2020 18:56:48 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 14 Nov 2020 18:56:48 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sat, 14 Nov 2020 18:56:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LbhA4dLJEo1fECKFBbKwskmT+q1hYOhCCpap4CWiZO6oBG1aUndZIfzptYanm87hOaX3YJQITvlG/fASv7Epr8zNvFbrnKwLGrfFoQOMRoXID/TmEVJGEV94rh2RGdkbAmlukXpLXFdZrlDJMM/UpScTzTfO/QDWXSduUgc3NwX2emtfLM6diN0vzrHb1JZQsb35QEm++x/09zkAehPsL9RJ9+1wRTx7kaGPweZGA2cNEBNd9hzjiTl5KlqLEmJkV420RuCjRuc6JKp6GEkSMMiHHEMvRmh8EA+fmymah2MJds5un4bJLfuMYXy/MZrD7F9LO+/e8/HsqGpqqzMjNA== 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=13ZVuAjxcb0KxB3+SM7CaAggD8lbAhYbWOigWTipenE=; b=FX/5RsBlpagktwmmkhMf7qU0iYU8XImJ657N/fw4gdA0vxZjtndhdpAo2rkvQet7Y/PNfo+oSYLhblz6rKJIfgBUVqokRJ+0VdE9ePbYLZDMyk8GxYLtS+lXRL7hN13EsXRlzSQ04JkAMREcuninUGGA2CQiaN/BFrp0gPEXGjZx3bFBQ1btImflxVWmEX/tp7S2r58SW467dYWQwhw1Yu/LfyOpVEmU/4rzgbt7mZjmExBfUk57cBQ76ybCGJvNcl7ZLA5kifTPFaW2YhqOs1lPjMqVWCJY4+i8Kfc29yoIi0LRbNrG/qkK7RQYEW6XuG2CzWW0VixyXNeqCvxLHA== 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=13ZVuAjxcb0KxB3+SM7CaAggD8lbAhYbWOigWTipenE=; b=sm1p3TICerCU7P/S2dZf21ba28aSgo8bHYRkI+H5EeIOsAK6qBG+v22ZV8QwZIRj6e4EjbXbtgs0MiqiMvOph7z8rlq7jEgYrQG9zdodOCxPokOH1xXjB8+ONbnVulNOY7niTp+8Q4SjaBXqiOZPH5tqnEDcEomCuwxf6eh88zw= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MWHPR11MB1918.namprd11.prod.outlook.com (2603:10b6:300:110::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Sun, 15 Nov 2020 02:56:43 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::3161:c00f:c5c5:f710]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::3161:c00f:c5c5:f710%8]) with mapi id 15.20.3564.028; Sun, 15 Nov 2020 02:56:43 +0000 From: "Nate DeSimone" To: "Desimone, Ashley E" , "devel@edk2.groups.io" CC: "Pandya, Puja" , Bret Barkelew , "Agyeman, Prince" , "Bjorge, Erik C" Subject: Re: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused checkout sha functionality Thread-Topic: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused checkout sha functionality Thread-Index: AQHWuHo0WjI9XbBbxUO6nQCO7krWaKnIhOkA Date: Sun, 15 Nov 2020 02:56:43 +0000 Message-ID: References: <20201111222939.1433-1-ashley.e.desimone@intel.com> In-Reply-To: <20201111222939.1433-1-ashley.e.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: 5d1d8471-b8bd-476c-4b83-08d889121576 x-ms-traffictypediagnostic: MWHPR11MB1918: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cty8MgFAl1R5me0B+Ghs9itKo0f07d5UYWRKOaaGzkCzRVNv0ZYmiJBmgzgsQaO3y7DyE1fUTb2a32GZjkKNPlHsTHpEuxvt5nBuUYyZXxmG9M8e7+i87hG9zemzZUUTLUYueOIfCtpsHvXuYUoJW0GxbIrdOPCZUcS694x/GDnt0GcGqHg3MbMk09ZpU8d8iNkzVt0mu722oCJOlVDhwBnFB6V7X6dC8Ci7i8Fw612+my1GlCTviltvVcVruakyBxYRrkbDOddVqbz+zXBlkJ7tEV75cHrMZhBJm5THxaq3bmV6uYEtHfDi9sZ0wRQ6SI9ZY/cWB9EW7RSKHtNuxGkLLAo1q8w67xrsNkmkhSY1pMI9gyDpFvzNcQ/rOPH7THGWHh44ZkG8QXWKL3fd4g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(366004)(136003)(346002)(376002)(39860400002)(316002)(55016002)(107886003)(54906003)(7696005)(9686003)(110136005)(478600001)(966005)(26005)(186003)(6506007)(86362001)(53546011)(33656002)(52536014)(83380400001)(66946007)(66476007)(66556008)(66446008)(2906002)(64756008)(76116006)(8936002)(4326008)(5660300002)(8676002)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 5Iq+rcPB3ZgE4H3I+E5P2DK1HP3WR+axgmBU+f4QFLbshJGZLDEodLZYzxkuxUq9DfRzoGgN/IdCxs+uBjGjABnwyxan8b5EAELEsh2Cjq3Ydb+TSb0g8aSPfJiL4bVSkfv7wK6REYVm7vL2ZbsI0hYwH8SHN6i6qOz1GtwpWbcSPRNhkOd3Wd1RysSmQHSNZI4OY1iE++YJ8LwdgHFjPLpt7FDybK8HigvmD3e6+7NM/HwW6Ee470Y6kpsFv+OfcFbAsLzOZiwLpBGupHsw6QmRVRHy+37Si1NjXz8yJfdnvJeCmDD966vmsihbPKjf4XDiSjjC0gEhPYoP7zy2oyTnWmrd9vViX/3g0L0g9Bsa1/3pPpt9tczaylH20s4Eo4bYCKzx+CPSjlMfigmVSi3cdbNlESr3NnMeN2PxNrn+YIE/BuSZN0OgPhQ0O8RnO44DQl9aFnNO/yH2GN2HCeA4WzBv388v045ha2UpGc83SMDbqs6GI1CizfOpsWu3GGPFSltUJmWGy/Swk6og8K70tzHXnCurDw9BwzmeAnD4Q2jHi671oiL+B8CgaH0mAB9Nrocf34txxxYE5oD1bRBULesHBKL4tmmpQ4Yr0yp7lLfGdgjtHGenV0lZ7lDFpt9bgFkNc4Twvq1N1bOPFm9BWCfYwaBMzC2hpZAQDtwRQvQZ+uIBHiuXOXrllJwzzv9N9tfC2Jo8uq7wNqUoqYlii/wyG1apttht9y28SpY7jv1E7Z2qi7JlDI/7xAqBRD12i4xZmcKkna7iiCuP8zRAyHAkNNYlLDAcr7J+YZ9xAMeJO+BkL2OiWl/Om5TrSSOVgjNwHVuD4y0iIyq9IBDdVKRmlw8m2UTQFHUQ8U1645H1MrrCpHCwT59Jaff14Ic+UxhgzMTGJuJYOmmP5w== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d1d8471-b8bd-476c-4b83-08d889121576 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Nov 2020 02:56:43.3776 (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: Ce4PZNct6zd7RJmQQFXm0YHIGpo5HprcF80axsVTuyizmzejf77204mc/72BXOB+zrq8SBJGzu2MqjFBdg4WNdInxHeye1qrpf0c8RLiOUo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1918 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 Pushed: https://github.com/tianocore/edk2-staging/commit/0777b85 > -----Original Message----- > From: Ashley E Desimone > Sent: Wednesday, November 11, 2020 2:30 PM > To: devel@edk2.groups.io > Cc: Desimone, Nathaniel L ; Pandya, Puja > ; Bret Barkelew ; > Agyeman, Prince ; Bjorge, Erik C > > Subject: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused > checkout sha functionality >=20 > The SHA parameter for the checkout command has been removed > previously. This commit removes the calculations which supported this > functionality and amends the checkout function to raise an > EdkRepoInvalidParameters exception if a valid combo name is not passed in= . >=20 > Cc: Ashley E Desimone > Cc: Nate DeSimone > Cc: Puja Pandya > Cc: Bret Barkelew > Cc: Prince Agyeman > Cc: Erik Bjorge > Signed-off-by: Ashley E Desimone > --- > edkrepo/common/common_repo_functions.py | 78 ++++--------------------- > 1 file changed, 12 insertions(+), 66 deletions(-) >=20 > diff --git a/edkrepo/common/common_repo_functions.py > b/edkrepo/common/common_repo_functions.py > index 0d54bbf..2277c1e 100644 > --- a/edkrepo/common/common_repo_functions.py > +++ b/edkrepo/common/common_repo_functions.py > @@ -427,76 +427,22 @@ def combination_is_in_manifest(combination, > manifest): > return combination in combination_names >=20 >=20 > -def get_target_sources(combination_or_sha, manifest, workspace_path, > log=3DNone): > - if combination_is_in_manifest(combination_or_sha, manifest): > - return manifest.get_repo_sources(combination_or_sha) > - > - current_combo =3D manifest.general_config.current_combo > - # look for a pin file that is named combination_or_sha.xml > - pin_filename =3D os.path.join( > - workspace_path, > - 'repo', > - combination_or_sha+'.xml') > - if os.path.exists(pin_filename): > - return ManifestXml(pin_filename).get_repo_sources(current_combo) > - > - print ("Search repositories for '{}'".format(combination_or_sha)) > - commit_map =3D { > - x.root : None > - for x in manifest.get_repo_sources(current_combo) > - } > - found =3D False > - if not log: > - log =3D sort_commits(manifest, workspace_path) > - for commit in log: > - root =3D os.path.basename(commit.repo.working_dir) > - if combination_or_sha =3D=3D commit.hexsha: > - found =3D True > - commit_map[root] =3D commit.hexsha > - continue > - if not found: > - continue > - if not commit_map[root]: > - commit_map[root] =3D commit.hexsha > - if not found: > - raise > EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO) > - > - # Create a new pin file > - old_sources =3D manifest.get_repo_sources(current_combo) > - new_sources =3D [] > - for repo_source in old_sources: > - new_sources.append( > - repo_source._replace(commit=3Dcommit_map[repo_source.root])) > - manifest.generate_pin_xml( > - combination_or_sha, > - current_combo, > - new_sources, > - filename=3Dpin_filename) > - > - return ManifestXml(pin_filename).get_repo_sources(current_combo) > - > - > -def checkout(combination_or_sha, verbose=3DFalse, override=3DFalse, > log=3DNone): > +def checkout(combination, verbose=3DFalse, override=3DFalse, log=3DNone)= : > workspace_path =3D get_workspace_path() > manifest =3D get_workspace_manifest() >=20 > - # Create combo_or_sha so we have original input and do not introduce > any > + # Create combo so we have original input and do not introduce any > # unintended behavior by messing with parameters. > - combo_or_sha =3D combination_or_sha > + combo =3D combination > submodule_combo =3D manifest.general_config.current_combo > try: > # Try to handle normalize combo name to match the manifest file. > - combo_or_sha =3D case_insensitive_single_match(combo_or_sha, > combinations_in_manifest(manifest)) > - submodule_combo =3D combo_or_sha > + combo =3D case_insensitive_single_match(combo, > combinations_in_manifest(manifest)) > + submodule_combo =3D combo > except: > - # No match so leave it alone. It must be a SHA1 or a bad combo = name. > - pass > + raise > EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO) >=20 > - repo_sources =3D get_target_sources( > - combo_or_sha, > - manifest, > - workspace_path, > - log=3Dlog) > + repo_sources =3D manifest.get_repo_sources(combo) > initial_repo_sources =3D > manifest.get_repo_sources(manifest.general_config.current_combo) >=20 > # Disable sparse checkout > @@ -523,7 +469,7 @@ def checkout(combination_or_sha, verbose=3DFalse, > override=3DFalse, log=3DNone): >=20 > # Deinit all submodules due to the potential for issues when switchi= ng > # branches. > - if combo_or_sha !=3D manifest.general_config.current_combo: > + if combo !=3D manifest.general_config.current_combo: > try: > deinit_full(workspace_path, manifest, verbose) > except Exception as e: > @@ -531,19 +477,19 @@ def checkout(combination_or_sha, verbose=3DFalse, > override=3DFalse, log=3DNone): > if verbose: > print(e) >=20 > - print(CHECKING_OUT_COMBO.format(combo_or_sha)) > + print(CHECKING_OUT_COMBO.format(combo)) >=20 > try: > checkout_repos(verbose, override, repo_sources, workspace_path, > manifest) > current_repos =3D repo_sources > # Update the current checkout combo in the manifest only if this > # combination exists in the manifest > - if combination_is_in_manifest(combo_or_sha, manifest): > - manifest.write_current_combo(combo_or_sha) > + if combination_is_in_manifest(combo, manifest): > + manifest.write_current_combo(combo) > except: > if verbose: > traceback.print_exc() > - print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo_or_sha)) > + print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo)) > # Return to the initial combo, since there was an issue with che= king out > the selected combo > checkout_repos(verbose, override, initial_repo_sources, > workspace_path, manifest) > finally: > -- > 2.26.2.windows.1