Skip to content

Commit cbf31f2

Browse files
chore: Updated CI process for releases (newrelic#176)
1 parent b2068d2 commit cbf31f2

File tree

6 files changed

+116
-7
lines changed

6 files changed

+116
-7
lines changed

lib/instrumentation/koa/.github/PULL_REQUEST_TEMPLATE.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@ This code is leveraged to monitor critical services. Please consider the followi
66
* Performance matters.
77
* Features that are specific to just your app are unlikely to make it in.
88
9-
Please fill out the relevant sections as follows:
10-
* Proposed Release Notes: Bulleted list of recommended release notes for the change(s).
11-
* Links: Any relevant links for the change.
12-
* Details: In-depth description of changes, other technical notes, etc.
9+
Ensure that your Pull Request title adheres to our Conventional Commit standards
10+
as described in CONTRIBUTING.md
11+
12+
Please update the Pull Request description to add relevant context or documentation about
13+
the submitted change.
1314
-->
15+
## Description
16+
17+
Please provide a brief description of the changes introduced in this pull request.
18+
What problem does it solve? What is the context of this change?
19+
20+
## How to Test
1421

15-
## Proposed Release Notes
22+
Please describe how you have tested these changes. Have you run the code against an example application?
23+
What steps did you take to ensure that the changes are working correctly?
1624

17-
## Links
25+
## Related Issues
1826

19-
## Details
27+
Please include any related issues or pull requests in this section, using the format `Closes #<issue number>` or `Fixes #<issue number>` if applicable.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
# Disable version updates for npm dependencies, security updates don't use this configuration
5+
# See: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates
6+
open-pull-requests-limit: 0
7+
directory: "/"
8+
schedule:
9+
interval: "daily"
10+
commit-message:
11+
prefix: "security"
12+
prefix-development: "chore"
13+
include: "scope"

lib/instrumentation/koa/.github/workflows/prepare-release.yml

+7
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ on:
66
release_type:
77
description: Type of release. patch or minor (major if breaking)
88
required: true
9+
type: choice
910
default: patch
11+
options:
12+
- patch
13+
- minor
14+
- major
1015

1116
jobs:
1217
release-notes:
1318
uses: newrelic/node-newrelic/.github/workflows/prep-release.yml@main
1419
with:
1520
release_type: ${{ github.event.inputs.release_type }}
21+
use_new_relase: ${{ vars.USE_NEW_RELEASE }}
22+
changelog_file: CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Validate Pull Request
2+
3+
permissions:
4+
pull-requests: write
5+
6+
on:
7+
pull_request:
8+
types:
9+
- opened
10+
- edited
11+
- synchronize
12+
13+
jobs:
14+
validate-pr:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Pull Request Title is Conventional
18+
id: lint_pr_title
19+
uses: amannn/action-semantic-pull-request@v5
20+
with:
21+
# Recommended Prefixes from https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/README.md#type-enum
22+
types: |
23+
build
24+
chore
25+
ci
26+
docs
27+
feat
28+
fix
29+
perf
30+
refactor
31+
revert
32+
security
33+
style
34+
test
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- if: failure()
38+
name: Add PR comment if failed
39+
uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
header: pr-title-lint-error
42+
message: |
43+
Thank you for your contribution! We require all PR titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
44+
Please update your PR title with the appropriate type and we'll try again!
45+
```
46+
${{ steps.lint_pr_title.outputs.error_message}}
47+
```
48+
- if: success()
49+
name: Remove PR comment if valid
50+
uses: marocchino/sticky-pull-request-comment@v2
51+
with:
52+
header: pr-title-lint-error
53+
delete: true

lib/instrumentation/koa/CONTRIBUTING.md

+24
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ If you’re planning on contributing a new feature or an otherwise complex contr
5858

5959
In general, we try to limit adding third-party production dependencies. If one is necessary, please be prepared to make a clear case for the need.
6060

61+
### Commit Guidelines
62+
63+
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to format commit messages for this repository. Conventional Commits provide a standardized format for commit messages that allows for automatic generation of changelogs and easy tracking of changes.
64+
65+
When contributing to this repository, please ensure that your commit messages adhere to the Conventional Commit guidelines. Specifically, your commit messages should:
66+
67+
* Start with a type, indicating the kind of change being made (e.g. `feat` for a new feature, `fix` for a bugfix, etc.). The types we support are:
68+
* `build`: changes that affect the build system or external dependencies
69+
* `chore`: changes that do not modify source or test files
70+
* `ci`: changes to our CI configuration files and scripts
71+
* `docs`: documentation additions or updates
72+
* `feat`: new features or capabilities added to the agent
73+
* `fix`: bugfixes or corrections to existing functionality
74+
* `perf`: performance improvements
75+
* `refactor`: changes that do not add new feature or fix bugs, but improve code structure or readability
76+
* `revert`: revert a previous commit
77+
* `security`: changes related to the security of the agent, including the updating of dependencies due to CVE
78+
* `style` - changes that do not affect the meaning of the code (e.g. formatting, white-space, etc.)
79+
* `test` - adding new tests or modifying existing tests
80+
* Use the imperative, present tense (e.g. "add feature" instead of "added feature")
81+
* Optionally, include a scope in parantheses after the type to indicate which part of the repository is affected (e.g. `feat(instrumentation): add support for Prisma Client`)
82+
83+
Please note that we use the [Squash and Merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) method when merging Pull Requests into the main branch. We do not use the original commit messages from each individual commit. Instead, we use the Pull Request title as the commit message for the squashed commit, and as such, require that the Pull Request title adheres to our Conventional Commit standards. Any additional documentation or information relevant to the release notes should be added to the "optional extended description" section of the squash commit on merge.
84+
6185
### Coding Style Guidelines/Conventions
6286

6387
We use eslint to enforce certain coding standards. Please see our [.eslintrc](./.eslintrc.js) file for specific rule configuration.
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"repository": "newrelic/node-newrelic-koa",
3+
"entries": []
4+
}

0 commit comments

Comments
 (0)