Skip to content

Commit 09b834f

Browse files
committed
Setup GitHub repository
1 parent 0571b93 commit 09b834f

File tree

9 files changed

+203
-0
lines changed

9 files changed

+203
-0
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
The Stackrox code of conduct can be found [here](https://stackrox.io/code-conduct).

.github/CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contributing to StackRox MCP
2+
3+
Thank you for your interest in contributing to StackRox MCP! This document provides guidelines and instructions for contributing to the project.
4+
5+
## Development Guidelines
6+
7+
### Code Quality Standards
8+
9+
All code must pass the following checks before being merged:
10+
11+
- **Formatting:** Run `go fmt ./...` to format your code
12+
- **Linting:** Run `golint ./...` to check for style issues
13+
- **Vetting:** Run `go vet ./...` to check for suspicious constructs
14+
- **Testing:** All tests must pass with `go test ./...`
15+
16+
These checks are automatically run in CI for all pull requests.
17+
18+
### Testing
19+
20+
- Write unit tests for all new functionality
21+
- Aim for 80% code coverage
22+
- All error paths tested
23+
- Run tests with coverage:
24+
```bash
25+
go test -cover ./...
26+
```
27+
- Generate detailed coverage report:
28+
```bash
29+
go test -coverprofile=coverage.out ./...
30+
go tool cover -html=coverage.out
31+
```
32+
33+
## Pull Request Guidelines
34+
35+
### Creating a PR
36+
37+
- **Title:**
38+
- The title of your PR should be clear and descriptive.
39+
- It should be short enough to fit into the title box.
40+
- **PR addresses JIRA ticket:** `ROX-1234: Add feature ABC`
41+
- **Otherwise use conventional commit style:** `<type>(<scope>): <description>`
42+
- Types: `fix`, `docs`, `test`, `refactor`, `chore`, `ci`
43+
- Example: `fix(builds): Fix builds for ABC architecture`
44+
45+
- **Description:**
46+
- Describe the motivation for this change, or why some things were done a certain way.
47+
- Focus on what cannot be extracted from the code, e.g., alternatives considered and dismissed (and why), performance concerns, non-evident edge cases.
48+
49+
- **Validation:**
50+
- Provide information that can help the PR reviewer test changes and validate they are correct.
51+
- In some cases, it will be sufficient to mention that unit tests are added and they cover the changes.
52+
- In other cases, testing may be more complex, and providing steps on how to set up and test everything will be very valuable for reviewers.
53+
54+
### Merging a PR
55+
56+
- Make sure that **all CI statuses are green**.
57+
- Always use `Squash and merge` as the merging mode (default).
58+
- Double-check that the title of the commit ("subject line") is **your PR title**, followed by the PR number prefixed with a `#` in parentheses.
59+
- Merge commit message example: `ROX-1234: Add feature ABC (#5678)`.
60+
- The body of the commit message should be empty. If GitHub pre-populates it, delete it.
61+
62+
## Code Review Process
63+
64+
- All PRs require at least one approval before merging
65+
- Address all reviewer comments and suggestions
66+
- Keep PRs focused and reasonably sized
67+
- Respond to feedback in a timely manner
68+
69+
## License
70+
71+
By contributing to StackRox MCP, you agree that your contributions will be licensed under the Apache License 2.0.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Description
2+
3+
<!-- Please provide information on what this PR changes. -->
4+
5+
### Validation
6+
7+
<!-- Please provide information on how changes have been validated and tested. -->

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IDE and editor files
2+
.vscode/
3+
.idea/
4+
.DS_Store
5+
6+
# Test coverage output
7+
/*.out
8+
9+
# Build output
10+
/stackrox-mcp

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# StackRox MCP
2+
3+
## Project Overview
4+
5+
StackRox MCP is a Model Context Protocol (MCP) server that provides AI assistants with access to StackRox.
6+
7+
## Quick Start
8+
9+
Clone the repository:
10+
```bash
11+
git clone https://github.com/stackrox/stackrox-mcp.git
12+
cd stackrox-mcp
13+
```
14+
15+
Build the project:
16+
```bash
17+
go build -o stackrox-mcp ./cmd/stackrox-mcp
18+
```
19+
20+
Run the server:
21+
```bash
22+
./stackrox-mcp
23+
```
24+
25+
## How to Run Tests
26+
27+
Run all unit tests:
28+
```bash
29+
go test ./...
30+
```
31+
32+
Run tests with coverage:
33+
```bash
34+
go test -cover ./...
35+
```
36+
37+
Generate detailed coverage report:
38+
```bash
39+
go test -coverprofile=coverage.out ./...
40+
go tool cover -html=coverage.out
41+
```

cmd/stackrox-mcp/main.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package main
2+
3+
import (
4+
"github.com/rs/zerolog"
5+
"github.com/rs/zerolog/log"
6+
)
7+
8+
func setupLogging() {
9+
zerolog.SetGlobalLevel(zerolog.InfoLevel)
10+
}
11+
12+
func main() {
13+
setupLogging()
14+
15+
log.Info().Msg("Starting Stackrox MCP server")
16+
}

cmd/stackrox-mcp/main_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import (
4+
"testing"
5+
6+
"github.com/rs/zerolog"
7+
"github.com/stretchr/testify/assert"
8+
)
9+
10+
func TestSetupLogging(t *testing.T) {
11+
setupLogging()
12+
assert.Equal(t, zerolog.InfoLevel, zerolog.GlobalLevel())
13+
}

go.mod

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module github.com/stackrox/stackrox-mcp
2+
3+
go 1.24
4+
5+
require (
6+
github.com/rs/zerolog v1.33.0
7+
github.com/stretchr/testify v1.11.1
8+
)
9+
10+
require (
11+
github.com/davecgh/go-spew v1.1.1 // indirect
12+
github.com/mattn/go-colorable v0.1.13 // indirect
13+
github.com/mattn/go-isatty v0.0.19 // indirect
14+
github.com/pmezard/go-difflib v1.0.0 // indirect
15+
golang.org/x/sys v0.12.0 // indirect
16+
gopkg.in/yaml.v3 v3.0.1 // indirect
17+
)

go.sum

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
2+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
5+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
6+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
7+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
8+
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
9+
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
10+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
11+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
12+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
13+
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
14+
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
15+
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
16+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
17+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
18+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
20+
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
21+
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
22+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
23+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
24+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
25+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)