Skip to content

Commit 94448cc

Browse files
merge master
2 parents 028716b + 09728a5 commit 94448cc

File tree

14 files changed

+325
-68
lines changed

14 files changed

+325
-68
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Enforce Draft PR
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
enforce-draft:
9+
name: Enforce Draft PR
10+
runs-on: ubuntu-24.04
11+
if: github.event.pull_request.draft == false
12+
steps:
13+
- name: Generate GitHub App token
14+
id: app-token
15+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
16+
with:
17+
app-id: ${{ vars.SDK_MAINTAINER_BOT_APP_ID }}
18+
private-key: ${{ secrets.SDK_MAINTAINER_BOT_PRIVATE_KEY }}
19+
20+
- name: Convert PR to draft
21+
env:
22+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
23+
PR_URL: ${{ github.event.pull_request.html_url }}
24+
run: |
25+
gh pr ready "$PR_URL" --undo
26+
27+
- name: Label and comment
28+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
29+
with:
30+
github-token: ${{ steps.app-token.outputs.token }}
31+
script: |
32+
const pullRequest = context.payload.pull_request;
33+
const repo = context.repo;
34+
35+
// Label the PR so maintainers can filter/track violations
36+
await github.rest.issues.addLabels({
37+
...repo,
38+
issue_number: pullRequest.number,
39+
labels: ['converted-to-draft'],
40+
});
41+
42+
// Check for existing bot comment to avoid duplicates on reopen
43+
const comments = await github.rest.issues.listComments({
44+
...repo,
45+
issue_number: pullRequest.number,
46+
});
47+
const botComment = comments.data.find(c =>
48+
c.user.type === 'Bot' &&
49+
c.body.includes('automatically converted to draft')
50+
);
51+
if (botComment) {
52+
core.info('Bot comment already exists, skipping.');
53+
return;
54+
}
55+
56+
const contributingUrl = `https://github.com/${repo.owner}/${repo.repo}/blob/master/CONTRIBUTING.md`;
57+
58+
await github.rest.issues.createComment({
59+
...repo,
60+
issue_number: pullRequest.number,
61+
body: [
62+
`This PR has been automatically converted to draft. All PRs must start as drafts per our [contributing guidelines](${contributingUrl}).`,
63+
'',
64+
'**Next steps:**',
65+
'1. Ensure CI passes',
66+
'2. Fill in the PR description completely',
67+
'3. Mark as "Ready for review" when you\'re done'
68+
].join('\n')
69+
});

.github/workflows/test-integrations-ai.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ jobs:
6969
run: |
7070
set -x # print commands that are executed
7171
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub"
72+
- name: Test litellm
73+
run: |
74+
set -x # print commands that are executed
75+
./scripts/runtox.sh "py${{ matrix.python-version }}-litellm"
7276
- name: Test openai-base
7377
run: |
7478
set -x # print commands that are executed

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Please search the [issue tracker](https://github.com/getsentry/sentry-python/iss
1010

1111
## Submitting Changes
1212

13+
Before submitting a pull request, please check whether the issue you're planning to address, if there is one, is assigned to anyone. If you want to help with an issue that already has an assignee, comment on it first to coordinate with the person assigned whether the contribution would make sense before opening a pull request.
14+
15+
To make a contribution:
16+
1317
- Fork the `sentry-python` repo and prepare your changes.
1418
- Add tests for your changes to `tests/`.
1519
- Run tests and make sure all of them pass.
@@ -21,6 +25,18 @@ We will review your pull request as soon as possible. Thank you for contributing
2125

2226
You are welcome to use whatever tools you prefer for making a contribution. However, any changes you propose have to be reviewed and tested by you, a human, first, before you submit a pull request with them for the Sentry team to review. If we feel like that didn't happen, we will close the PR outright. For example, we won't review visibly AI-generated PRs from an agent instructed to look for and "fix" open issues in the repo.
2327

28+
## Pull Requests
29+
30+
All PRs must be created as **drafts**. Non-draft PRs will be automatically converted to draft. Mark your PR as "Ready for review" once:
31+
32+
- CI passes
33+
- The PR description is complete (what, why, and links to relevant issues)
34+
- You've personally reviewed your own changes
35+
36+
A PR should do one thing well. Don't mix functional changes with unrelated refactors or cleanup. Smaller, focused PRs are easier to review, reason about, and revert if needed.
37+
38+
For the full set of PR standards, see the [code submission standard](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#pull-requests).
39+
2440
## Development Environment
2541

2642
### Set up Python

scripts/populate_tox/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@
230230
"package": "launchdarkly-server-sdk",
231231
"num_versions": 2,
232232
},
233+
"litellm": {
234+
"package": "litellm",
235+
},
233236
"litestar": {
234237
"package": "litestar",
235238
"deps": {

scripts/populate_tox/package_dependencies.jsonl

Lines changed: 4 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)