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

{CI} Support codespace #6850

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wangzelin007
Copy link
Member

@wangzelin007 wangzelin007 commented Oct 10, 2023


This checklist is used to make sure that common guidelines for a pull request are followed.

  1. Use the latest official python3.11 image
  2. Create a python virtual environment in the /home/vscode directory
  3. The following plug-ins are installed by default:
    • editorconfig.editorconfig
    • github.vscode-pull-request-github
    • ms-azuretools.vscode-docker
    • ms-python.python
    • ms-python.flake8
    • github-cli
  4. Clone azure-cli and azure-cli-extensions in the /workspaces directory
  5. Automatically setup development environment
  6. Automatically activate python virtual environment

Please note that you need to wait 6 minutes for the first build
screenshot:
image

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Oct 10, 2023

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link

Hi @wangzelin007,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 10, 2023

CI

@wangzelin007
Copy link
Member Author

If anyone wants to debug with vscode, here is an example configuration for .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Codespace Azure CLI Debug",
            "type": "python",
            "request": "launch",
            "python": "/home/vscode/env/bin/python",
            "program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
            "cwd": "${workspaceRoot}",
            "args": [
                "--help"
            ],
            "console": "integratedTerminal",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ],
            "justMyCode": false
        },
        {
            "name": "Codespace Azdev Debug",
            "type": "python",
            "request": "launch",
            "python": "/home/vscode/env/bin/python",
            "program": "/home/vscode/env/lib/python3.11/site-packages/azdev/__main__.py",
            "cwd": "${workspaceRoot}",
            "args": [
                "--help"
            ],
            "console": "integratedTerminal",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ]
        }
    ]
}

C901 # code flow is too complex, too many violations, to be removed in the future
W503 # line break before binary operator effect on readability is subjective
W504 # line break after binary operator effect on readability is subjective
# line too long, it is covered by pylint
Copy link
Member Author

@wangzelin007 wangzelin007 Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This issue was caused by the updating of flake8 to 6.

@haitch
Copy link
Member

haitch commented Oct 21, 2023

what blocks this PR from merge? we can get it merged and keep evolving, right?

@wangzelin007
Copy link
Member Author

what blocks this PR from merge? we can get it merged and keep evolving, right?

Sorry, due to security considerations, we do not plan to directly support the codespace.
If you really need this function, please create an issue and we will discuss it with PM.

@jessehouwing
Copy link

@wangzelin007 I tried contributing to this repo, but the steps to setup are many, the docs was hard to find, and in the end half of the things I needed to do still didn't work. Havig a codespace in which the code formatting, linting, compiling and running the tests just works is going to make it soooo much easier for external people like me to contribute.

I'd love to understand the security considerations.

I have already filed #6794 with my reasoning.

@wangzelin007
Copy link
Member Author

Hi @jiasli,
Can you help describe the security issues we encountered on GitHub Action and our concerns about GitHub codespace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I tried running azdev style <YOUR_EXT> in a codespace, but it crashes.
4 participants