Skip to content
Closed
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Run "mage gen:readme" to regenerate this section.
| Discoverability / `discoverability` | Warns about missing keywords and description that are used for plugin indexing in the catalog. | None |
| Go Manifest / `go-manifest` | Validates the build manifest. | None |
| Go Security Checker / `go-sec` | Inspects source code for security problems by scanning the Go AST. | [gosec](https://github.com/securego/gosec), `sourceCodeUri` |
| Grafana Tooling Compliance / `toolingcompliance` | Ensures the plugin uses Grafana's standard plugin tooling (create-plugin). | None |
| JS Source Map / `jsMap` | Checks for required `module.js.map` file(s) in archive. | `sourceCodeUri` |
| Legacy Grafana Toolkit usage / `legacybuilder` | Detects the usage of the not longer supported Grafana Toolkit. | None |
| Legacy Platform / `legacyplatform` | Detects use of Angular which is deprecated. | None |
Expand All @@ -289,6 +290,7 @@ Run "mage gen:readme" to regenerate this section.
| Safe Links / `safelinks` | Checks that links from `plugin.json` are safe. | None |
| Screenshots / `screenshots` | Screenshots are specified in `plugin.json` that will be used in the Grafana plugin catalog. | None |
| SDK Usage / `sdkusage` | Ensures that `grafana-plugin-sdk-go` is up-to-date. | None |
| SemVer Compliance / `semvercheck` | Uses LLM to detect breaking changes and verify version increments match SemVer conventions. | None |
| Signature / `signature` | Ensures the plugin has a valid signature. | None |
| Source Code / `sourcecode` | A comparison is made between the zip file and the source code to ensure what is released matches the repo associated with it. | `sourceCodeUri` |
| Sponsorship Link / `sponsorshiplink` | Checks if a sponsorship link is specified in `plugin.json` that will be shown in the Grafana plugin catalog for users to support the plugin developer. | None |
Expand Down
4 changes: 4 additions & 0 deletions pkg/analysis/passes/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ import (
"github.com/grafana/plugin-validator/pkg/analysis/passes/safelinks"
"github.com/grafana/plugin-validator/pkg/analysis/passes/screenshots"
"github.com/grafana/plugin-validator/pkg/analysis/passes/sdkusage"
"github.com/grafana/plugin-validator/pkg/analysis/passes/semvercheck"
"github.com/grafana/plugin-validator/pkg/analysis/passes/signature"
"github.com/grafana/plugin-validator/pkg/analysis/passes/sourcecode"
"github.com/grafana/plugin-validator/pkg/analysis/passes/sponsorshiplink"
"github.com/grafana/plugin-validator/pkg/analysis/passes/templatereadme"
"github.com/grafana/plugin-validator/pkg/analysis/passes/toolingcompliance"
"github.com/grafana/plugin-validator/pkg/analysis/passes/trackingscripts"
"github.com/grafana/plugin-validator/pkg/analysis/passes/typesuffix"
"github.com/grafana/plugin-validator/pkg/analysis/passes/unsafesvg"
Expand Down Expand Up @@ -91,9 +93,11 @@ var Analyzers = []*analysis.Analyzer{
restrictivedep.Analyzer,
screenshots.Analyzer,
sdkusage.Analyzer,
semvercheck.Analyzer,
signature.Analyzer,
sourcecode.Analyzer,
templatereadme.Analyzer,
toolingcompliance.Analyzer,
trackingscripts.Analyzer,
typesuffix.Analyzer,
unsafesvg.Analyzer,
Expand Down
51 changes: 51 additions & 0 deletions pkg/analysis/passes/semvercheck/prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
You will analyze changes in this Grafana plugin to detect breaking changes and verify SemVer compliance. Use `git diff` to see the diff and `git show` to see full files in a specific commit.

Analyze the changes between the versions focusing on:
1. Breaking changes (API changes, removed functionality, behavioral changes that could break existing users)
2. New features (new functionality, new APIs, new options)
3. Bug fixes (corrections to existing functionality)

## Definitions for Grafana Plugins

### Breaking Changes (require MAJOR version bump)
- Removed or renamed exported functions, components, or types
- Changed function signatures (parameters, return types)
- Removed configuration options
- Changed default behavior in ways that could break existing setups
- Removed support for previously supported data formats
- Changed plugin.json schema in incompatible ways (removed fields, changed types)
- Removed panel options or changed their structure

### New Features (require MINOR version bump)
- Added new exported functions, components, or types
- Added new configuration options
- Added new panel features or visualization options
- Added support for new data sources or formats
- Added new query capabilities

### Bug Fixes (require PATCH version bump)
- Fixed incorrect behavior
- Fixed edge cases
- Performance improvements
- Documentation updates
- Dependency updates (non-breaking)

New version: {{.NewVersion}} introduced in commit: {{.NewCommit}}
Current version: {{.CurrentVersion}} introduced in commit: {{.CurrentCommit}}

Analyze the changes and write your analysis to a JSON file "replies.json" with this format:

{
"has_breaking_changes": true|false,
"has_new_features": true|false,
"has_bug_fixes": true|false,
"breaking_changes_list": ["description of breaking change 1", "description of breaking change 2"],
"new_features_list": ["description of new feature 1", "description of new feature 2"],
"bug_fixes_list": ["description of bug fix 1", "description of bug fix 2"],
"recommended_version_bump": "major|minor|patch",
"explanation": "Brief explanation of why this version bump is recommended based on the changes"
}

Use jq to validate replies.json is valid JSON, fix any issues if necessary.

Once you are finished say "I finished the SemVer analysis"
Loading
Loading