Skip to content

Commit 53073ab

Browse files
snehaguntaAdam0Brienakoserwallennysgarage
authoredMar 26, 2025
Add v1beta2 protos and wire in service (project-kessel#369)
* add some starter protos to model v1beta2 api * add initial v1beta2 api * commit generated classes for v1beta2 * add a new internal Resource Service and wire it in * add some examples for v1beta2 shapes * map v1beta2 Resource to existing Resource data model * implement writing some dummy data to the database for reportResource * Update proto files to be stored under v1beta2/resources * Update file structure from data/resources to data/schemas/resources * Add transformer.go to middleware * Update middleware to use schemas in data/schemas/resources for validation * add validation for resource/reporter combinations * update validation logic to validate ResourceData * Remove TODO's, Clean up code references to v1beta2 * clean up validate.go, move functions into util.go * remove reporter-version * add an upsert method and use it for reportResource * remove reporter_version from the api and database schema * remove db schema fields that are deprecated and unused * Revert "remove db schema fields that are deprecated and unused" This reverts commit d2d8b8f. * add some logs; add reporter_type and reporter_id * update validate.go code to be more generic/reusable * add buf validate to protofiles * Added testing framework for protobuf files * change to only json validate reporter_type from resource_data * remove commented out code * move protos out of resource folder * change directory name from schemas to schema * correct schema loading path * change from policies endpoint to policy endpoint * remove reporter_version from protos * ensure resource data is handled properly for abstract and non abstract resources * update unit tests and add test coverage for schema validation * remove resource_data from notifications * address some review comments * create unique index for reporter resource * add v1beta2 examples; add reporterInstanceId * add reporter version back * Fix unit tests * add resources filesystem to kind setup * validate entire payload in middleware tests * Fix bug with update flow. Now it returns, right after update * add some basic tests for upsert * add initial draft schema for a rhel_host and test data * Account for empty schemas, add more unit tests * Delete endpoint in place, not deleting correct resources * fix validation tests to expect schema for rhel_hosts * fix failing tests after adding schema for RHEL hosts * make common_resource_data schema resource specific * update schema loader to read common_resource_data from resource specific folder * Comment out failing test for unknown resource type to fix later * remove transform.go middleware * clean up logs * make resources schema path configurable * update resources tarball to account for schema structure change * update resources tarball to account for schema structure change * make schema loading configurable for filesystem or json cache * fix lint error * move the resource schemas into the reporter specific packages as they are resporter specific * refactor validation logic and schema loading * fix tests * ensure schema_cache.json is at root level * fix lint error * update resources tarball to account for schema structure change * fix e2e * fix e2e * Revert "move the resource schemas into the reporter specific packages as they are resporter specific" This reverts commit e504988. * Revert "Revert "move the resource schemas into the reporter specific packages as they are resporter specific"" This reverts commit 5149826. * add acs config for demoing multiple reporters * added default schema if schema cache not found * configure schema cache for inventory container * disable schema dump * change schema loading from in code to command line argument * remove binary * change from rhel_host to host * regenerate schema_cache.json, enable schema loading locally * update host unit tests * changing fatal log to warn for schema cache loading error to allow v1beta1 to work without schema files * normalise resource_type in config.yaml files * remove comment section from config.yaml files * update noticications json examples * remove unused variable from middleware * add inventory_id for resources payload and add logic to hanlde multiple reports * fix cve with dependencies * add inventory_id test case * fix lint error, go mod tidy * fix logic for handling the inventory id usecase for multiple reporters * update resources_test.go * fix go lint * revert packages that rely on go 1.23.0 * Add comment to go.mod about versioning * Add shell and unicode sast pipeline tasks https://issues.redhat.com/browse/KONFLUX-2264 * add eventing and relations calls for ReportResource v1beta2 for demo * fix linter * fix linter --------- Co-authored-by: Adam0Brien <aobrien@redhat.com> Co-authored-by: Adam O'Brien <adamobrieniot@gmail.com> Co-authored-by: Abhishek koserwal <akoserwa@redhat.com> Co-authored-by: Jonathan Marcantonio <jmarcant@redhat.com>
1 parent f83431e commit 53073ab

File tree

81 files changed

+3813
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3813
-249
lines changed
 

‎.inventory-api.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ storage:
2727
user:
2828
password:
2929
dbname:
30+
resources:
31+
schemaPath: "data/schema/resources"
32+
use_cache: true
3033
log:
3134
level: "info"
3235
livez: true

‎api/kessel/inventory/v1beta2/reporter_data.pb.go

+227
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)