Skip to content

feat(fleetcontrol): add new package with fleet, fleet members CRUD ops#1360

Merged
pranav-new-relic merged 17 commits intomainfrom
fleet-control-starts-here
Feb 19, 2026
Merged

feat(fleetcontrol): add new package with fleet, fleet members CRUD ops#1360
pranav-new-relic merged 17 commits intomainfrom
fleet-control-starts-here

Conversation

@pranav-new-relic
Copy link
Member

@pranav-new-relic pranav-new-relic commented Jan 13, 2026

Overview

This branch introduces a comprehensive Fleet Control feature to the New Relic Go client library, enabling programmatic management of fleet deployments, agent configurations, and fleet member operations through the New Relic platform.


Key Features Added

1. Fleet Control Package (pkg/fleetcontrol)

A new package providing complete CRUD operations for managing fleets of infrastructure entities.

Core Capabilities:

  • Fleet Management

    • Create, update, and delete fleets
    • Add and remove fleet members
    • Query fleet members with filtering
  • Fleet Deployments

    • Create, update, and delete fleet deployments
    • Execute deployment operations with fleetControlDeploy
    • Support for agent input configuration during deployments
  • Configuration Management (Blob Service Integration)

    • Get agent configurations (active or draft versions)
    • Create and update agent configurations
    • Fetch specific configuration versions
    • Delete configurations and versions
    • List all configuration versions

Key Files:

  • fleetcontrol.go - Core client initialization
  • fleetcontrol_api.go - NerdGraph API mutations and queries (1,275 lines)
  • fleetcontrol_configurations.go - Blob service integration for configurations (305 lines)
  • types.go - Comprehensive type definitions (10,130 lines)
  • Integration tests with 560 lines of coverage

Technical Changes

2. Tutone Configuration (.tutone.yml)

Added complete package configuration for code generation:

Mutations:

  • fleetControlCreateFleet
  • fleetControlUpdateFleet
  • fleetControlDeleteFleet
  • fleetControlAddFleetMembers
  • fleetControlRemoveFleetMembers
  • fleetControlCreateFleetDeployment
  • fleetControlUpdateFleetDeployment
  • fleetControlDeleteFleetDeployment
  • fleetControlDeploy

Queries:

  • actor.fleetControl.fleetMembers - Query fleet members with filters
  • actor.entityManagement.entity - Entity lookups
  • actor.entityManagement.entitySearch - Entity search capabilities

Type Overrides:

  • FleetControlFleetMembersFilterInput - Pointer type for optional filtering
  • FleetControlOperatingSystemCreateInput - Optional OS specification
  • Entity management types for fleets, configurations, and deployments

3. HTTP Client Enhancements (internal/http/client.go)

  • Added support for custom HTTP methods (GET, POST, PUT, DELETE)
  • New DoRequestWithCustomMethod function for blob service REST API calls
  • Enables direct REST API interactions alongside GraphQL

4. Region Support (pkg/region/region.go)

  • Added BlobServiceURL() method for constructing blob service endpoints
  • Blob service base URL: https://blob.service.newrelic.com
  • Proper URL path construction for configuration management

5. Client Integration (newrelic/newrelic.go)

  • Registered Fleetcontrol package in main New Relic client
  • Available as client.Fleetcontrol for all SDK users

API Operations Summary

Fleet Operations

// Create a fleet
FleetControlCreateFleet(accountId, organizationId, input)

// Update fleet properties
FleetControlUpdateFleet(guid, input)

// Delete a fleet
FleetControlDeleteFleet(guid)

// Manage fleet membership
FleetControlAddFleetMembers(fleetId, entityGuids)
FleetControlRemoveFleetMembers(fleetId, entityGuids)

// Query fleet members
GetFleetMembers(filter)

Deployment Operations

// Create deployment
FleetControlCreateFleetDeployment(accountId, organizationId, input)

// Update deployment (including agent inputs)
FleetControlUpdateFleetDeployment(guid, input)

// Delete deployment
FleetControlDeleteFleetDeployment(guid)

// Execute deployment
FleetControlDeploy(fleetGuid, deploymentGuid)

Configuration Operations (Blob Service)

// Get configuration
FleetControlGetConfiguration(entityGuid, orgId, mode, version)

// Create/Update configuration
FleetControlCreateConfiguration(entityGuid, orgId, payload)
FleetControlUpdateConfiguration(entityGuid, orgId, payload)

// Version management
FleetControlGetConfigurationVersions(entityGuid, orgId)
FleetControlDeleteConfiguration(entityGuid, orgId)
FleetControlDeleteConfigurationVersion(entityGuid, orgId, version)

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 2.50000% with 312 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.55%. Comparing base (25308d5) to head (793e1c5).

Files with missing lines Patch % Lines
pkg/fleetcontrol/fleetcontrol_api.go 0.00% 146 Missing ⚠️
pkg/fleetcontrol/fleetcontrol_configurations.go 0.00% 131 Missing ⚠️
pkg/fleetcontrol/fleetcontrol.go 0.00% 14 Missing ⚠️
pkg/region/region.go 0.00% 12 Missing ⚠️
internal/http/client.go 43.75% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1360      +/-   ##
==========================================
- Coverage   33.04%   31.55%   -1.49%     
==========================================
  Files         136      139       +3     
  Lines        6256     6576     +320     
==========================================
+ Hits         2067     2075       +8     
- Misses       3990     4301     +311     
- Partials      199      200       +1     
Flag Coverage Δ
unit 31.55% <2.50%> (-1.49%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pranav-new-relic pranav-new-relic force-pushed the fleet-control-starts-here branch from 6bd9ace to 17cdad9 Compare January 13, 2026 09:31
@github-actions
Copy link

❌ Invalid Conventional Commits Detected

The following commits do not follow the Conventional Commits format:

3e0530c - Merge branch 'main' into fleet-control-starts-here

Please update these commit messages to follow the format:
<type>[optional scope]: <description>

Valid types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test

- Update fleet deployment mutation to support agent input updates
- Add custom unmarshaller for fleet control operating system
- Restore synthetics automated test struct tags configuration
- Merge latest changes from main branch
@pranav-new-relic pranav-new-relic force-pushed the fleet-control-starts-here branch from 3e0530c to e9eb6c0 Compare February 19, 2026 07:43
Address errcheck lint error by explicitly ignoring the Close() error
in deferred function call.
@CLAassistant
Copy link

CLAassistant commented Feb 19, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@shashank-reddy-nr shashank-reddy-nr left a comment

Choose a reason for hiding this comment

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

LGTM

@pranav-new-relic pranav-new-relic marked this pull request as ready for review February 19, 2026 08:14
@pranav-new-relic pranav-new-relic merged commit 5db77de into main Feb 19, 2026
16 of 17 checks passed
@pranav-new-relic pranav-new-relic deleted the fleet-control-starts-here branch February 19, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments