Add azpysdk changelog command group wrapping Chronus#46016
Conversation
azpysdk changelog command group wrapping Chronus
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
This should also support breaking changes — e.g. a |
|
Added in f63e08c. Examples: azpysdk changelog add --kind breaking -m "Removed deprecated API"
azpysdk changelog add sdk/core/azure-core -k feature -m "Added new endpoint"If Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot There are several issues to fix in this PR: 1. Read
|
All four fixes applied in 358c1c6:
45 tests passing. |
|
@copilot if the user does not have chronus installed, install it for them and log it |
…iscovery Two CI failures on PR #46016: 1. static-analysis (black): changelog.py and test_changelog_commands.py failed 'black --check'. Applied black with the repo's eng/black-pyproject.toml config. 2. verify-azpysdk-checks: the workflow discovers checks by scraping 'azpysdk -h' and invokes each one as 'azpysdk <check> --isolate <package>'. The changelog command group rejects --isolate (it's a developer tool wrapping Chronus, not a per-package check) and exits 2. Filter 'changelog' out of the discovery pipeline, same way 'next-*' checks are already filtered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds `azpysdk changelog {add,verify,create,status}` subcommands that
delegate to `npx chronus` at the repository root, enabling developers
to manage changelogs without leaving the azpysdk CLI.
Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/a188ee1e-f36a-4ca9-be34-654196dd5328
Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
When running `azpysdk changelog add` from within a package directory (e.g. sdk/storage/azure-storage-blob), the package path is now detected automatically and passed to chronus. An explicit package argument still takes precedence. Chronus itself always runs from the repo root. Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/758fb61b-770f-40c1-91a6-108220c6a402 Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Add --kind (-k) and --message (-m) flags to `azpysdk changelog add` that forward to chronus's native --kind and --message options. This lets developers tag entries as breaking (or any other change kind) non-interactively: azpysdk changelog add --kind breaking -m "Removed deprecated API" azpysdk changelog add -k feature -m "Added new endpoint" Valid kinds: breaking, feature, deprecation, fix, dependencies, internal Also fix _ensure_chronus_installed to skip the interactive prompt when stdin is not a TTY (non-interactive / CI environments). Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/aa3dee26-9283-4594-a49f-64fc64d3d995 Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
…ct attr access, parser on instance 1. Read _CHANGE_KINDS from .chronus/config.yaml via _load_change_kinds() with hardcoded fallback when config or pyyaml is unavailable. 2. Non-interactive (CI) mode now requires AZPYSDK_AUTO_INSTALL=1 env var before running npm install automatically. 3. Use args.package/args.kind/args.message directly instead of getattr. 4. Store parser reference as self._parser on the changelog class instance instead of stashing a private attr on the argparse Namespace. Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/c9c4bf6e-9283-48b9-9861-00062d368e90 Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
The prior root package.json/lockfile were gitignored (the root is reserved
for tsp-client transient files), so they never actually shipped. Move the
pinned Chronus dev dependency to .github/chronus/ and commit both
package.json (exact version 1.3.1, no caret) and package-lock.json so
transitive deps are locked with integrity hashes.
Update azpysdk/changelog.py to:
- look for chronus under .github/chronus/node_modules
- install via 'npm ci' (honors lockfile, fails on drift) instead of
'npm install'
- invoke the pinned chronus binary directly instead of via npx, so
there is no ambient resolution or registry lookup even if the local
install is somehow incomplete
Tests updated accordingly; all 44 pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
installing chronus for user after asking for permissions ^^ |
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new azpysdk changelog command group to wrap Chronus changelog operations from the Azure SDK for Python tooling, along with pinned Chronus Node dependencies and CI/test updates.
Changes:
- Introduces
azpysdk changelogsubcommands (add,verify,create,status) that invoke a pinned Chronus binary and optionally auto-detect the package from CWD. - Registers the new command group in the azpysdk CLI and updates the azure-sdk-tools GitHub workflow to exclude it from the “run all checks” dispatcher.
- Adds a comprehensive new test suite for parser shape, argument forwarding, CWD-based package detection, and install gating behavior.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/tools/azure-sdk-tools/azpysdk/changelog.py | New CLI command group implementing Chronus invocation, install gating, and package resolution. |
| eng/tools/azure-sdk-tools/azpysdk/main.py | Registers the new changelog command group in the top-level CLI. |
| eng/tools/azure-sdk-tools/tests/test_changelog_commands.py | Adds unit tests for parser registration, command invocation, and install behavior. |
| .github/workflows/azure-sdk-tools.yml | Excludes changelog from the auto-discovered “checks” list run by the workflow. |
| .github/chronus/package.json | Adds pinned Chronus dev dependency for reproducible local execution. |
| .github/chronus/package-lock.json | Locks Chronus transitive dependency graph for reproducibility and integrity. |
Files not reviewed (1)
- .github/chronus/package-lock.json: Language not supported
Per review feedback on #46016, route package discovery through the shared Check.get_targeted_directories pipeline used by import_all and other azpysdk checks instead of custom discover_targeted_packages / walk-up logic. Behavior changes: - add/create/status now inherit the common 'target' positional (default '**'). - Subdirectory walk-up is dropped: run from package root with '.' or pass the package path/name explicitly. - verify is unchanged (always repo-level, no target). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
889db0a to
593b23b
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>

Integrates Chronus changelog management into the
azpysdkCLI so developers don't need to usenpx chronusdirectly.New subcommands
azpysdk changelog add [package]npx chronus addazpysdk changelog verifynpx chronus verifyazpysdk changelog createnpx chronus changelogazpysdk changelog statusnpx chronus statusCommands work from both the repository root and from within a package directory. When running
azpysdk changelog addfrom inside a package folder (e.g.sdk/storage/azure-storage-blob), the package path is detected automatically and passed to chronus. An explicit package argument always takes precedence.The
addsubcommand supports--kind(-k) and--message(-m) flags for non-interactive use, including tagging entries as breaking changes. Valid kinds:breaking,feature,deprecation,fix,dependencies,internal. If omitted, chronus falls back to its interactive prompts.Changes
azpysdk/changelog.py— NewchangelogCheck subclass. Runsnpx chronus <cmd>from repo root with inherited stdio for interactive prompts. Auto-detects package path from CWD when inside ansdk/<service>/<package>directory. Supports--kindand--messageflags onaddfor non-interactive change entry creation (e.g. breaking changes). Errors clearly when Node.js/npx is missing.azpysdk/main.py— Import and register thechangelogcommand.tests/test_changelog_commands.py— 41 tests covering parser structure, correct argument passthrough,--kind/--messageflag forwarding, CWD-based package detection, repo-root cwd, exit code propagation, and npx-missing error handling.