Skip to content

Commit

Permalink
Merge pull request Azure#4 from singankit/nirovins/merge_to_azure_main
Browse files Browse the repository at this point in the history
Merge to Azure main
  • Loading branch information
nick863 authored May 3, 2024
2 parents a364dfd + 9a2167a commit 0987af4
Show file tree
Hide file tree
Showing 2,100 changed files with 344,766 additions and 34,898 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/event-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20240311.2
--version 1.0.0-dev.20240502.2
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20240311.2
--version 1.0.0-dev.20240502.2
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-event-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20240311.2
--version 1.0.0-dev.20240502.2
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
Expand Down
10 changes: 9 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
"sdk/ml/azure-ai-ml/swagger/**",
"sdk/ml/azure-ai-ml/NOTICE.txt",
"sdk/ml/azure-ai-ml/.pre-commit-config.yaml",
"sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/_model_base.py",
"sdk/ml/azure-ai-ml/azure/ai/ml/entities/_autogen_entities/_serialization.py",
"sdk/monitor/azure-monitor-opentelemetry/samples/tracing/django/sample/db.sqlite3",
"sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/django/sample/db.sqlite3",
"sdk/loadtestservice/azure-developer-loadtesting/**",
Expand Down Expand Up @@ -1712,11 +1714,17 @@
]
},
{
"filename": "sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/_client.py",
"filename": "sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/**/_client.py",
"words": [
"awps"
]
},
{
"filename": "sdk/webpubsub/azure-messaging-webpubsubclient/stress/*.py",
"words": [
"psutil"
]
},
{
"filename": "sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/*.py",
"words": [
Expand Down
22 changes: 16 additions & 6 deletions doc/deprecation_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This page describes how to mark a package deprecated on PyPI. You likely need to
they shouldn't use the package you used to release anymore.

The overall idea is that PyPI do not support an official deprecation logic. We concluded that the best way was:
- Change the classifier as Inactive, to showcase in metadata that this package is longer worked on
- Add a disclaimer on the main Readme file to explain deprecation, and guide to migration guide to other package as necessary
- Push a [post release](https://peps.python.org/pep-0440/#post-releases) to PyPI
- Change the classifier as `Inactive`, to showcase in metadata that this package is longer worked on
- Add a disclaimer on the main Readme file to explain deprecation, and guide to migration guide to other package as necessary. While a migration guide should always be written, you may decide to postpone this work based on downloads numbers (found on [pypistats](https://pypistats.org/), [pype.tech](https://www.pepy.tech/), etc.) and internal knowledge of the usage of the package.
- Push a new release to PyPI

**Important Note**: The best versioning approach would be to do a [post release](https://peps.python.org/pep-0440/#post-releases). However, due to some tooling issues at the moment, currently version should be the next beta, or the next patch version ([example](https://github.com/Azure/azure-sdk-for-python/commit/cf3bfed65a65fcbb4b5c93db89a221c2959c5bb4)). Follow those issues for details https://github.com/Azure/azure-sdk/issues/7479 and https://github.com/Azure/azure-sdk-tools/issues/5916.

# Step 1: Update in the repository

Expand All @@ -19,15 +21,23 @@ Clone the repository and udpate the following files of your package:
>
> For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/my-new-package).
- `CHANGELOG.MD` add a new post version with the current date, and the same disclaimer. For instance
- `CHANGELOG.MD` add a new version with the current date, and the same disclaimer. For instance

> ## 1.2.3.post1 (2023-03-31)
>
> This package is no longer being maintained. Use the [azure-mynewpackage](https://pypi.org/project/azure-mynewpackage/) package instead.
>
> For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/my-new-package).
or

> ## 1.2.4 (2023-03-31)
>
> This package is no longer being maintained. Use the [azure-mynewpackage](https://pypi.org/project/azure-mynewpackage/) package instead.
>
> For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/my-new-package).
- `azure/mypackage/_version.py` : Change the version to the one used in the changelog (for instance `"1.2.3.post1"`). This file may be called `version.py` if your package is very old.
- `azure/mypackage/_version.py` : Change the version to the one used in the changelog (for instance `"1.2.3.post1"` or `"1.2.4"`). This file may be called `version.py` if your package is very old.
- `sdk_packaging.toml` : You need to add `auto_update = false` if not already present to avoid the bot overriding your changes
- `setup.py` change the `Development Status` classifier to `Development Status :: 7 - Inactive`. **Important: This needs to be your LAST commit on the PR. More on this at the bottom of this page if you want details.**.

Expand All @@ -44,5 +54,5 @@ Once the PR is merged, move to the next step.

A release here is the same as usual, triggering the release pipeline of you SDK. More instruction can be found at: https://aka.ms/azsdk/release-checklist

**Important Note**: As CI don't build Inactive projects right now, you can't build and release. This is a classical chicken and egg problem: we don't want to lose time on testing Inactive projects, but you need at least have one run of build to release the Inactive project. It's important then to pass the variable "BUILD_INACTIVE=true" while triggering the release pipeline. But doing this may uncover issues that were not seen in your initial PR as the CI was disabled. To avoid most of those problems, it's highly recommended that you put the commit with "Inactive" LAST in your PR. In other words, push all changes to Readme and ChangeLog, wait to confirm the CI is green, and when everything is clean, push finally "Inactive" in the `setup.py`
**Important Note**: As CI don't build Inactive projects right now, you can't build and release. This is a classical chicken and egg problem: we don't want to lose time on testing Inactive projects, but you need at least have one run of build to release the Inactive project. It's important then to pass the variable `"BUILD_INACTIVE=true"` while triggering the release pipeline. But doing this may uncover issues that were not seen in your initial PR as the CI was disabled. To avoid most of those problems, it's highly recommended that you put the commit with "Inactive" LAST in your PR. In other words, push all changes to Readme and ChangeLog, wait to confirm the CI is green, and when everything is clean, push finally "Inactive" in the `setup.py`

Binary file added doc/dev/private_package/auto_gen_PR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion doc/dev/private_package/get_private_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ If there is no link in the figure above, it may be folded. You can also find it

![img.png](unreleased_package_guide_example3.png)

## 5.Build private package locally (backup solution)

Because of security issue, maybe there is no private link to download. Since there is still auto generated PR provided, you can build the private package locally based on the PR with [guidance](https://github.com/Azure/azure-sdk-for-python/wiki/Common-issues-about-Python-SDK#build-private-package-with-pr)

![img.png](auto_gen_PR.png)

# Note

## 1.private repo

In private repo [Azure/azure-rest-api-specs-pr](https://github.com/Azure/azure-rest-api-specs-pr), pipeline can be triggered **only when the target branch is `main`**

11 changes: 5 additions & 6 deletions eng/common/scripts/Update-DocsMsMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ function GetPackageInfoJson ($packageInfoJsonLocation) {
return $packageInfo
}

function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
$packageInfo = GetPackageInfoJson $packageInfoJsonLocation
function UpdateDocsMsMetadataForPackage($packageInfo, $packageMetadataName) {

$originalVersion = [AzureEngSemanticVersion]::ParseVersionString($packageInfo.Version)
$packageMetadataArray = (Get-CSVMetadata).Where({ $_.Package -eq $packageInfo.Name -and $_.Hide -ne 'true' -and $_.New -eq 'true' })
Expand All @@ -150,7 +149,6 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
$metadataMoniker = 'preview'
$readMePath = $docsMsMetadata.PreviewReadMeLocation
}
$packageMetadataName = Split-Path $packageInfoJsonLocation -Leaf
$packageInfoLocation = Join-Path $DocRepoLocation "metadata/$metadataMoniker"
if (Test-Path "$packageInfoLocation/$packageMetadataName") {
Write-Host "The docs metadata json $packageMetadataName exists, updating..."
Expand Down Expand Up @@ -193,10 +191,10 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
$allSucceeded = $true
foreach ($packageInfoLocation in $PackageInfoJsonLocations) {

$packageInfo = GetPackageInfoJson $packageInfoLocation

if ($ValidateDocsMsPackagesFn -and (Test-Path "Function:$ValidateDocsMsPackagesFn")) {
Write-Host "Validating the packages..."

$packageInfo = GetPackageInfoJson $packageInfoLocation
# This calls a function named "Validate-${Language}-DocMsPackages"
# declared in common.ps1, implemented in Language-Settings.ps1
$isValid = &$ValidateDocsMsPackagesFn `
Expand All @@ -216,8 +214,9 @@ foreach ($packageInfoLocation in $PackageInfoJsonLocations) {
}

Write-Host "Updating metadata for package: $packageInfoLocation"
$packageMetadataName = Split-Path $packageInfoLocation -Leaf
# Convert package metadata json file to metadata json property.
UpdateDocsMsMetadataForPackage $packageInfoLocation
UpdateDocsMsMetadataForPackage $packageInfo $packageMetadataName
}

# Set a variable which will be used by the pipeline later to fail the build if
Expand Down
40 changes: 0 additions & 40 deletions eng/common/testproxy/test-proxy-docker.yml

This file was deleted.

12 changes: 11 additions & 1 deletion eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ steps:
pwsh: true

- pwsh: |
$version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim()
$standardVersion = "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt"
$overrideVersion = "${{ parameters.templateRoot }}/eng/target_proxy_version.txt"
$version = $(Get-Content $standardVersion -Raw).Trim()
if (Test-Path $overrideVersion) {
$version = $(Get-Content $overrideVersion -Raw).Trim()
}
Write-Host "Installing test-proxy version $version"
dotnet tool install azure.sdk.tools.testproxy `
--tool-path $(Build.BinariesDirectory)/test-proxy `
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
Expand Down
70 changes: 35 additions & 35 deletions eng/emitter-package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0987af4

Please sign in to comment.