Skip to content

Conversation

@ajanikow
Copy link
Collaborator

@ajanikow ajanikow commented Nov 5, 2025

No description provided.

@cla-bot cla-bot bot added the cla-signed label Nov 5, 2025
@ajanikow ajanikow requested a review from Copilot November 5, 2025 17:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new inventory hash endpoint to enable config reload detection in the platform. The change introduces a static endpoint /_inventory.hash that returns only the hash of the inventory data, allowing clients to quickly check if the configuration has changed without downloading the full inventory.

Key changes:

  • Added new InventoryHash protobuf message containing only the hash field
  • Created new EnvoyInventoryHashConfigDestination constant for the /_inventory.hash endpoint
  • Configured static endpoint to return the hash computed from inventory data before configuration is added

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/util/constants/envoy.go Adds constant for the new inventory hash endpoint destination
pkg/deployment/resources/config_map_gateway.go Implements the static hash endpoint and refactors inventory computation order
integrations/inventory/v1/definition/inventory.proto Defines new InventoryHash message structure
integrations/inventory/v1/definition/inventory.pb.go Generated code from protobuf definition
CHANGELOG.md Documents the bugfix in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +126 to +133
inventory.Arangodb = pbInventoryV1.NewArangoDBConfiguration(r.context.GetSpec(), r.context.GetStatus())

inventoryPreData, err := ugrpc.Marshal(inventory, ugrpc.WithUseProtoNames(true), ugrpc.WithEmitDefaultValues(true))
if err != nil {
return errors.WithStack(errors.Wrapf(err, "Failed to render gateway inventory"))
}

cfg.Destinations[utilConstants.EnvoyInventoryHashConfigDestination] = gateway.ConfigDestination{
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hash endpoint uses inventoryPreData which is marshaled before inventory.Configuration is set (line 170). This means the hash returned by /_inventory.hash will be inconsistent with the actual inventory data served by /_inventory. The hash should be computed from the complete inventory data after line 174 where inventoryData is marshaled with the configuration included.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants