All pull requests should be made against the main branch from your own fork of the repository. Please ensure that your pull request includes a clear description of the changes made and all CI checks pass.
golangci-lint should be used to lint this project. CI will automatically run this, but you can run linting locally by running:
make lint # requires docker/podman to be installedIt is recommended to have goimports installed locally and have your IDE set to auto-format on save. You can install it by running:
go install golang.org/x/tools/cmd/goimports@latestFor vscode users, you can set up your editor to use goimports for auto-formatting by adding the following to your workspace or user settings:
{
...
"go.formatTool": "goimports"
}For jetbrains users see https://www.jetbrains.com/help/go/integration-with-go-tools.html#goimports
The API normalizes certain identifiers (resource types, reporter types) to a canonical form to ensure consistent behavior:
- Resource types: lowercase,
/replaced with_. - Reporter types: lowercase
This normalization:
- Prevents duplicate entries that differ only in casing (
hostvsHostork8s_clustervsK8s_Cluster) - Ensure case-insensitive lookups work correctly.
- Maintains consistency across the API surface.
The canonical form is what gets stored and returned in response. This is acceptable because:
- It is considered part of the business logic and not presentation logic.
- It's applied consistently across all operations.
- It's optimized for simplicity. Assuming we're based on spicedb but also open to others.
When making changes to schema configuration files in data/schema/, you must rebuild and commit both the resources tarball and schema cache. This ensures that schema changes are properly captured and consumable in deployments.
- Make your changes to files in
data/schema/resources/ - Rebuild the tarball and update deployment configs:
make build-schemas
- Regenerate the schema cache:
go run main.go preload-schema
- Stage and commit all schema changes and generated files:
git add data/schema/ resources.tar.gz schema_cache.json deploy/kessel-inventory-ephem.yaml git commit -m "Update schema: <description of changes>"
Before pushing your PR, you can verify that your schema changes are properly synchronized:
./scripts/verify-schema-tarball.shThis check is also enforced automatically in CI. PRs that modify schema files without updating the generated files will fail the Verify Schema Tarball check.
resources.tar.gz: Used in production deployments as a ConfigMap. Schema changes must be reflected in the tarball to be available to running services.schema_cache.json: A preloaded cache file for faster schema loading at runtime. Keeping it in sync prevents validation failures and performance issues.
If these files aren't updated, deployments may fail or exhibit runtime errors due to schema mismatches.