Skip to content

Commit b835b42

Browse files
committed
Merge branch 'main' into spenny/custom-session-definition
2 parents 69d6bb8 + de5d98c commit b835b42

File tree

203 files changed

+14446
-1307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+14446
-1307
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@
1717
<!--
1818
Backend - Do we need to consider migrations or backfilling data?
1919
-->
20-
21-
## Does this work require review from our design team?
22-
23-
<!--
24-
Request review from julian-highlight / our design team
25-
-->
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint PR title
2+
3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- opened
11+
- edited
12+
- synchronize
13+
14+
jobs:
15+
lint-pr-title:
16+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
name: Manual Publish Docs
22
on:
33
workflow_dispatch:
4+
inputs:
5+
workspace_path:
6+
description: 'Path to the workspace being released.'
7+
required: true
8+
type: choice
9+
options:
10+
- sdk/highlight-run
11+
- 'sdk/@launchdarkly/observability-node'
12+
- 'sdk/@launchdarkly/observability-python'
13+
workflow_call:
14+
inputs:
15+
workspace_path:
16+
description: 'Path to the workspace being released.'
17+
required: true
18+
type: string
419

520
permissions:
6-
id-token: write
721
contents: write
822
concurrency: ${{ github.workflow }}-${{ github.ref }}
923
jobs:
@@ -14,23 +28,86 @@ jobs:
1428
uses: actions/checkout@v4
1529
- run: git submodule update --init --recursive
1630

31+
- name: Check if JS package
32+
id: check-js-package
33+
run: |
34+
if ./scripts/is-js-package.sh ${{ inputs.workspace_path }}; then
35+
echo "is_js_package=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "is_js_package=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Check if python package
41+
id: check-python-package
42+
run: |
43+
if ./scripts/is-python-package.sh ${{ inputs.workspace_path }}; then
44+
echo "is_python_package=true" >> $GITHUB_OUTPUT
45+
else
46+
echo "is_python_package=false" >> $GITHUB_OUTPUT
47+
fi
48+
1749
- name: Setup Node.js environment
50+
if: ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
1851
uses: actions/setup-node@v4
1952
with:
2053
node-version: lts/*
2154
cache: 'yarn'
2255

2356
- name: Install js dependencies
57+
if: ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
2458
run: yarn install --mode=skip-build
2559
env:
2660
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
2761

28-
- name: Build docs
29-
run: yarn docs --filter highlight.run
62+
- name: 'Set WORKSPACE_NAME variable'
63+
if: ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
64+
shell: bash
65+
run: |
66+
WORKSPACE_NAME=$(./scripts/package-name.sh ${{ inputs.workspace_path }})
67+
echo "WORKSPACE_NAME=$WORKSPACE_NAME" >> $GITHUB_ENV
68+
69+
- name: Build JS package docs
70+
if: ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
71+
run: yarn docs --filter ${{ env.WORKSPACE_NAME }}
3072

31-
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
32-
name: 'Publish to Github pages'
73+
- uses: actions/setup-python@v5
74+
if: ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
75+
with:
76+
python-version: '3.10'
77+
78+
- name: Install poetry
79+
if: ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
80+
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
81+
82+
- name: Make Install
83+
# Assume non-js projects will use a Makefile to install dependencies.
84+
# Or an empty install target.
85+
if: ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
86+
run: |
87+
cd ${{ inputs.workspace_path }}
88+
make install
89+
90+
- name: Build Makefile Docs
91+
# Assume non-js projects will use a Makefile to build docs.
92+
if: ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
93+
run: |
94+
cd ${{ inputs.workspace_path }}
95+
make docs
96+
97+
- name: Publish Highlight.run as Observability Plugin
98+
if: inputs.workspace_path == 'sdk/highlight-run'
99+
uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
33100
with:
34101
docs_path: sdk/highlight-run/docs
35102
output_path: packages/@launchdarkly/observability
36103
github_token: ${{ secrets.GITHUB_TOKEN }}
104+
105+
- name: Publish Docs
106+
# This is generalized to work with any package, but we don't use it for highlight-run,
107+
# because we publish its docs to a different path.
108+
if: inputs.workspace_path != 'sdk/highlight-run'
109+
uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
110+
with:
111+
docs_path: ${{ inputs.workspace_path }}/docs
112+
output_path: ${{ inputs.workspace_path }}
113+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Docs
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
publish-highlight-run-docs:
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}-publish-highlight-run-docs
13+
name: Publish Highlight.run Docs
14+
if: github.ref == 'refs/heads/main'
15+
uses: ./.github/workflows/manual-publish-docs.yml
16+
with:
17+
workspace_path: sdk/highlight-run
18+
19+
publish-observability-node-docs:
20+
concurrency: ${{ github.workflow }}-${{ github.ref }}-publish-observability-node-docs
21+
# Run the docs publish after the highlight.run docs are published.
22+
needs: publish-highlight-run-docs
23+
# Runs the job even if the highlight.run docs publish fails.
24+
if: ${{ always() && !cancelled() && github.ref == 'refs/heads/main'}}
25+
name: Publish @launchdarkly/observability-node Docs
26+
uses: ./.github/workflows/manual-publish-docs.yml
27+
with:
28+
workspace_path: sdk/@launchdarkly/observability-node

.github/workflows/python-plugin.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,25 @@ jobs:
2727
- uses: actions/checkout@v4
2828
with:
2929
token: ${{ secrets.GITHUB_TOKEN }}
30-
- name: Install poetry
31-
run: pipx install poetry
32-
- uses: actions/setup-python@v4
30+
31+
- uses: actions/setup-python@v5
3332
with:
34-
python-version: '3.12'
35-
cache: 'poetry'
36-
- run: poetry install --all-extras
33+
python-version: '3.10'
34+
35+
- name: Install poetry
36+
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
37+
38+
- run: make install
3739
- name: Lint
38-
run: poetry run black --check .
39-
# - name: Test
40-
# run: poetry run pytest --cov=ldobserve --cov-branch --cov-report xml
41-
# - name: Get Cover
42-
# if: github.event_name == 'pull_request'
43-
# uses: orgoro/coverage@v3
44-
# with:
45-
# coverageFile: ./sdk/@launchdarkly/observability-python/coverage.xml
46-
# token: ${{ secrets.GITHUB_TOKEN }}
40+
run: make lint
41+
- name: Test
42+
run: make test
43+
- name: Get Cover
44+
if: github.event_name == 'pull_request'
45+
uses: orgoro/coverage@v3
46+
with:
47+
coverageFile: ./sdk/@launchdarkly/observability-python/coverage.xml
48+
token: ${{ secrets.GITHUB_TOKEN }}
4749
- name: Build
4850
run: poetry build
4951
#- name: Validate PyProject
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Run Release Please
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release-package:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write # Contents and pull-requests are for release-please to make releases.
12+
pull-requests: write
13+
issues: write
14+
outputs:
15+
python-plugin-released: ${{ steps.release.outputs['sdk/@launchdarkly/observability-python--release_created'] }}
16+
python-plugin-tag-name: ${{ steps.release.outputs['sdk/@launchdarkly/observability-python--tag_name'] }}
17+
steps:
18+
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445
19+
id: release
20+
21+
- uses: actions/checkout@v4
22+
if: ${{ steps.release.outputs.releases_created == 'true' }}
23+
with:
24+
fetch-depth: 0 # If you only need the current version keep this.
25+
26+
release-python-plugin:
27+
runs-on: ubuntu-latest
28+
permissions:
29+
id-token: write # Used for publishing secrets and documentation.
30+
needs: ['release-package']
31+
if: ${{ needs.release-package.outputs.python-plugin-released == 'true' }}
32+
outputs:
33+
package-hashes: ${{ steps.package-hashes.outputs.package-hashes }}
34+
steps:
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.10'
38+
39+
- name: Install poetry
40+
41+
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
42+
43+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
44+
name: 'Get PyPI token'
45+
with:
46+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
47+
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
48+
49+
- name: Build Python plugin
50+
run: |
51+
cd sdk/@launchdarkly/observability-python
52+
make build
53+
54+
- name: Hash build files for provenance
55+
id: package-hashes
56+
shell: bash
57+
working-directory: ./sdk/@launchdarkly/observability-python/dist
58+
run: |
59+
echo "package-hashes=$(sha256sum * | base64 -w0)" >> "$GITHUB_OUTPUT"
60+
61+
- name: Publish package distributions to PyPI
62+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
63+
with:
64+
packages-dir: ./sdk/@launchdarkly/observability-python/dist
65+
password: ${{env.PYPI_AUTH_TOKEN}}
66+
67+
release-python-docs:
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
needs: ['release-python-plugin']
72+
steps:
73+
- name: Build and Publish Docs
74+
uses: ./.github/workflows/manual-publish-docs.yml
75+
with:
76+
workspace_path: sdk/@launchdarkly/observability-python
77+
78+
release-provenance:
79+
needs: ['release-package', 'release-python-plugin']
80+
if: ${{ needs.release-package.outputs.python-plugin-released == 'true' }}
81+
permissions:
82+
actions: read
83+
id-token: write
84+
contents: write
85+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
86+
with:
87+
base64-subjects: '${{ needs.release-python-plugin.outputs.package-hashes }}'
88+
upload-assets: true
89+
upload-tag-name: ${{ needs.release-package.outputs.python-plugin-tag-name }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"sdk/@launchdarkly/observability-python": "0.1.0"
3+
}

e2e/react-native-otel/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
app-example

e2e/react-native-otel/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# react-native-otel
2+
3+
## 1.0.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [011032f]
8+
- @launchdarkly/observability-react-native@0.2.1

e2e/react-native-otel/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# React Native OpenTelemetry Demo
2+
3+
This is a React Native application that demonstrates the LaunchDarkly Observability React Native SDK.
4+
5+
## Getting Started
6+
7+
1. **Install dependencies**:
8+
```bash
9+
yarn install
10+
```
11+
12+
2. **Start the OTel collector**:
13+
```bash
14+
yarn otel:start
15+
```
16+
17+
3. **Configure LaunchDarkly** (optional):
18+
- Adjust OTLP endpoint and configuration as needed
19+
20+
4. **Run the app** (remember to set your SDK key):
21+
```bash
22+
export LAUNCHDARKLY_MOBILE_KEY=<your_mobile_sdk_key>
23+
24+
# Start the Metro bundler
25+
yarn start
26+
27+
# Build and run in a specific simulator
28+
yarn ios:run
29+
```
30+
31+
## Configuration
32+
33+
### LaunchDarkly Setup
34+
35+
The observability plugin is configured in `lib/launchdarkly.ts`.

0 commit comments

Comments
 (0)