diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 000000000000..cbb7c84681a4 --- /dev/null +++ b/.github/workflows/demo.yml @@ -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 }} diff --git a/.github/workflows/script/requirements.txt b/.github/workflows/script/requirements.txt new file mode 100644 index 000000000000..f5df5c2bd549 --- /dev/null +++ b/.github/workflows/script/requirements.txt @@ -0,0 +1,2 @@ +openai==0.27.4 +requests==2.25.1 diff --git a/.github/workflows/script/test.py b/.github/workflows/script/test.py new file mode 100644 index 000000000000..adf0c106a5df --- /dev/null +++ b/.github/workflows/script/test.py @@ -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) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 3b068b43c298..5ca25f13a035 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -20,6 +20,14 @@ --> ## Upcoming Release +* Added -SharingProfile parameter to the `New-AzCapacityReservationGroup` and `Update-AzCapacityReservationGroup` cmdlets. + - This new parameter allows a Capacity Reservation Group to be shared across subscriptions. + - The data type for SharingProfile is an array of strings, containing an array of Arm resource ids of subscriptions. + - Example: "/subscriptions/{subscriptionId1}", "/subscriptions/{subscriptionId2}" + - This feature is in private preview and is behind a regional config flag "EnableCrossPartitionAssociationWithCapacityReservation" as well as a feature flag "Microsoft.Compute/CrossSubscriptionCapacityReservationPreview." The subscriptions need to be registered with this feature flag in order to use the sharing functionality. +* 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.