-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs(sdk): Add CONTRIBUTING.md template #16854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
dd637a7
docs(sdk): Add CONTRIBUTING.md template and contributing-md skill
dingsdax 05a29bc
docs(sdk): Fix contributing-md skill path to sentry-sdk-skills plugin
dingsdax 38fc763
docs(sdk): Clarify contributing-md skill creates and updates
dingsdax 17ca698
docs(sdk): Align contributing-md template with develop-docs conventions
dingsdax 7274ae9
docs(sdk): Fix bugs found in SDK engineer review
dingsdax 1798216
docs(sdk): Simplify Getting Help — Discord + GH issues only
dingsdax 87c7906
docs(sdk): Remove ready-for-merge label reference
dingsdax 3f9cf8d
docs(sdk): Tighten template copy
dingsdax 440c50c
docs(sdk): Remove placeholder GitHub issues link to fix link checker
dingsdax 29cb1b9
docs(sdk): Replace smoke test placeholder with generic test command
dingsdax 88b5cb1
Merge branch 'master' into docs/contributing-md-template
dingsdax 563593e
docs(sdk): Fix redirect warnings from link checker
dingsdax 1170de8
Merge branch 'master' into docs/contributing-md-template
dingsdax 87581a1
Update develop-docs/sdk/getting-started/templates/contributing-md-tem…
dingsdax fff00de
Update develop-docs/sdk/getting-started/templates/contributing-md-tem…
dingsdax f19bdb3
Update develop-docs/sdk/getting-started/templates/contributing-md-tem…
dingsdax f21ab97
Merge branch 'master' into docs/contributing-md-template
dingsdax e418189
Merge branch 'master' into docs/contributing-md-template
stephanie-anderson 9ada569
Merge branch 'master' into docs/contributing-md-template
dingsdax 9db1e1d
fix(copyableCard): Handle heading tags in domToMarkdown
dingsdax 7761924
docs(contributing-md-template): Remove internal playbook links from t…
dingsdax 06cdbd2
ref(contributing-md-template): Rename to contributing-md, add redirect
dingsdax bb4c29e
fix(contributing-md): Fix skill link URL
dingsdax 89289e4
[getsentry/action-github-commit] Auto commit
getsantry[bot] 0929665
Merge branch 'master' into docs/contributing-md-template
dingsdax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
develop-docs/sdk/getting-started/templates/contributing-md-template.mdx
This file was deleted.
Oops, something went wrong.
101 changes: 101 additions & 0 deletions
101
develop-docs/sdk/getting-started/templates/contributing-md.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| title: CONTRIBUTING.md | ||
| sidebar_order: 20 | ||
| description: Boilerplate CONTRIBUTING.md template for Sentry SDK repositories. Tells contributors how to set up, develop, test, and submit changes. | ||
| --- | ||
|
|
||
| `CONTRIBUTING.md` is a Markdown file at the root of your repository that orients both external contributors and Sentry engineers before they open their first PR. GitHub surfaces it automatically on the Issues and Pull Requests tabs. | ||
|
|
||
| **Keep it short.** Detailed process lives on [develop.sentry.dev](https://develop.sentry.dev/sdk/) — link there, don't duplicate it. Target 100–200 lines. | ||
|
|
||
| ## What Belongs in CONTRIBUTING.md | ||
|
|
||
| - **Welcome + issue-first policy** — ask contributors to open an issue before a non-trivial PR. Link to the [handling external contributor PRs playbook](https://develop.sentry.dev/sdk/getting-started/playbooks/development/handling-external-contributor-pr/). | ||
| - **Getting started** — environment setup steps specific to this repo. Refer readers to the README for general project overview; CONTRIBUTING.md covers what's extra. | ||
| - **Development workflow** — commit format, branch naming, and changelog requirement. Link to the [code submission standard](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/) rather than restating it. | ||
| - **Testing** — exact commands to run the test suite, a subset, and lint. Include platform-specific notes (tox environments, Gradle tasks, Xcode schemes, etc.). | ||
| - **Submitting a PR** — open as draft until ready; fill out the PR template. Link to the [opening a PR playbook](https://develop.sentry.dev/sdk/getting-started/playbooks/development/opening-a-pr/). | ||
| - **Code review** — LOGAF scale (`h:`/`m:`/`l:`), expected SLAs (1 business day internal / 2 business days external). Link to the [reviewing a PR playbook](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-a-pr/). | ||
| - **AI-assisted contributions** — `Co-Authored-By` attribution required per the [AI attribution standard](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#ai-attribution). Point maintainers to the [reviewing AI-generated code playbook](https://develop.sentry.dev/sdk/getting-started/playbooks/development/reviewing-ai-generated-code/). | ||
| - **Getting help** — Discord server link, `#sdk-[language]` support channel. | ||
| - **Code of conduct** — link to [Sentry's Code of Conduct](https://open.sentry.io/code-of-conduct/). | ||
|
|
||
| **Do NOT include:** | ||
|
|
||
| - Full environment setup (belongs in README) | ||
| - Release / publish process (internal; link to sdk-lifecycle playbooks instead) | ||
| - Architecture or API design decisions (belongs in AGENTS.md) | ||
| - Verbatim copies of content already on develop.sentry.dev | ||
|
|
||
| ## Good Examples in SDK Repositories | ||
|
|
||
| Check if the repository already has one before starting from scratch. The following repos have well-structured examples worth referencing: | ||
|
|
||
| - [`getsentry/sentry-python`](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md) — clear integration development principles; good separation between user and contributor setup | ||
| - [`getsentry/sentry-javascript`](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md) — Volta pin for Node/yarn, concise monorepo workflow, explicit PR draft rule | ||
| - [`getsentry/sentry-go`](https://github.com/getsentry/sentry-go/blob/master/CONTRIBUTING.md) — explicit LOGAF scale usage, craft release-notes requirement called out | ||
| - [`getsentry/sentry-cocoa`](https://github.com/getsentry/sentry-cocoa/blob/main/CONTRIBUTING.md) — LOGAF examples with descriptions, copyright header rule | ||
| - [`getsentry/sentry-java`](https://github.com/getsentry/sentry-java/blob/main/CONTRIBUTING.md) — API compatibility validation workflow, clear step-by-step setup | ||
|
|
||
| ## Template | ||
|
|
||
| Use the [`sentry-sdk-skills:contributing-md`](https://github.com/getsentry/sdk-skills/tree/main/plugins/sentry-sdk-skills/skills/contributing-md) skill to create or update your `CONTRIBUTING.md` — it detects commands, CI config, and ecosystem from the repo, fills in the placeholders below, and preserves any SDK-specific sections already present. | ||
|
|
||
| Remove sections that don't apply and replace all `[placeholder]` values with real content. | ||
|
|
||
| <CopyableCard title="CONTRIBUTING.md"> | ||
|
|
||
| # Contributing to \[SDK name\] | ||
|
|
||
| We welcome contributions! Before submitting a non-trivial change, please open an issue | ||
| so we can align on scope and approach. Want to understand how we work? Our | ||
| [SDK development docs](https://develop.sentry.dev/sdk/) cover our engineering process | ||
| in detail. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| 1. Fork the repository and clone your fork. | ||
| 2. \[SDK-specific setup steps — e.g. install language runtime, create virtualenv, etc.\] | ||
| 3. Install dependencies: `[install command]` | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| See our [principles](https://develop.sentry.dev/sdk/getting-started/principles/) and [standards](https://develop.sentry.dev/sdk/getting-started/standards/) for SDK development. | ||
|
|
||
| ## Testing | ||
|
|
||
| Run the full test suite: `[full test command]` | ||
|
|
||
| Run a single test / test file: `[single test command]` | ||
|
|
||
| Lint and format: `[lint command]` / `[format command]` | ||
|
|
||
| \[Optional: platform-specific notes, e.g. tox environments, Gradle tasks, Xcode schemes, | ||
| required env vars, or native dependency setup for React Native (sentry-cocoa, sentry-java).\] | ||
|
|
||
| ## Submitting a Pull Request | ||
|
|
||
| Open as a **draft**, fill in the PR description, and ensure CI passes before marking ready. | ||
|
|
||
| ## Code Review | ||
|
|
||
| We use the **LOGAF scale** to signal comment weight: | ||
|
|
||
| - `h:` (high) — must fix: bugs, security, breakage | ||
| - `m:` (medium) — should fix: design, missing tests, clarity | ||
| - `l:` (low) — optional nit: style, minor suggestions | ||
|
|
||
|
|
||
| ## AI-Assisted Contributions | ||
|
|
||
| AI-generated code is welcome — include a `Co-Authored-By` trailer per the [AI attribution standard](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#ai-attribution). | ||
|
|
||
| ## Getting Help | ||
|
|
||
| Have a question? Join the [Sentry Discord](https://discord.com/invite/sentry) in **#sdk-\[language\]** or open a GitHub issue. | ||
|
|
||
| ## Code of Conduct | ||
|
|
||
| This project follows the [Sentry Code of Conduct](https://open.sentry.io/code-of-conduct/). | ||
|
|
||
| </CopyableCard> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // @vitest-environment jsdom | ||
| import {describe, expect, it} from 'vitest'; | ||
|
|
||
| import {domToMarkdown} from './copyableCard'; | ||
|
|
||
| function parse(html: string): HTMLElement { | ||
| const div = document.createElement('div'); | ||
| div.innerHTML = html; | ||
| return div; | ||
| } | ||
|
|
||
| describe('domToMarkdown', () => { | ||
| describe('headings', () => { | ||
| it.each([ | ||
| ['h1', '# text\n\n'], | ||
| ['h2', '## text\n\n'], | ||
| ['h3', '### text\n\n'], | ||
| ['h4', '#### text\n\n'], | ||
| ['h5', '##### text\n\n'], | ||
| ['h6', '###### text\n\n'], | ||
| ])('converts %s', (tag, expected) => { | ||
| expect(domToMarkdown(parse(`<${tag}>text</${tag}>`))).toBe(expected); | ||
| }); | ||
| }); | ||
|
|
||
| describe('inline formatting', () => { | ||
| it.each([ | ||
| ['<strong>bold</strong>', '**bold**'], | ||
| ['<b>bold</b>', '**bold**'], | ||
| ['<em>italic</em>', '*italic*'], | ||
| ['<i>italic</i>', '*italic*'], | ||
| ['<code>foo()</code>', '`foo()`'], | ||
| ])('converts %s', (html, expected) => { | ||
| expect(domToMarkdown(parse(html))).toBe(expected); | ||
| }); | ||
|
|
||
| it('converts a', () => { | ||
| expect(domToMarkdown(parse('<a href="https://example.com">link</a>'))).toBe( | ||
| '[link](https://example.com)' | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe('block elements', () => { | ||
| it('converts p', () => { | ||
| expect(domToMarkdown(parse('<p>hello</p>'))).toBe('hello\n\n'); | ||
| }); | ||
| it('converts ul with li', () => { | ||
| expect(domToMarkdown(parse('<ul><li>a</li><li>b</li></ul>'))).toBe('- a\n- b\n\n'); | ||
| }); | ||
| it('converts ol with li', () => { | ||
| expect(domToMarkdown(parse('<ol><li>first</li><li>second</li></ol>'))).toBe( | ||
| '1. first\n2. second\n\n' | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe('checkboxes', () => { | ||
| it('converts unchecked checkbox', () => { | ||
| expect(domToMarkdown(parse('<input type="checkbox" />'))).toBe('[ ] '); | ||
| }); | ||
| it('converts checked checkbox', () => { | ||
| const div = parse('<input type="checkbox" />'); | ||
| (div.querySelector('input') as HTMLInputElement).checked = true; | ||
| expect(domToMarkdown(div)).toBe('[x] '); | ||
| }); | ||
| }); | ||
|
|
||
| describe('document structure', () => { | ||
| it('preserves heading prefixes in a full document', () => { | ||
| const result = domToMarkdown( | ||
| parse('<h1>Title</h1><h2>Section</h2><p>Body text.</p>') | ||
| ); | ||
| expect(result).toBe('# Title\n\n## Section\n\nBody text.\n\n'); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-linked headings produce malformed copied markdown
Medium Severity
The new heading cases in
domToMarkdowndon't account forrehype-autolink-headings(configured withbehavior: 'wrap'inmdx.ts), which wraps heading content in<a>tags. This is the firstCopyableCardcontaining headings. When copied, each heading's inner<a>is converted to a markdown link, producing output like## [Getting Started](#getting-started)instead of## Getting Started. For the h1, nested brackets (# [Contributing to [SDK name]](#…)) break markdown parsing entirely.Additional Locations (1)
develop-docs/sdk/getting-started/templates/contributing-md.mdx#L45-L101