Skip to content

Commit

Permalink
Merge branch 'master' into recreate-span-on-every-run
Browse files Browse the repository at this point in the history
  • Loading branch information
alrex authored Dec 14, 2020
2 parents 47a2738 + 2f1f13f commit 5cbde98
Show file tree
Hide file tree
Showing 65 changed files with 1,355 additions and 1,048 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This action requires that any PR targeting the master branch should touch at
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
# Changelog" label to disable this action.

name: changelog

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- master

jobs:
changelog:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"

steps:
- uses: actions/checkout@v2

- name: Check for CHANGELOG changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
then
echo "A CHANGELOG was modified. Looks good!"
else
echo "No CHANGELOG was modified."
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
false
fi
54 changes: 36 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
# Otherwise, set variable to the commit of your branch on
# opentelemetry-python-contrib which is compatible with these Core repo
# changes.
CONTRIB_REPO_SHA: fd12b1d624fe44ca17d2c88c0ace39dc80db85df
CONTRIB_REPO_SHA: master

jobs:
build:
Expand All @@ -20,24 +20,17 @@ jobs:
py36: 3.6
py37: 3.7
py38: 3.8
py39: 3.9
pypy3: pypy3
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py35, py36, py37, py38, pypy3 ]
python-version: [ py35, py36, py37, py38, py39, pypy3 ]
package: ["instrumentation", "core", "exporter"]
os: [ ubuntu-latest ]
include:
- python-version: py38
package: "tracecontext"
os: ubuntu-latest
- python-version: py38
package: "mypy"
os: ubuntu-latest
- python-version: py38
package: "mypyinstalled"
os: ubuntu-latest
# py35-instrumentation segfaults on 18.04 so we instead run on 20.04
- python-version: py35
package: instrumentation
Expand Down Expand Up @@ -66,14 +59,38 @@ jobs:
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
key: tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }}
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
- name: Find and merge benchmarks
# TODO: Add at least one benchmark to every package type to remove this
if: matrix.package == 'core'
run: >-
jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
| if .[0].benchmarks == null then null else .[0] end'
opentelemetry-*/tests/*${{ matrix.package }}*-benchmark.json > output.json
- name: Report on benchmark results
# TODO: Add at least one benchmark to every package type to remove this
if: matrix.package == 'core'
uses: rhysd/github-action-benchmark@v1
with:
name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package-group }}
tool: pytest
output-file-path: output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# Alert with a commit comment on possible performance regression
alert-threshold: 200%
comment-always: true
fail-on-alert: true
# Make a commit on `gh-pages` with benchmarks from previous step
auto-push: ${{ github.ref == 'refs/heads/master' }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: benchmarks
misc:
strategy:
fail-fast: false
matrix:
tox-environment: [ "docker-tests", "lint", "docs" ]
tox-environment: [ "docker-tests", "lint", "docs", "mypy", "mypyinstalled", "tracecontext" ]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-latest
steps:
Expand All @@ -85,7 +102,7 @@ jobs:
repository: open-telemetry/opentelemetry-python-contrib
ref: ${{ env.CONTRIB_REPO_SHA }}
path: opentelemetry-python-contrib
- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
Expand All @@ -106,12 +123,13 @@ jobs:
py36: 3.6
py37: 3.7
py38: 3.8
py39: 3.9
pypy3: pypy3
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py35, py36, py37, py38, pypy3 ]
python-version: [ py35, py36, py37, py38, py39, pypy3 ]
package: ["instrumentation", "exporter"]
os: [ ubuntu-latest ]
include:
Expand Down Expand Up @@ -166,10 +184,10 @@ jobs:
with:
repository: open-telemetry/opentelemetry-python
path: opentelemetry-python-core
- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install tox
run: pip install -U tox
- name: Cache tox environment
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ var
sdist
develop-eggs
.installed.cfg
pyvenv.cfg
lib
share/
lib64
__pycache__
venv*/
Expand Down
3 changes: 2 additions & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=79
profile=black

; 3 stands for Vertical Hanging Indent, e.g.
; from third_party import (
Expand All @@ -13,6 +14,6 @@ line_length=79
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output=3
skip=target
skip_glob=**/gen/*,.venv*/*,venv*/*,**/proto/*,opentelemetry-python-contrib/*
skip_glob=**/gen/*,.venv*/*,venv*/*,**/proto/*,opentelemetry-python-contrib/*,.tox/*
known_first_party=opentelemetry,opentelemetry_example_app
known_third_party=psutil,pytest,redis,redis_opentracing
6 changes: 5 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ disable=missing-docstring,
wrong-import-order, # Leave this up to isort
bad-continuation, # Leave this up to black
line-too-long, # Leave this up to black
exec-used
exec-used,
super-with-arguments, # temp-pylint-upgrade
isinstance-second-argument-not-valid-type, # temp-pylint-upgrade
raise-missing-from, # temp-pylint-upgrade
unused-argument, # temp-pylint-upgrade

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
Loading

0 comments on commit 5cbde98

Please sign in to comment.