Skip to content

Conversation

@ajanikow
Copy link
Collaborator

No description provided.

@cla-bot cla-bot bot added the cla-signed label Oct 20, 2025
@ajanikow ajanikow requested a review from Copilot October 20, 2025 10:24
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 introduces a CLI-based inventory generator for the License Manager component, enabling deployment inventory collection and reporting through the platform command.

  • New license CLI command with inventory subcommand to collect deployment metadata
  • Thread management improvements with duration-based waiting mechanisms
  • ArangoDB deployment connection utilities for CLI authentication and requests

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/util/grpc/object.go JSON marshaling wrapper for protobuf messages
pkg/util/executor/threader.go Enhanced thread management with duration-based waiting
pkg/util/executor/executor.go Refactored timeout handling to use new Wait() mechanism
pkg/util/cli/deployment.go Deployment connection configuration for CLI
pkg/util/cli/deployment.auth.token.go Token authentication implementation
pkg/util/cli/deployment.auth.basic.go Basic authentication implementation
pkg/util/arangod/request.go Generic HTTP request utilities for ArangoDB
pkg/platform/license_inventory.go Inventory generation CLI command implementation
pkg/platform/license.go License command group definition
pkg/platform/inventory/types_test.go Tests for inventory value type conversions
pkg/platform/inventory/types.go Inventory item type definitions and conversions
pkg/platform/inventory/queries/timestamp.aql AQL query for execution timestamp
pkg/platform/inventory/inventory.proto Protobuf schema for inventory data
pkg/platform/inventory/inventory.pb.go Generated protobuf code
pkg/platform/inventory/inventory.go Inventory fetching orchestration
pkg/platform/inventory/global.go Global executor registry
pkg/platform/inventory/fetcher.server.version.go Server version fetcher
pkg/platform/inventory/fetcher.server.mode.go Server mode detection fetcher
pkg/platform/inventory/fetcher.deployment.id.go Deployment ID fetcher
pkg/platform/inventory/fetcher.aql.timestamp.go AQL timestamp query executor
pkg/platform/inventory/aql.go Generic AQL query execution framework
pkg/platform/installer.go Registered license command
pkg/platform/flags.go Added deployment connection flags
pkg/deployment/client/id.go Deployment ID client method
pkg/deployment/client/client.go Added DeploymentID method to interface
pkg/apis/shared/validate.go New validation path helper
internal/readme_cli.go CLI documentation generation updates
docs/cli/arangodb_operator_platform.md Updated documentation with new commands
CHANGELOG.md Added feature entry

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 89 to +90
t.parent.threads <- t.id

t.released = true
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

Setting t.released = true after sending to the channel creates a race condition. If another goroutine calls Wait() between the channel send and setting released to true, it could send the ID twice. Move t.released = true before the channel send.

Suggested change
t.parent.threads <- t.id
t.released = true
t.released = true
t.parent.threads <- t.id

Copilot uses AI. Check for mistakes.
t, ok := v.(time.Time)
if !ok {
return nil, errors.Errorf("expected type %T, got %T", t, v)
}
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

The truncation to seconds should be documented. Add a comment explaining why time.Time values are truncated to second precision when converting to ItemValue.

Suggested change
}
}
// Truncate time.Time to second precision to ensure compatibility with protobuf Timestamp,
// which only supports second-level precision. This avoids issues with sub-second values.

Copilot uses AI. Check for mistakes.
@ajanikow ajanikow merged commit 3c34c2e into master Oct 20, 2025
3 checks passed
@ajanikow ajanikow deleted the feature/lm/inventory_gen branch October 20, 2025 13:15
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.

3 participants