Skip to content

Commit

Permalink
Add Changesets configuration and update development documentation (#1964
Browse files Browse the repository at this point in the history
)

Introduce Changesets for versioning and changelog generation, and
enhance development documentation to guide contributors on using
Changesets effectively.
  • Loading branch information
zoltanbedi authored Feb 6, 2025
1 parent c2ffd31 commit aa63bb8
Show file tree
Hide file tree
Showing 6 changed files with 477 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
32 changes: 32 additions & 0 deletions .changeset/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const changelogFunctions = {
getReleaseLine: async (changeset, type, options) => {
let prefix = '🎉';
if (type === 'major') {
prefix = '🎉';
} else if (type === 'minor') {
prefix = '🚀';
} else if (type === 'patch') {
prefix = '🐛';
}
if (changeset && changeset.summary) {
const summary = changeset.summary || '';
if (summary.indexOf('Docs') > -1) {
prefix = '📝';
}
if (
summary.indexOf('Chore') > -1 ||
summary.indexOf('grafana-plugin-sdk-go') > -1 ||
summary.indexOf('compiled') > -1
) {
prefix = '⚙️';
}
return [prefix, summary].join(' ');
}
return [prefix, changeset?.summary].join(' ');
},
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
return '\n';
},
};

module.exports = changelogFunctions;
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "./changelog.js",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
13 changes: 11 additions & 2 deletions DEVELOPMENT_GUIDE.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ make build-debug
```

Then, configure your editor to connect to [delve](https://github.com/go-delve/delve) debugger running in headless mode. This is an example for VS Code:

```json
{
"version": "0.2.0",
Expand All @@ -36,10 +37,18 @@ Then, configure your editor to connect to [delve](https://github.com/go-delve/de
"request": "attach",
"mode": "remote",
"port": 3222,
"host": "127.0.0.1",
},
"host": "127.0.0.1"
}
]
}
```

Finally, run grafana-server and then execute `./debug-backend.sh` from grafana-zabbix root folder. This script will attach delve to running plugin. Now you can go to the VS Code and run _Debug backend plugin_ debug config.

## Submitting PR

If you are creating a PR, ensure to run `yarn changeset` from your branch. Provide the details accordingly. It will create `*.md` file inside `./.changeset` folder. Later during the release, based on these changesets, package version will be bumped and changelog will be generated.

## Releasing & Bumping version

To create a new release, execute `yarn changeset version`. This will update the Changelog and bump the version in `package.json` file. Commit those changes. Run the `Plugins - CD` GitHub Action to publish the new release.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@changesets/cli": "^2.27.12",
"@grafana/eslint-config": "^6.0.0",
"@grafana/plugin-e2e": "^1.17.1",
"@grafana/tsconfig": "^1.2.0-rc1",
Expand Down
Loading

0 comments on commit aa63bb8

Please sign in to comment.