Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a basic workflow to help you get started with Actions

name: demo

on:
issues:
types:
- reopened
- opened

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions: write-all
defaults:
run:
shell: bash # Specify the shell you want to use (e.g., bash, pwsh, sh, etc.)

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: pacoxu/actions-comment-on-issue@1.0.3
name : Bot Init
with:
message: "AI bot is preparing code suggestions."
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Powershell repo
uses: actions/checkout@v2

- name: Get directory
run: ls

- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r .github/workflows/script/requirements.txt
- name: execute py script # run file
run: |
python ./.github/workflows/script/test.py


- uses: pacoxu/actions-comment-on-issue@1.0.3
name: Create Code Suggestions PR
with:
message: "Here are the suggested code change: Edit the testfile.js"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Branch
# You may pin to the exact commit or the version.
# uses: peterjgrainger/action-create-branch@b48b0ca0e307c9b56f059b70274984ffeaa90a43
uses: peterjgrainger/action-create-branch@v2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The branch to create
branch: issuebranch


- name: create pull request
run: |
gh pr create -R ${{ github.event.issue.user.login }}/azure-powershell -H issuebranch --title 'test PR' --body 'resolves https://github.com/${{ github.event.issue.user.login }}/azure-powershell/issues/${{ github.event.issue.number }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ENTERPRISE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/script/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
openai==0.27.4
requests==2.25.1
25 changes: 25 additions & 0 deletions .github/workflows/script/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import requests
import subprocess

print("im here")
url = f"https://raw.githubusercontent.com/Azure/azure-powershell/main/src/Compute/Compute/Extension/CustomScript/SetAzureVMCustomScriptExtensionCommand.cs"
response = requests.get(url)
if response.status_code == 200:
content = response.content
content_str = content.decode('utf-8')
print(content_str)

code = content_str.split('public override void ExecuteCmdlet()')[1]

out = subprocess.run(['gh', 'issue', 'view','-R', 'Azure/azure-powershell-cmdlet-review-pr', '1352'], capture_output=True)

# parse stdout to get the issue body
issue_body = out.stdout.decode('utf-8').split('---')[0]

# find the string 'Sample of end-to-end usage' and then the immediate next line
sample_code = issue_body.split('### Changed cmdlet')[1]

# find the string '## Specific test cases' and then the previous line
test_case = sample_code.split('##')[0]

print(test_case)
17 changes: 16 additions & 1 deletion src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,22 @@
- Additional information about change #1

-->
## Upcoming Release
* Added new feature to list the names of the cmdlets that are being edited.
- Cmdlets edited: `Get-AzResource`, `Set-AzResource`, `Remove-AzResource`
* Introduced new parameters for the cmdlet, the parameter types, and their allowed values.
- `Get-AzResource` - New parameter: `-ResourceName` (String)
- `Set-AzResource` - New parameters: `-ResourceName` (String), `-ResourceType` (String)
- `Remove-AzResource` - New parameter: `-ResourceName` (String)
* Updated the business logic of the cmdlet and parameters.
- `Get-AzResource` - The `-ResourceName` parameter now allows for more specific resource querying.
- `Set-AzResource` - The `-ResourceName` and `-ResourceType` parameters allow for more specific resource modification.
- `Remove-AzResource` - The `-ResourceName` parameter allows for more specific resource removal.
* Link to diff between markdown help files, or sample syntax as above.
- [Link to diff](https://github.com/Azure/azure-powershell/compare/master...feature-branch)
* Indicated which parameter sets on the cmdlet are affected by this change.
- `Get-AzResource`, `Set-AzResource`, `Remove-AzResource` - All parameter sets are affected by this change.
* Specific test cases
- [Link to API tests](https://github.com/Azure/azure-powershell/tree/master/test)
* Fixed the `Update-AzVmss` cmdlet so the `AutomaticRepairGracePeriod`, `AutomaticRepairAction`, and `EnableAutomaticRepair` parameters function correctly.
* Updated help doc for `New-AzVM`, `New-AzVMConfig`, `New-AzVmss`, `New-AzVmssConfig`, `Update-AzVM`, and `Update-AzVmss` to include parameters that were previously added for Trusted Launch features.
* Updated Azure.Core to 1.33.0.
Expand Down