Skip to content

Skip vnext issue creation for deprecated packages#47915

Open
l0lawrence wants to merge 6 commits into
Azure:mainfrom
l0lawrence:l0lawrence-skip-next-checks-deprecated
Open

Skip vnext issue creation for deprecated packages#47915
l0lawrence wants to merge 6 commits into
Azure:mainfrom
l0lawrence:l0lawrence-skip-next-checks-deprecated

Conversation

@l0lawrence

@l0lawrence l0lawrence commented Jul 7, 2026

Copy link
Copy Markdown
Member

Problem

Two related issues with the vnext (next-*) issue automation in eng/tools/azure-sdk-tools/gh_tools/vnext_issue_creator.py:

1. Issues created against deprecated packages

Deprecated/inactive packages (marked with Development Status :: 7 - Inactive) that still have an existing tests-weekly pipeline were getting next-* (mypy/pyright/pylint/sphinx) issues auto-created against them. See #39143 (azure-mgmt-mixedreality). The only existing guard before creating a vnext issue was is_typing_ignored, which does not account for deprecation status.

2. Duplicate issues created every run

The dedup lookup filtered on creator="azure-sdk", but the automation now runs as the azure-sdk-automation[bot] GitHub App. That filter never matched the bot's existing issues, so the "does an issue already exist?" check always came back empty and a brand new duplicate was created on every run (e.g. #47836 and #47839 for azure-ai-textanalytics).

Fix

Deprecation guard

  • Added is_package_deprecated(package_dir) helper that reuses the repo's existing ParsedSetup.from_path + is_package_active logic (which honors the Inactive classifier and ENABLE_<PKG> overrides).
  • Added a guard at the top of create_vnext_issue that, for deprecated packages, skips issue creation, closes any pre-existing vnext issue, and returns.

This centrally covers all callers (mypy.py, pylint.py, pyright.py, sphinx.py).

Duplicate de-duplication

  • Added VNEXT_ISSUE_CREATORS = ["azure-sdk", "azure-sdk-automation[bot]"] and a shared find_vnext_issues() helper that matches open issues by label + title and creator login, across both automation identities. Filtering by creator (rather than title alone) still protects human-opened issues with the same title.
  • create_vnext_issue now updates the newest matching issue and closes older duplicates, converging on a single issue (so the existing duplicate pairs will self-heal on the next run).
  • close_vnext_issue now closes all matching duplicates, not just the first.

Tests

Added tests/test_vnext_issue_creator.py (10 tests, all passing):

  • is_package_deprecated across classifier combinations + parse-failure fallback.
  • create_vnext_issue short-circuits and closes any existing issue for deprecated packages; still proceeds/creates issues for active packages.
  • find_vnext_issues matches all automation creators and ignores human-opened / other-package issues.
  • close_vnext_issue closes all duplicates.
  • create_vnext_issue updates the newest issue and closes older duplicates.

Black passes with the repo config (eng/black-pyproject.toml).

Fixes #39143

l0lawrence and others added 2 commits April 23, 2026 16:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deprecated/inactive packages (Development Status :: 7 - Inactive) that
still have a tests-weekly pipeline were getting next-* issues auto-created.
Add a deprecation guard in create_vnext_issue that skips issue creation
and closes any existing issue for inactive packages.

Fixes Azure#39143

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the vnext issue automation in eng/tools/azure-sdk-tools to avoid auto-creating next-* GitHub issues for packages marked inactive/deprecated (via Development Status :: 7 - Inactive), and adds unit tests for the new behavior.

Changes:

  • Added is_package_deprecated() (backed by ParsedSetup.from_path + is_package_active) to detect inactive packages.
  • Added an early-exit in create_vnext_issue() to skip issue creation for inactive packages and close any existing vnext issue.
  • Added a new test module for the new helper and short-circuit behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
sdk/transcription/azure-ai-transcription/pyproject.toml Flips verifytypes from false to true (appears unrelated to vnext issue creation behavior).
eng/tools/azure-sdk-tools/tests/test_vnext_issue_creator.py Adds tests for the new deprecation/inactive package guard and helper.
eng/tools/azure-sdk-tools/gh_tools/vnext_issue_creator.py Introduces inactive-package detection and short-circuit/close behavior in create_vnext_issue().

Comment on lines +31 to +34
def is_package_deprecated(package_dir: str) -> bool:
"""Returns True if the package is deprecated/inactive (e.g. carries the
'Development Status :: 7 - Inactive' classifier). Deprecated packages should
not have vnext issues created against them."""
Comment on lines +28 to +31
def test_is_package_deprecated(classifiers, expected_deprecated):
parsed = _FakeParsedSetup("azure-mgmt-fake", classifiers)
with mock.patch.object(vnext_issue_creator.ParsedSetup, "from_path", return_value=parsed):
assert vnext_issue_creator.is_package_deprecated("some/path") is expected_deprecated
Comment on lines +47 to +48
# No GitHub client should be constructed when short-circuiting on a deprecated package.
mock_github.assert_not_called()
Comment on lines +63 to +64
[tool.azure-sdk-build]
verifytypes = false
verifytypes = true
Comment on lines +1 to +10
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from unittest import mock

import pytest

from gh_tools import vnext_issue_creator
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
l0lawrence and others added 3 commits July 7, 2026 09:23
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The dedup lookup filtered on creator=azure-sdk, but the automation now runs
as the azure-sdk-automation[bot] GitHub App. That filter never matched the
bot's existing issues, so a new duplicate was created on every run.

Match issues from all known automation creators (azure-sdk and
azure-sdk-automation[bot]) via a shared find_vnext_issues helper, update the
newest existing issue, and close any older duplicates. close_vnext_issue now
closes all matching duplicates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azure-mgmt-mixedreality needs typing updates for mypy version 1.19.1

2 participants