Skip to content

Commit 155070c

Browse files
committed
ci: CODEOWNERS and conv commits remove scope
- Add a CODEOWNERS file. - Amend conventional commits CI validation for shorter line lengths on subject and remove type(scope): subject the scope requirement.
1 parent 20e6576 commit 155070c

File tree

3 files changed

+68
-11
lines changed

3 files changed

+68
-11
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @yaythomas @wangyb-A

.github/workflows/lintcommit.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ function validateTitle(title) {
5656
return `invalid type "${type}"`;
5757
} else if (!scope && typeScope.includes("(")) {
5858
return `must be formatted like type(scope):`;
59-
} else if (!scope && ["feat", "fix"].includes(type)) {
60-
return `"${type}" type must include a scope (example: "${type}(testing-sdk)")`;
6159
} else if (scope && scope.length > 30) {
6260
return "invalid scope (must be <=30 chars)";
6361
} else if (scope && /[^- a-z0-9]+/.test(scope)) {
@@ -66,8 +64,8 @@ function validateTitle(title) {
6664
return `invalid scope "${scope}" (valid scopes are ${Array.from(scopes).join(", ")})`;
6765
} else if (subject.length === 0) {
6866
return "empty subject";
69-
} else if (subject.length > 100) {
70-
return "invalid subject (must be <=100 chars)";
67+
} else if (subject.length > 50) {
68+
return "invalid subject (must be <=50 chars)";
7169
}
7270

7371
return undefined;
@@ -97,7 +95,7 @@ Invalid pull request title: \`${title}\`
9795
* Expected format: \`type(scope): subject...\`
9896
* type: one of (${Array.from(types).join(", ")})
9997
* scope: optional, lowercase, <30 chars
100-
* subject: must be <100 chars
98+
* subject: must be <50 chars
10199
* Hint: *close and re-open the PR* to re-trigger CI (after fixing the PR title).
102100
`
103101
: `Pull request title matches the expected format`;
@@ -121,7 +119,7 @@ function _test() {
121119
"chore: update dependencies": undefined,
122120
"ci: configure CI/CD": undefined,
123121
"config: update configuration files": undefined,
124-
"deps: bump the aws-sdk group across 1 directory with 5 updates": undefined,
122+
"deps: bump aws-sdk group with 5 updates": undefined,
125123
"docs: update documentation": undefined,
126124
"feat(testing-sdk): add new feature": undefined,
127125
"feat(testing-sdk):": "empty subject",
@@ -130,12 +128,12 @@ function _test() {
130128
"feat(foo: sujet": 'invalid type "feat(foo"',
131129
"feat(Q Foo Bar): bar":
132130
'invalid scope (must be lowercase, ascii only): "Q Foo Bar"',
133-
"feat(testing-sdk): bar": undefined,
131+
"feat(examples): bar": undefined,
134132
"feat(testing-sdk): x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ":
135-
"invalid subject (must be <=100 chars)",
136-
"feat: foo": '"feat" type must include a scope (example: "feat(testing-sdk)")',
137-
"fix: foo": '"fix" type must include a scope (example: "fix(testing-sdk)")',
138-
"fix(testing-sdk): resolve issue": undefined,
133+
"invalid subject (must be <=50 chars)",
134+
"feat: foo": undefined,
135+
"fix: foo": undefined,
136+
"fix(examples): resolve issue": undefined,
139137
"foo (scope): bar": 'type contains whitespace: "foo "',
140138
"invalid title": "missing colon (:) char",
141139
"perf: optimize performance": undefined,

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,64 @@ To send us a pull request, please:
215215
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
216216
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
217217

218+
### Pull Request Title and Commit Message Format
219+
220+
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for PR titles and commit messages. This helps us maintain a clear project history and enables automated tooling.
221+
222+
**Format:** `type: subject`
223+
224+
- **type**: The type of change (required)
225+
- **subject**: Brief description of the change (required, max 50 characters)
226+
227+
**Valid types:**
228+
- `feat`: New features
229+
- `fix`: Bug fixes
230+
- `docs`: Documentation changes
231+
- `test`: Adding or updating tests
232+
- `refactor`: Code refactoring without functional changes
233+
- `perf`: Performance improvements
234+
- `style`: Code style/formatting changes
235+
- `chore`: Maintenance tasks
236+
- `ci`: CI/CD changes
237+
- `build`: Build system changes
238+
- `deps`: Dependency updates
239+
240+
**Examples:**
241+
```
242+
feat: add retry mechanism for operations
243+
fix: resolve memory leak in execution state
244+
docs: update API documentation for context
245+
test: add integration tests for parallel exec
246+
feat(sdk): implement new callback functionality
247+
fix(examples): correct timeout handling
248+
```
249+
250+
**Requirements:**
251+
- Subject line must be 50 characters or less
252+
- Body text should wrap at 72 characters for good terminal display
253+
- Use lowercase for type and scope
254+
- Use imperative mood in subject ("add" not "added" or "adds")
255+
- No period at the end of the subject line
256+
- Use conventional commit message format with clear, concise descriptions
257+
- Body should provide detailed explanation of changes with bullet points when helpful
258+
259+
**Full commit message example:**
260+
```
261+
feat: add retry mechanism for operations
262+
263+
- Implement exponential backoff strategy for transient failures
264+
- Add configurable retry limits and timeout settings
265+
- Include comprehensive error logging for debugging
266+
- Update documentation with retry configuration examples
267+
268+
Resolves issue with intermittent network failures causing
269+
execution interruptions in production environments.
270+
```
271+
272+
The PR title will be used as the commit message when your PR is merged, so please ensure it follows this format.
273+
274+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
275+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
218276

219277
## Finding contributions to work on
220278
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.

0 commit comments

Comments
 (0)