Skip to content

Commit fb309f0

Browse files
Python (chore): add pytest plugin docs (#551)
1 parent 52f23b8 commit fb309f0

5 files changed

Lines changed: 733 additions & 1 deletion

File tree

.github/workflows/python_build_docs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: write
25+
pull-requests: write
2526
steps:
2627
- name: Checkout code
2728
uses: actions/checkout@v4
@@ -72,6 +73,36 @@ jobs:
7273
env:
7374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7475

76+
- name: Comment docs preview link on PR
77+
if: github.event_name == 'pull_request'
78+
uses: actions/github-script@v7
79+
with:
80+
script: |
81+
const marker = '<!-- mike-docs-preview -->';
82+
const alias = '${{ steps.version.outputs.alias }}';
83+
const version = '${{ steps.version.outputs.version }}';
84+
const url = `https://sift-stack.github.io/sift/python/${alias}/`;
85+
const body = [
86+
marker,
87+
`**Python docs preview:** ${url}`,
88+
``,
89+
`Deployed from \`${version}\`. The link may take up to a minute to become live as GitHub Pages propagates.`,
90+
].join('\n');
91+
92+
const { owner, repo } = context.repo;
93+
const issue_number = context.issue.number;
94+
95+
const { data: comments } = await github.rest.issues.listComments({
96+
owner, repo, issue_number, per_page: 100,
97+
});
98+
const existing = comments.find(c => c.body && c.body.includes(marker));
99+
100+
if (existing) {
101+
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
102+
} else {
103+
await github.rest.issues.createComment({ owner, repo, issue_number, body });
104+
}
105+
75106
cleanup_docs:
76107
if: github.event.action == 'closed'
77108
runs-on: ubuntu-latest

python/docs/examples/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This section contains interactive Jupyter notebook examples demonstrating how to
66

77
- **[Basic Usage](basic.ipynb)** - Introduction to the Sift Python client, covering basic operations and API usage
88
- **[Data Ingestion](ingestion.ipynb)** - Learn how to ingest telemetry data into Sift using various methods
9+
- **[Pytest Plugin](pytest_plugin.md)** - Turn a pytest run into a Sift TestReport with measurements, nested steps, and pass/fail outcomes
910

1011
## Running Examples Locally
1112

0 commit comments

Comments
 (0)