Skip to content

Commit b7c6954

Browse files
authored
Merge pull request #6 from posit-dev/toph/pcc-otel
feat: publisher-command-center with otel wiring
2 parents 70b4a27 + 7a9ed59 commit b7c6954

Some content is hidden

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

42 files changed

+3688
-8
lines changed

.github/workflows/extensions.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ jobs:
152152
runs-on: ubuntu-latest
153153
permissions:
154154
pull-requests: read
155-
# outputs:
155+
outputs:
156+
publisher-command-center-otel: ${{ steps.changes.outputs.publisher-command-center-otel }}
156157
# Adding a new extension with a complex build process?
157158
# Add a new line here with the name of the extension as the name of the
158159
# filter and the step output variable below
@@ -162,17 +163,25 @@ jobs:
162163
steps:
163164
- uses: actions/checkout@v4
164165

165-
# Uncomment when adding the first complex extension
166-
# - uses: dorny/paths-filter@v3
167-
# id: changes
168-
# with:
166+
- uses: dorny/paths-filter@v3
167+
id: changes
168+
with:
169169
# # Adding a new extension that has a complex build process?
170170
# # Add a new line here with the name of the extension and directory path
171171
# # Be sure the extension name and directory have the same name
172172
# # e.g. `extension-name: extensions/extension-name/**`
173-
# filters: |
174-
# extension-name: extensions/extension-name/**
175-
173+
filters: |
174+
publisher-command-center-otel: extensions/publisher-command-center-otel/**
175+
176+
# Creates and releases the Publisher Command Center extension using a custom
177+
# workflow
178+
publisher-command-center-otel:
179+
needs: [complex-extension-changes]
180+
# Only runs if the `complex-extension-changes` job detects changes in the
181+
# publisher-command-center-otel extension directory
182+
if: ${{ needs.complex-extension-changes.outputs.publisher-command-center-otel == 'true' }}
183+
uses: ./.github/workflows/publisher-command-center-otel.yml
184+
secrets: inherit
176185

177186
# All extensions have been linted, packaged, and released, if necessary
178187
# Continuing to update the extension list with the latest release data
@@ -186,6 +195,7 @@ jobs:
186195
# completed before running this job
187196
needs: [
188197
simple-extension-release,
198+
publisher-command-center-otel,
189199
# Add complex extension job names here as needed
190200
]
191201
if: ${{ always() }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Publisher Commander Center Extension
2+
3+
on:
4+
workflow_call:
5+
6+
# Setup the environment with the extension name for easy re-use
7+
# Also need the GH_TOKEN for the release-extension action to be able to use gh
8+
env:
9+
EXTENSION_NAME: publisher-command-center-otel
10+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
extension:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: ./extensions/${{ env.EXTENSION_NAME }}
18+
19+
steps:
20+
# Checkout the repository so the rest of the actions can run with no issue
21+
- uses: actions/checkout@v4
22+
23+
# We want to fail quickly if the linting fails, do that first
24+
- uses: ./.github/actions/lint-extension
25+
with:
26+
extension-name: ${{ env.EXTENSION_NAME }}
27+
28+
# Publisher Command Center needs to setup node, install dependencies, and
29+
# build to make the files needed for the extension
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: "lts/*"
33+
cache: "npm"
34+
cache-dependency-path: extensions/${{ env.EXTENSION_NAME }}/package-lock.json
35+
36+
- run: npm ci
37+
- run: npm run build
38+
39+
# Now that the extension is built we need to upload an artifact to pass
40+
# to the package-extension action that contains the files we want to be
41+
# included in the extension
42+
# This only includes necessary files for the extension to run leaving out
43+
# the files that were used to build the /dist/ directory
44+
- name: Upload built extension
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: ${{ env.EXTENSION_NAME }}
48+
path: |
49+
extensions/${{ env.EXTENSION_NAME }}/dist/
50+
extensions/${{ env.EXTENSION_NAME }}/requirements.txt
51+
extensions/${{ env.EXTENSION_NAME }}/app.py
52+
extensions/${{ env.EXTENSION_NAME }}/manifest.json
53+
extensions/${{ env.EXTENSION_NAME }}/connect-extension.toml
54+
55+
# Package up the extension into a TAR using the generalized
56+
# package-extension action
57+
- uses: ./.github/actions/package-extension
58+
with:
59+
extension-name: ${{ env.EXTENSION_NAME }}
60+
artifact-name: ${{ env.EXTENSION_NAME }}
61+
62+
connect-integration-tests:
63+
needs: extension
64+
uses: ./.github/workflows/connect-integration-tests.yml
65+
secrets: inherit
66+
with:
67+
extensions: '["publisher-command-center-otel"]' # JSON array format to match the workflow input schema
68+
69+
release:
70+
runs-on: ubuntu-latest
71+
needs: [extension, connect-integration-tests]
72+
# Release the extension using the release-extension action
73+
# Will only create a GitHub release if merged to `main` and the semver
74+
# version has been updated
75+
steps:
76+
# Checkout the repository so the rest of the actions can run with no issue
77+
- uses: actions/checkout@v4
78+
79+
- uses: ./.github/actions/release-extension
80+
with:
81+
extension-name: ${{ env.EXTENSION_NAME }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,json,yml}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 2
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
/.pnp.* binary linguist-generated

0 commit comments

Comments
 (0)