Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .config/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.clang-format @Datadog/libdatadog
.codecov.yml @Datadog/apm-common-components-core
.config/nextest.toml @Datadog/apm-common-components-core
.config/commitlint.config.js @Datadog/apm-common-components-core
.devcontainer @Datadog/apm-common-components-core
.dockerignore @Datadog/libdatadog-core
.github/ @Datadog/apm-common-components-core
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/pr-name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: pr-name
permissions:
pull-requests : read
contents: read
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
branches-ignore:
- "v[0-9]+.[0-9]+.[0-9]+"
- release

jobs:
pr_name_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
name: Install Node.js
with:
node-version: 16
- name: Install dependencies
run: |
npm install @commitlint/lint@18.6.1 @commitlint/load@18.6.1 @commitlint/config-conventional@18.6.2 @actions/core
- name: Lint PR name
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const load = require('@commitlint/load').default;
const lint = require('@commitlint/lint').default;

const CONFIG = {
extends: ['./.config/commitlint.config.js'],
};

const title = context.payload.pull_request.title;

core.info(`Linting: ${title}`);

load(CONFIG)
.then((opts) => {
lint(
title,
opts.rules,
opts.parserPreset ? {parserOpts: opts.parserPreset.parserOpts} : {}
).then((report) => {
report.warnings.forEach((warning) => {
core.warning(warning.message);
});

report.errors.forEach((error) => {
core.error(error.message);
});

if (!report.valid) {
core.setFailed("PR title linting failed");
}
});
});
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,75 @@ We also recommend that you share in your description:
If at any point you have a question or need assistance with your pull request, feel free to mention a project member!
We're always happy to help contributors with their pull requests.

## Commit Message Guidelines

This project uses [Conventional Commits](https://www.conventionalcommits.org/) for commit messages and pull request titles.
This format helps us automatically generate changelogs and determine semantic versioning.

### Format

Commit messages and PR titles should follow this structure:

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

### Common Types

- **feat**: A new feature for the user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: given that this is library code, where do you draw the line between "refactor" and "feat", for changes that affect APIs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My two cents: If capabilities or functionality aren't changing then it's a refactor, even if it's a breaking change for a public API because something like a function name has changed. If you add a new parameter to a function it's likely a feat.

@hoolioh Whatever we agree on should probably be documented to minimize confusion.

- **fix**: A bug fix
- **docs**: Documentation changes only
- **style**: Code style changes (formatting, missing semicolons, etc.) that don't affect functionality
- **refactor**: Code changes that neither fix a bug nor add a feature
- **perf**: Performance improvements
- **test**: Adding or updating tests
- **build**: Changes to the build system or external dependencies
- **ci**: Changes to CI configuration files and scripts
- **chore**: Other changes that don't modify src or test files

### Scope (Optional)

The scope provides additional context about which part of the codebase is affected:

```
feat(crashtracker): add signal handler for SIGSEGV
fix(profiling): correct memory leak in stack unwinding
docs(readme): update installation instructions
```

### Breaking Changes

Breaking changes should be indicated by a `!` after the type/scope:

```
feat!: remove deprecated API endpoint
```

### Examples

Good commit messages:
- `feat: add support for custom metadata tags`
- `fix(profiling): resolve deadlock in thread sampling`
- `docs: add examples for exception tracking`
- `chore: update dependencies to latest versions`
- `test(crashtracker): add integration tests for signal handling`

Poor commit messages:
- `update code` (not descriptive, missing type)
- `Fixed bug` (missing type format, not descriptive)
- `WIP` (not meaningful)

### Pull Request Titles

When your pull request is merged, all commits will be squashed into a single commit. The PR title will become the final
commit message, so it's important that it accurately describes your changes.For that reason your pull request title must
follow the conventional commit format described above. Our CI pipeline will automatically validate the PR title and fail
if it doesn't comply with the format. You can update the PR title at any time to fix any validation issues.

## Final word

Many thanks to all of our contributors, and looking forward to seeing you on Github! :tada:
Loading