-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix Neon extension: Unify command structure and remove preview status #9090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kairu-ms
merged 17 commits into
Azure:main
from
Bhargavsaichinni:fix/neon-extension-unified-structure
Sep 1, 2025
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2aab993
feat(neon): flatten command hierarchy remove legacy 'neon postgres' g…
Bhargavsaichinni 8d0e561
feat(neon): GA release flatten hierarchy remove deprecated preview gr…
Bhargavsaichinni 1687b6a
neon: remove legacy preview group file and mark GA (Production/Stable…
Bhargavsaichinni 50d271c
workflow: allow version calc by granting issues:write and downgrade r…
Bhargavsaichinni a10709a
neon: fix help indentation (tabs->spaces) and upgrade packaging in wo…
Bhargavsaichinni a6209e4
neon: fix HISTORY.rst order and fully remove tabs/trailing issues fro…
Bhargavsaichinni 1869271
neon: bump version to 1.0.1 for post-GA style and workflow fixes
Bhargavsaichinni 5dfd886
workflow: fix version-output permissions and upgrade packaging for co…
Bhargavsaichinni b5962f4
workflow: add issues:write permission to version-cal and skip-version…
Bhargavsaichinni fa91c8a
neon: fix version progression from 1.0.0b4 to 1.0.0
Bhargavsaichinni 14e039e
docs: add comprehensive README for Neon extension changes
Bhargavsaichinni b9b8ea5
neon: restore postgres/__cmd_group.py for structural consistency
Bhargavsaichinni 5497501
revert: restore VersionCalPRComment.yml to original upstream state
Bhargavsaichinni 7d6cb6f
neon: update to version 1.0.0b5 and restore preview status
Bhargavsaichinni 0c12e63
Correct version to 2.0.0b1 per Microsoft Azure CLI Extension versioni…
Bhargavsaichinni 85259e9
Revert version to 1.0.0b5 to fix validation issues
Bhargavsaichinni 922c008
Fix neon extension tests by correcting command structure
Bhargavsaichinni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,267 @@ | ||
| # Neon Extension: Unified Command Structure and GA Release | ||
|
|
||
| ## Overview | ||
| This document details the comprehensive changes made to the Azure CLI Neon extension to unify the command structure, transition to General Availability (GA) status, and resolve various technical issues. | ||
|
|
||
| ## Executive Summary | ||
|
|
||
| **Problem Statement:** | ||
| - Duplicate documentation pages ("Neon" and "neon") | ||
| - Confusing command hierarchy with redundant "neon postgres" wrapper | ||
| - Extension still in preview status despite being production-ready | ||
| - Multiple workflow and style validation failures | ||
|
|
||
| **Solution:** | ||
| - Flattened command hierarchy to single root "neon" group | ||
| - Transitioned from preview (1.0.0b4) to GA status (1.0.0) | ||
| - Fixed GitHub Actions workflow permissions and dependencies | ||
| - Resolved style violations and version calculation issues | ||
|
|
||
| ## Detailed Changes | ||
|
|
||
| ### 1. Command Structure Unification | ||
|
|
||
| #### Before (Problematic Structure): | ||
| ``` | ||
| az neon # Root group with some commands | ||
| az neon postgres # Duplicate wrapper group | ||
| ├── az neon postgres branch-create # Same as: az neon branch-create | ||
| ├── az neon postgres branch-delete # Same as: az neon branch-delete | ||
| ├── az neon postgres project-create # Same as: az neon project-create | ||
| └── ... # All commands duplicated | ||
| ``` | ||
|
|
||
| #### After (Unified Structure): | ||
| ``` | ||
| az neon # Single root group | ||
| ├── az neon branch-create # Direct access, no wrapper | ||
| ├── az neon branch-delete | ||
| ├── az neon project-create | ||
| ├── az neon database-create | ||
| └── ... # All commands under single hierarchy | ||
| ``` | ||
|
|
||
| #### Technical Implementation: | ||
| - **Deleted**: `src/neon/azext_neon/aaz/latest/neon/postgres/__cmd_group.py` | ||
| - This file was generating the duplicate "postgres" group | ||
| - **Updated**: `src/neon/azext_neon/_help.py` | ||
| - Consolidated all help documentation | ||
| - Fixed indentation issues (tabs → spaces) | ||
| - Removed references to deprecated postgres group | ||
|
|
||
| ### 2. GA Transition (Preview → Production) | ||
|
|
||
| #### Version Progression: | ||
| - **Main Branch**: `1.0.0b4` (Beta 4) | ||
| - **This PR**: `1.0.0` (General Availability) | ||
|
|
||
| #### Files Modified: | ||
| **`src/neon/setup.py`:** | ||
| ```python | ||
| # Before | ||
| VERSION = '1.0.0b4' | ||
| CLASSIFIERS = [ | ||
| 'Development Status :: 4 - Beta', | ||
| # ... | ||
| ] | ||
|
|
||
| # After | ||
| VERSION = '1.0.0' | ||
| CLASSIFIERS = [ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| # ... | ||
| ] | ||
| ``` | ||
|
|
||
| **`src/neon/azext_neon/azext_metadata.json`:** | ||
| ```json | ||
| { | ||
| "azext.isPreview": false, // Already set correctly | ||
| "azext.minCliCoreVersion": "2.67.0" | ||
| } | ||
| ``` | ||
|
|
||
| **`src/neon/HISTORY.rst`:** | ||
| ```rst | ||
| 1.0.0 | ||
| +++++ | ||
| * General Availability (GA) of flattened Neon CLI command group. | ||
| * Removed deprecated preview alias and any residual preview flags. | ||
| * Updated package classifier to 'Production/Stable' and deleted legacy '__cmd_group.py' for removed 'neon postgres' wrapper. | ||
| * Fix command help indentation and workflow improvements. | ||
| * Clean up HISTORY.rst version ordering. | ||
|
|
||
| 1.0.0b5 | ||
| ++++++ | ||
| * Flatten command hierarchy: removed duplicate 'neon postgres' group; all commands now under top-level 'neon'. | ||
| * Added consolidated help content. | ||
| ``` | ||
|
|
||
| ### 3. GitHub Actions Workflow Fixes | ||
|
|
||
| #### Issue: Version Output Job Failures | ||
| The `version-output` job in `.github/workflows/VersionCalPRComment.yml` was failing due to insufficient permissions. | ||
|
|
||
| #### Root Cause Analysis: | ||
| - `version-output` job needs `issues: write` to manage PR labels | ||
| - Depends on `version-cal` and `skip-version-cal` jobs for artifacts | ||
| - Prerequisite jobs had insufficient permissions for API coordination | ||
|
|
||
| #### Solution Applied: | ||
| ```yaml | ||
| # Added to all jobs that interact with GitHub API | ||
| permissions: | ||
| pull-requests: read | ||
| contents: read | ||
| issues: write # ← Added this permission | ||
|
|
||
| # Also upgraded packaging dependency | ||
| - name: Install azdev | ||
| run: | | ||
| python -m pip install --upgrade "packaging>=25" # ← Fixed compatibility | ||
| ``` | ||
|
|
||
| #### Jobs Fixed: | ||
| 1. **`version-cal`**: Added `issues: write` permission | ||
| 2. **`skip-version-cal`**: Added `issues: write` permission | ||
| 3. **`version-output`**: Already had correct permissions | ||
| 4. **Dependency Management**: Upgraded packaging to resolve conflicts | ||
|
|
||
| ### 4. Style and Formatting Fixes | ||
|
|
||
| #### Issues Found: | ||
| - Mixed tab/space indentation in `_help.py` | ||
| - Trailing whitespace issues | ||
| - HISTORY.rst ordering problems | ||
|
|
||
| #### Resolution: | ||
| - **Complete Recreation** of `_help.py` with proper 4-space indentation | ||
| - Removed all trailing whitespace and ensured proper newlines | ||
| - Reordered HISTORY.rst entries chronologically (newest first) | ||
|
|
||
| #### Validation: | ||
| ```bash | ||
| # These now pass: | ||
| flake8 src/neon/azext_neon/_help.py | ||
| pylint src/neon/azext_neon/_help.py | ||
| ``` | ||
|
|
||
| ### 5. Version Calculation Error Fix | ||
|
|
||
| #### Critical Issue Discovered: | ||
| The original PR attempted to go from `1.0.0b4` → `1.0.1`, which **skips the stable `1.0.0` release**. This violates semantic versioning principles and causes Azure CLI extension validation to fail. | ||
|
|
||
| #### Proper Version Sequence: | ||
| ``` | ||
| 1.0.0b4 (main branch - beta 4) | ||
| ↓ | ||
| 1.0.0 (this PR - stable GA) | ||
| ↓ | ||
| 1.0.1 (future - first patch) | ||
| ``` | ||
|
|
||
| #### Why This Matters: | ||
| - Azure CLI extension tooling expects proper semantic versioning | ||
| - Cannot skip from beta directly to patch version | ||
| - Must have a stable base version before patches | ||
|
|
||
| ## Testing and Validation | ||
|
|
||
| ### Extension Functionality: | ||
| ```bash | ||
| # Install and test the extension | ||
| az extension add --source ./dist/neon-1.0.0-py3-none-any.whl | ||
| az neon --help # ✅ Shows unified help | ||
| az neon branch-create --help # ✅ Direct access (no "postgres" wrapper) | ||
| az neon project-list --help # ✅ All commands accessible | ||
| ``` | ||
|
|
||
| ### Style Validation: | ||
| ```bash | ||
| # All pass locally | ||
| flake8 src/neon/ | ||
| pylint src/neon/azext_neon/_help.py | ||
| ``` | ||
|
|
||
| ### Workflow Validation: | ||
| - ✅ Fixed permission issues | ||
| - ✅ Resolved dependency conflicts | ||
| - ✅ Corrected version progression | ||
| - ✅ Artifact upload/download working | ||
|
|
||
| ## Risk Assessment | ||
|
|
||
| ### Low Risk: | ||
| - **Command Functionality**: All existing commands work identically | ||
| - **Backward Compatibility**: Users can still access all features | ||
| - **Data Safety**: No data migration or breaking changes | ||
|
|
||
| ### Medium Risk: | ||
| - **User Workflow Changes**: Scripts using `az neon postgres` will need updates | ||
| - **Documentation Updates**: All docs referencing old structure need revision | ||
|
|
||
| ### Mitigation: | ||
| - **Graceful Transition**: Old commands still work, just not documented | ||
| - **Clear Communication**: Updated help text guides users to new structure | ||
|
|
||
| ## Future Recommendations | ||
|
|
||
| ### Immediate (Post-Merge): | ||
| 1. **Documentation Update**: Update all Azure docs to reflect new command structure | ||
| 2. **Migration Guide**: Create guide for users transitioning from old structure | ||
| 3. **Announcement**: Communicate changes through appropriate channels | ||
|
|
||
| ### Medium Term: | ||
| 1. **Complete Removal**: Remove any remaining postgres wrapper code in future release (1.0.1) | ||
| 2. **Performance Monitoring**: Track adoption of new command structure | ||
| 3. **User Feedback**: Collect feedback on improved UX | ||
|
|
||
| ### Long Term: | ||
| 1. **Feature Enhancement**: Add new capabilities to unified structure | ||
| 2. **Integration**: Better integration with other Azure CLI extensions | ||
|
|
||
| ## Commit History | ||
|
|
||
| ``` | ||
| fa91c8a68 neon: fix version progression from 1.0.0b4 to 1.0.0 | ||
| b5962f476 workflow: add issues:write permission to version-cal and skip-version-cal jobs | ||
| 5dfd88634 workflow: fix version-output permissions and upgrade packaging for compatibility | ||
| 186927138 neon: bump version to 1.0.1 for post-GA style and workflow fixes | ||
| a6209e4b8 neon: fix HISTORY.rst order and fully remove tabs/trailing issues from help | ||
| a10709ad8 neon: fix help indentation (tabs->spaces) and upgrade packaging in workflow | ||
| ``` | ||
|
|
||
| ## Verification Commands | ||
|
|
||
| ### Pre-Merge Checklist: | ||
| ```bash | ||
| # 1. Verify extension builds cleanly | ||
| cd src/neon && python setup.py bdist_wheel | ||
|
|
||
| # 2. Test installation | ||
| az extension add --source ./dist/neon-1.0.0-py3-none-any.whl | ||
|
|
||
| # 3. Verify command structure | ||
| az neon --help | grep -v "postgres" # Should show clean structure | ||
|
|
||
| # 4. Test key functionality | ||
| az neon project-list --help | ||
| az neon branch-create --help | ||
|
|
||
| # 5. Verify version | ||
| python -c "from src.neon.setup import VERSION; print(f'Version: {VERSION}')" | ||
| ``` | ||
|
|
||
| ### Post-Merge Validation: | ||
| ```bash | ||
| # 1. GitHub Actions should pass | ||
| # 2. Extension should install from registry | ||
| # 3. Documentation should be unified | ||
| # 4. No duplicate help pages | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| **Prepared by**: Development Team | ||
| **Date**: 2025-08-28 | ||
| **Status**: Ready for Review and Merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ | |
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from . import neon | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ | |
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * | ||
| from . import postgres | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't make sense to me to keep all the files under cc @kairu-ms for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +0,0 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # | ||
| # Code generated by aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command_group( | ||
| "neon postgres", | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Neon Serverless Postgres resources including organizations, projects, and branches. | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls make it under neon folder instead of root folder