Skip to content

Restart CLI processes when environment or telemetry settings change#954

Open
dividedmind wants to merge 2 commits into
mainfrom
claude/splunk-locked-network-analysis-rhi250
Open

Restart CLI processes when environment or telemetry settings change#954
dividedmind wants to merge 2 commits into
mainfrom
claude/splunk-locked-network-analysis-rhi250

Conversation

@dividedmind

@dividedmind dividedmind commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This change ensures that AppLand's CLI processes (indexer and scanner) are properly restarted when environment variables or telemetry settings are modified, keeping them in sync with the JSON-RPC server.

Key Changes

  • Added reloadCliProcessesAlarm lazy-initialized alarm to handle CLI process restarts
  • Imported AppLandCommandLineService to enable CLI process management
  • Updated cliEnvironmentChanged() to restart CLI processes alongside the JSON-RPC server when environment variables are modified
  • Updated telemetrySettingsChanged() to restart CLI processes alongside the JSON-RPC server when telemetry settings are modified
  • Enhanced comments to clarify that indexer and scanner processes receive both environment and telemetry settings via their environment

Implementation Details

  • The CLI process restart alarm uses the same configuration pattern as the existing JSON-RPC server alarm (1-second delay, pooled thread, default modality state)
  • Both cliEnvironmentChanged() and telemetrySettingsChanged() now trigger CLI process restarts to ensure configuration changes take effect across all AppLand services

Bonus changes

  • Added cleanup of downloaded binaries cache in CI by pruning old version to prevent unbounded cache growing.

The JSON-RPC server was already restarted when telemetry settings or
the CLI environment changed (e.g. via organization config refresh),
but the indexer and scanner processes receive the same environment
(AppLandCliEnvProvider extensions, including Splunk telemetry env
vars) and were left running with stale values until a manual restart
or project reload.

Add a second debounced restart, mirroring the existing JSON-RPC alarm,
that calls AppLandCommandLineService.restartProcessesInBackground()
alongside the RPC restart for both triggers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yFMfB9M3n6bSzWFJjvTQA

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the settings-change handling in the IntelliJ plugin so that AppLand’s long-running CLI processes (indexer/scanner) are restarted when settings that affect their environment (CLI env vars and telemetry configuration) change, keeping them aligned with the JSON-RPC server behavior.

Changes:

  • Added a lazily initialized reloadCliProcessesAlarm to debounce CLI process restarts.
  • Updated cliEnvironmentChanged() to restart CLI processes in addition to restarting the JSON-RPC server.
  • Updated telemetrySettingsChanged() to restart CLI processes alongside the JSON-RPC server, and clarified comments.

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

@dividedmind
dividedmind force-pushed the claude/splunk-locked-network-analysis-rhi250 branch from b6ad5d4 to 2e2a290 Compare July 18, 2026 11:23
Prevent the GitHub Actions AppMap test binaries cache from growing
unboundedly, and completely eliminate redundant cache save churn (zipping
and network uploads) on steady-state runs.

- Transition from `actions/cache@v5` to explicit, decoupled
  `actions/cache/restore@v5` and `actions/cache/save@v5` steps.
- Add `id: restore-cache` to track the matched key retrieved from GitHub.
- Create `.github/workflows/clean-cache.js` to parse version numbers of
  surviving binaries, prune old releases, delete test stub files, and
  export a SHA-256 hash of the final stable binaries set to `$GITHUB_OUTPUT`.
- Configure the `Save AppMap test binaries cache` step to compare the new
  hash-based key against the matched/restored key. If they match, the step
  is completely skipped, saving network bandwidth and runner CPU.
- Configure steps with `continue-on-error: true` to defensively guard the
  build from any unexpected script/cache failures.
- Add descriptive comments in the workflow explaining the decoupled restore/save
  setup, the pruning logic, and the matched-key conditional optimization.
@dividedmind
dividedmind force-pushed the claude/splunk-locked-network-analysis-rhi250 branch from 2e2a290 to 939fb50 Compare July 18, 2026 12:03
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.

3 participants