Skip to content

Commit

Permalink
Merge branch 'master' into deep_copy_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Xue authored May 27, 2020
2 parents 8989865 + 06bab74 commit 6d371c3
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 105 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/prepare-release.yml

This file was deleted.

16 changes: 15 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ jobs:
python-version: '3.7'
- name: Build wheels
run: ./scripts/build.sh
- name: Install twine
run: |
pip install twine
# The step below publishes to testpypi in order to catch any issues
# with the package configuration that would cause a failure to upload
# to pypi. One example of such a failure is if a classifier is
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
# middle of the package upload causing the action to fail, and certain packages
# might have already been updated, this would be bad.
- name: Publish to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.test_pypi_username }}
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
twine upload --repository testpypi --skip-existing --verbose dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
pip install twine
twine upload --skip-existing --verbose dist/*
82 changes: 82 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Releasing OpenTelemetry Packages (for maintainers only)
This document explains how to publish all OT modules at version x.y.z. Ensure that you’re following semver when choosing a version number.

Release Process:
* [Create a new branch](#create-a-new-branch)
* [Open a Pull Request](#open-a-pull-request)
* [Create a Release](#Create-a-Release)
* [Move stable tag](#Move-stable-tag)
* [Update master](#Update-master)
* [Check PyPI](#Check-PyPI)
* [Troubleshooting](#troubleshooting)


## Create a new branch
The following script does the following:
- update master locally
- creates a new release branch `release/<version>`
- updates version and changelog files
- commits the change to a new branch `release/<version>-auto`

*NOTE: This script was run by a GitHub Action but required the Action bot to be excluded from the CLA check, which it currently is not.*

```bash
./scripts/prepare_release.sh 0.7b0
```

## Open a Pull Request

The PR should be opened from the `release/<version>-auto` branch created as part of running `prepare_release.sh` in the steps above.

## Create a Release

- Create the GH release from the release branch, using a new tag for this micro version, e.g. `v0.7.0`
- Copy the changelogs from all packages that changed into the release notes (and reformat to remove hard line wraps)


## Check PyPI

This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python/blob/master/.github/workflows/publish.yml).

- Check the [action logs](https://github.com/open-telemetry/opentelemetry-python/actions?query=workflow%3APublish) to make sure packages have been uploaded to PyPI
- Check the release history (e.g. https://pypi.org/project/opentelemetry-api/#history) on PyPI

If for some reason the action failed, see [Publish failed](#publish-failed) below

## Move stable tag

This will ensure the docs are pointing at the stable release.

```bash
git tag -d stable
git tag stable
git push origin stable
```

## Update master

Ensure the version and changelog updates have been applied to master.

```bash
# checkout a new branch from master
git checkout -b v0.7b0-master-update
# cherry pick the change from the release branch
git cherry-pick $(git log -n 1 origin/release/0.7b0 --format="%H")
# update the version number, make it a "dev" greater than release number, e.g. 0.8.dev0
perl -i -p -e 's/0.7b0/0.8.dev0/' $(git grep -l "0.7b0" | grep -vi CHANGELOG)
# open a PR targeting master see #331
git commit -m
```

## Troubleshooting

### Publish failed

If for some reason the action failed, do it manually:

- To avoid pushing untracked changes, check out the repo in a new dir
- Switch to the release branch (important so we don't publish packages with "dev" versions)
- Build distributions with `./scripts/build.sh`
- Delete distributions we don't want to push (e.g. `testutil`)
- Push to PyPI as `twine upload --skip-existing --verbose dist/*`
- Double check PyPI!
2 changes: 2 additions & 0 deletions ext/opentelemetry-ext-django/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Add support for django >= 1.10 (#717)

## 0.7b1

Released 2020-05-12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,72 +58,3 @@ def test_export(self):
for export_status in self.span_processor.export_status:
self.assertEqual(export_status.name, "SUCCESS")
self.assertEqual(export_status.value, 0)


# FIXME This test fails because of an issue in the OpenCensus collector
# reported here:
# https://github.com/census-instrumentation/opencensus-service/issues/641
# Uncomment this test when this issue gets fixed.

# from time import sleep
# from opentelemetry.ext.opencensusexporter.metrics_exporter import (
# OpenCensusMetricsExporter,
# )
# from opentelemetry.sdk.metrics import Counter, MeterProvider
# from opentelemetry.sdk.metrics.export.controller import PushController

# from opentelemetry import metrics
#
#
# class ExportStatusMetricController(PushController):
# def __init__(self, *args, **kwargs):
# super().__init__(*args, **kwargs)
# self.export_status = []
#
# def run(self):
# while not self.finished.wait(self.interval):
# self.tick()
#
# def tick(self):
# # Collect all of the meter's metrics to be exported
# self.meter.collect()
# token = attach(set_value("suppress_instrumentation", True))
# # Export the given metrics in the batcher
# self.export_status.append(
# self.exporter.export(self.meter.batcher.checkpoint_set())
# )
# detach(token)
# # Perform post-exporting logic based on batcher configuration
# self.meter.batcher.finished_collection()
#
#
# class TestOpenCensusMetricsExporter(TestBase):
# def setUp(self):
# super().setUp()
#
# metrics.set_meter_provider(MeterProvider())
# self.meter = metrics.get_meter(__name__)
# self.controller = ExportStatusMetricController(
# self.meter,
# OpenCensusMetricsExporter(
# service_name="basic-service", endpoint="localhost:55678"
# ),
# 1,
# )
#
# def test_export(self):
#
# self.meter.create_metric(
# name="requests",
# description="number of requests",
# unit="1",
# value_type=int,
# metric_type=Counter,
# label_keys=("environment",),
# ).add(25, {"environment": "staging"})
#
# sleep(2)
#
# self.assertEqual(len(self.controller.export_status), 1)
# self.assertEqual(self.controller.export_status[0].name, "SUCCESS")
# self.assertEqual(self.controller.export_status[0].value, 0)
5 changes: 5 additions & 0 deletions ext/opentelemetry-ext-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- lint: version of grpc causes lint issues
([#696](https://github.com/open-telemetry/opentelemetry-python/pull/696))

## 0.6b0

Released 2020-03-30
Expand Down
3 changes: 3 additions & 0 deletions ext/opentelemetry-ext-jaeger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Transform resource to tags when exporting
([#645](https://github.com/open-telemetry/opentelemetry-python/pull/645))

## 0.6b0

Released 2020-03-30
Expand Down
3 changes: 3 additions & 0 deletions ext/opentelemetry-ext-opencensusexporter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Rename otcollector to opencensus
([#695](https://github.com/open-telemetry/opentelemetry-python/pull/695))

## 0.5b0

Released 2020-03-16
Expand Down
3 changes: 3 additions & 0 deletions ext/opentelemetry-ext-zipkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Transform resource to tags when exporting
([#707](https://github.com/open-telemetry/opentelemetry-python/pull/707))

## 0.7b1

Released 2020-05-12
Expand Down
5 changes: 5 additions & 0 deletions opentelemetry-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

- Handle boolean, integer and float values in Configuration
([#662](https://github.com/open-telemetry/opentelemetry-python/pull/662))
- bugfix: ensure status is always string
([#640](https://github.com/open-telemetry/opentelemetry-python/pull/640))

## 0.7b1

Released 2020-05-12
Expand Down
9 changes: 8 additions & 1 deletion opentelemetry-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

## Unreleased

- Validate span attribute types in SDK (#678)
- Validate span attribute types in SDK
([#678](https://github.com/open-telemetry/opentelemetry-python/pull/678))
- Specify to_json indent from arguments
([#718](https://github.com/open-telemetry/opentelemetry-python/pull/718))
- Span.resource will now default to an empty resource
([#724](https://github.com/open-telemetry/opentelemetry-python/pull/724))
- bugfix: Fix error message
([#729](https://github.com/open-telemetry/opentelemetry-python/pull/729))

## 0.7b1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(

if max_export_batch_size > max_queue_size:
raise ValueError(
"max_export_batch_size must be less than and equal to max_export_batch_size."
"max_export_batch_size must be less than and equal to max_queue_size."
)

self.span_exporter = span_exporter
Expand Down
17 changes: 12 additions & 5 deletions scripts/prepare_release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x
#
# This script:
# 1. parses the version number from the branch name
Expand Down Expand Up @@ -72,10 +72,17 @@ function update_changelog() {
fi
}

# create the release branch
git checkout master
git reset --hard origin/master
git checkout -b release/${VERSION}
git push origin release/${VERSION}

# create a temporary branch to create a PR for updated version and changelogs
git checkout -b release/${VERSION}-auto
update_version_file
update_changelog

git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "updating changelogs and version to ${VERSION}"
echo "::set-output name=version_updated::1"

echo "Time to create a release, here's a sample title:"
echo "[pre-release] Update changelogs, version [${VERSION}]"

0 comments on commit 6d371c3

Please sign in to comment.