Currently works, but has organically grown into two separate stacks that I believe best be merged.
We have some repeated code, mostly present around:
- Requirements Parsing
- Versioning Comparisons
- Various setup.py parsing
Which is split between two primary stacks:
eng/tox/
<various scripts related to the tox environments>
scripts/
devops_tasks/
<various scripts ALSO related to various ci needs>
<building packages, invoking our primary test stack>
<invoking tox>
<other necessary pieces>
Also included are the following directories:
eng/versioning/
<various scripts related to azure-sdk specific versioning>
<this includes incrementing the version of a package after release>
<and parsing the current version information>
scripts/
pylint_plugin/
tools/
azure-devtools/
azure-sdk-tools/
This revamp is purely intented to give the way we interact with the azure sdk engineering system a revamp. Stuff like:
- Friendlier to interact with
- Instead of dealing with frustrating script calls, wrapping in friendly ci prompts with custom help prompts that offer good examples right in the help text.
- Easier to diagnose and debug errors within
- Reproduce an error in a specific environment and build. (Input is a build url from devops)
- Use a new default Azure credential to talk to devops!
- Reproduce an error in a specific environment and build. (Input is a build url from devops)
- Easier to maintain
- Finally delete common code that is not easily shareable between stacks
- Still compatible with python 2.7 (at least maintain current code)
- Centralize all documentation under azure-sdk-tools. Publish documentation under service "tools"
- azure-sdk-tools
- Minimize the amount of installation that is actually happening. Always preseed. Everything is easily reproable locally.
Lower priority, but may get to
- Unit tests?
Part 2 logging, the loggening
of this revamp will revolve around what is visible in CI, and what is quieted/redirected into attached build logs. This is purely restructing how the engsys talks to itself.
- Difference between
Debug
andInformation
Mode. Should be set via command line or environment variable.- `Respond to both our custom one, as well as the microsoft logging default variable.
- Test Runs should be quiet. Package installation redirected to file in all cases except
debug
mode.
- Minimum Dependency
- Standard installation, but with a constraints file for minimum
- Maximum Dependency
- Standard installation, but with a constraints file for maximum
- With or without specific extras that are not identitifed in the packages?
- Can we maybe get them officially identified?
- Alternatively pull from a
negative
requirements. These are short outlines of necessary and unnecessary packages.
- Set packages to dev mode, or not. This includes local requirements strings and package versions.
- If in CI, regenerate all local references. Replace all relative paths with compiled wheels.
- If a build URL is presented, or if we're in a CI build, download build artifact and pip wheel directory environment variable.
- pip install the requirements. pip install the target package.
- pip uninstall the negative packages
- Confirm pip freeze against scenario.txt
- Invoke tests or other process
<updates to generating documentation? Leave this alone for now?>
- Pull down artifacts folder
- Set environment variable for said artifacts folder location
- Set any other environment variables
- Invoke tests
- Pull down artifacts folder
- Set environment variables for said artifact folder location
- Other environment variables
- Clone target azure sdk SHA
- Install required packages
- Run tests from SHA
An optional dependency is one that exists under the extras
label. We need CI to process any additional requirements files as additional tox invocations.
Each entrypoint should support either A environment variable or B command line input from the service level.
The additional text for arguments is what is there now simplified as much as possible.
azci test <pkgname>
azci
# content of myinvoke.py
import pytest
import sys
class MyPlugin:
def pytest_sessionfinish(self):
print("*** test run reporting finishing")
if __name__ == "__main__":
sys.exit(pytest.main(["-qq"], plugins=[MyPlugin()]))
azci build <glob>
azci build service <glob>
azci build package <glob>
azci version info <packagename>
azci version increment <packagename>
azci version alpha <packagename>
azci test <service>
azci test <package>
- Can we log where all the code is being called from? https://stackoverflow.com/a/8315566
- Add CLI interface
- CLI Interface should understand how to pass all arguments it doesn't understand directly to pytest or the like
- CLI Interface should dump environment configuration and how to enter the same environment on retry
- Move everything into the new places. As code is moved, ensure that:
- Logging honors
debug
vs standardinformation
. - Functions should accept an
CIEnvironment
config that states the settings for the current run. A CIEnvironment is created at the "CLI" level of - De-duplicated
- Code Typed and documented
- Logging honors
- Adjust tox.ini as best as possible
- Follow the CI and CLI experience, ensure that everything still works with the new entrypoints and changed relative paths.
- Set up local PAT to azure sdk CI system
- Reproduce failure locally
- _logs folder contains output by default
- tox.ini post_run cleanup script
- Start deleting code
- Simplify the methodology for generating a test requirements file