Skip to content

Commit

Permalink
track1 pakcage filter (#18124)
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc authored Apr 19, 2021
1 parent 1051a43 commit eae413d
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions tools/azure-sdk-tools/packaging_tools/code_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,106 @@ def merge_report(report_paths):
merged_report["operations"].update(report_json["operations"])
return merged_report

def filter_track2_versions(package_name, versions):
from packaging import version
track2_versions = {
'azure-mgmt-appconfiguration': '1.0.0b1',
'azure-mgmt-compute': '17.0.0b1',
'azure-mgmt-eventhub': '8.0.0b1',
'azure-mgmt-keyvault': '7.0.0b1',
'azure-mgmt-monitor': '1.0.0b1',
'azure-mgmt-network': '16.0.0b1',
'azure-mgmt-resource': '15.0.0b1',
'azure-mgmt-storage': '16.0.0b1',
'azure-mgmt-containerservice': '14.0.0b1',
'azure-mgmt-web': '1.0.0b1',
'azure-mgmt-authorization': '1.0.0b1',
'azure-mgmt-servicebus': '6.0.0b1',
'azure-mgmt-cosmosdb': '6.0.0b1',
'azure-mgmt-sql': '1.0.0b1',
'azure-mgmt-redis': '12.0.0b1',
'azure-mgmt-containerregistry': '8.0.0b1',
'azure-mgmt-containerinstance': '7.0.0b1',
'azure-mgmt-resourcegraph': '7.0.0b1',
'azure-mgmt-subscription': '1.0.0b1',
'azure-mgmt-operationsmanagement': '1.0.0b1',
'azure-mgmt-datafactory': '1.0.0b1',
'azure-mgmt-rdbms': '7.0.0b1',
'azure-mgmt-loganalytics': '7.0.0b1',
'azure-mgmt-automation': '1.0.0b1',
'azure-mgmt-recoveryservices': '1.0.0b1',
'azure-mgmt-iothub': '1.0.0b1',
'azure-mgmt-logic': '9.0.0b1',
'azure-mgmt-hdinsight': '7.0.0b1',
'azure-mgmt-machinelearningservices': '1.0.0b1',
'azure-mgmt-datalake-store': '1.0.0b1',
'azure-mgmt-cdn': '10.0.0b1',
'azure-mgmt-devtestlabs': '9.0.0b1',
'azure-mgmt-apimanagement': '1.0.0b1',
'azure-mgmt-eventgrid': '8.0.0b1',
'azure-mgmt-consumption': '8.0.0b1',
'azure-mgmt-marketplaceordering': '1.0.0b1',
'azure-mgmt-advisor': '9.0.0b1',
'azure-mgmt-cognitiveservices': '11.0.0b1',
'azure-mgmt-security': '1.0.0b1',
'azure-mgmt-relay': '1.0.0b1',
'azure-mgmt-notificationhubs': '7.0.0b1',
'azure-mgmt-search': '8.0.0b1',
'azure-mgmt-policyinsights': '1.0.0b1',
'azure-mgmt-batch': '14.0.0b1',
'azure-mgmt-scheduler': '7.0.0b1',
'azure-mgmt-commerce': '6.0.0b1',
'azure-mgmt-alertsmanagement': '1.0.0b1',
'azure-mgmt-billing': '6.0.0b1',
'azure-mgmt-botservice': '1.0.0b1',
'azure-mgmt-costmanagement': '1.0.0b1',
'azure-mgmt-databox': '1.0.0b1',
'azure-mgmt-databricks': '1.0.0b1',
'azure-mgmt-deploymentmanager': '1.0.0b1',
'azure-mgmt-kusto': '1.0.0b1',
'azure-mgmt-labservices': '1.0.0b1',
'azure-mgmt-maps': '1.0.0b1',
'azure-mgmt-media': '7.0.0b1',
'azure-mgmt-netapp': '1.0.0b1',
'azure-mgmt-powerbidedicated': '1.0.0b1',
'azure-mgmt-servicefabric': '1.0.0b1',
'azure-mgmt-signalr': '1.0.0b1',
'azure-mgmt-support': '6.0.0b1',
'azure-mgmt-storagesync': '1.0.0b1',
'azure-mgmt-appplatform': '6.0.0b1',
'azure-mgmt-attestation': '1.0.0b1',
'azure-mgmt-azurestack': '1.0.0b1',
'azure-mgmt-customproviders': '1.0.0b1',
'azure-mgmt-datashare': '1.0.0b1',
'azure-mgmt-hanaonazure': '1.0.0b1',
'azure-mgmt-healthcareapis': '1.0.0b1',
'azure-mgmt-hybridcompute': '7.0.0b1',
'azure-mgmt-maintenance': '1.0.0b1',
'azure-mgmt-managedservices': '6.0.0b1',
'azure-mgmt-peering': '1.0.0b1',
'azure-mgmt-automanage': '1.0.0b1',
'azure-mgmt-applicationinsights': '1.0.0b1',
'azure-mgmt-azurestackhci': '6.0.0b1',
'azure-mgmt-databoxedge': '1.0.0b1',
'azure-mgmt-hybridkubernetes': '1.0.0b1',
'azure-mgmt-managementgroups': '1.0.0b1',
'azure-mgmt-resourcemover': '1.0.1b1',
'azure-mgmt-synapse': '1.0.0b1',
'azure-mgmt-datamigration': '9.0.0b1',
'azure-mgmt-timeseriesinsights': '1.0.0b1',
'azure-mgmt-mixedreality': '1.0.0b1',
'azure-mgmt-kubernetesconfiguration': '1.0.0b1',
'azure-mgmt-reservations': '1.0.0b1',
'azure-mgmt-managementpartner': '1.0.0b1',
'azure-mgmt-redhatopenshift': '1.0.0b1',
'azure-mgmt-serialconsole': '1.0.0b1',
'azure-mgmt-portal': '1.0.0b1'
}
upbound = track2_versions.get(package_name)
if not upbound:
return versions
return list(filter(lambda x: version.parse(x) < version.parse(upbound), versions))

def main(
input_parameter: str,
version: Optional[str] = None,
Expand Down Expand Up @@ -178,6 +278,7 @@ def main(
_LOGGER.info(f"Got {versions}")
if last_pypi:
_LOGGER.info(f"Only keep last PyPI version")
versions = filter_track2_versions(package_name, versions)
versions = [versions[-1]]

for version in versions:
Expand Down

0 comments on commit eae413d

Please sign in to comment.