Skip to content
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

[Compute] Autogen PR Issue 56 #44

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
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/[email protected]
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/[email protected]
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/[email protected]
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)
7 changes: 7 additions & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@

-->
## Upcoming Release
* Updated the `New-AzGalleryImageVersion` cmdlet to map the `SourceImageId` parameter to a new API field on the backend when a VM source is supplied.
- Previously, this would have been mapped to: properties.storageprofile.source.id
- The new field it should be mapped to is now: properties.storageprofile.source.virtualMachineId
- Note: This should be mapped to virtualMachineId only when customer supplies virtual machine in the SourceImageId parameter. If they supply a managed image it should still be mapped to the same field.
* 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.
* 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
Loading