Add azpysdk changelog command group wrapping Chronus#46016
Add azpysdk changelog command group wrapping Chronus#46016
azpysdk changelog command group wrapping Chronus#46016Conversation
azpysdk changelog command group wrapping Chronus
|
|
||
| Wraps Chronus CLI commands (add, verify, create, status) so they can be | ||
| invoked through the ``azpysdk`` CLI. Unlike most checks that operate on | ||
| individual packages, changelog commands run at the **repository root** |
There was a problem hiding this comment.
@copilot I dont think they have to run at the repo root we should make it work at the root or in the pkg folder
There was a problem hiding this comment.
Updated in c506c82. azpysdk changelog add now auto-detects the package when CWD is inside a package directory (e.g. sdk/storage/azure-storage-blob or any subdirectory). An explicit package argument still takes precedence. Chronus itself always runs from the repo root since it needs .chronus/config.yaml.
|
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>
ee4e1f5 to
2aae69b
Compare
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.