Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

> **Notice:** This repository is being archived in favour of [network-agent](https://github.com/deployhq/network-agent), which has fewer dependencies and is easier to install. Both are functional during the transition period.

Deploy Agent is a Ruby gem that creates a secure proxy allowing DeployHQ to forward connections to protected servers. It establishes a TLS connection to DeployHQ's servers and proxies connections to allowed destinations based on an IP/network allowlist.

## Development Commands
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Deploy Agent

> **DEPRECATED:** This gem is deprecated and will not receive further updates.
> Please migrate to the new [network-agent](https://github.com/deployhq/network-agent) instead,
> which has fewer dependencies and is easier to install.
>
> Both agents remain functional during the transition period.

A secure proxy that allows [DeployHQ](https://www.deployhq.com/) to forward connections to servers behind firewalls. The agent establishes an outbound TLS connection to DeployHQ's servers and proxies deployment traffic to allowed destinations based on an IP/network allowlist.

## How It Works
Expand Down
8 changes: 7 additions & 1 deletion deploy-agent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Gem::Specification.new do |s|
s.version = DeployAgent::VERSION
s.required_ruby_version = '>= 2.7'
s.summary = 'The DeployHQ Agent'
s.description = 'This gem allows you to configure a secure proxy through which DeployHQ can forward connections'
s.description = 'Deprecated: use https://github.com/deployhq/network-agent instead. ' \
'This gem allows you to configure a secure proxy through which DeployHQ can forward connections'
s.authors = ['Charlie Smurthwaite']
s.email = ['support@deployhq.com']
s.files = Dir.glob('{lib,bin}/**/*')
Expand All @@ -20,4 +21,9 @@ Gem::Specification.new do |s|
s.add_dependency 'nio4r', '~> 2.7'
s.add_dependency 'rb-readline', '~> 0.5'
s.add_dependency 'timers', '~> 4.3'

s.post_install_message = <<~MSG
WARNING: deploy-agent is deprecated and will not receive further updates.
Please migrate to the new agent: https://github.com/deployhq/network-agent
MSG
end
13 changes: 13 additions & 0 deletions lib/deploy_agent/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@
module DeployAgent
class CLI

DEPRECATION_NOTICE = <<~MSG
\e[33m╔══════════════════════════════════════════════════════════════════╗
║ DEPRECATED: deploy-agent will not receive further updates. ║
║ Please migrate to the new agent: ║
║ ║
║ https://github.com/deployhq/network-agent ║
║ ║
║ Fewer dependencies, easier to install. ║
╚══════════════════════════════════════════════════════════════════╝\e[0m
MSG
Comment on lines +7 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add frozen string literal pragma for the new heredoc constant.

This file still misses # frozen_string_literal: true; with this new constant, that remains out of compliance with repo Ruby rules.

Suggested fix
+# frozen_string_literal: true
+
 require 'ipaddr'
 require 'optparse'

As per coding guidelines, **/*.rb: Enable frozen string literals in Ruby files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/deploy_agent/cli.rb` around lines 7 - 16, This file defines the
DEPRECATION_NOTICE heredoc constant but is missing the required frozen string
literal pragma; add the magic comment # frozen_string_literal: true at the top
of the file (as the first non-shebang/non-encoding line) so that
DEPRECATION_NOTICE and other string literals are frozen per repo Ruby rules,
ensuring compatibility with frozen string enforcement for constants like
DEPRECATION_NOTICE.


def dispatch(arguments)
warn DEPRECATION_NOTICE

Comment on lines +19 to +20
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update CLI specs for the new unconditional stderr emission.

Line 19 now writes to stderr on every command path, but spec/deploy_agent/cli_spec.rb:8-20 only asserts stdout. This needs matching stderr expectations (or explicit suppression), otherwise the dispatch behavior change is not fully covered and can fail CI.

Suggested spec adjustment (outside this file)
 describe '#dispatch' do
   it 'responds to version command' do
-    expect { cli.dispatch(['version']) }.to output(/\d+\.\d+\.\d+/).to_stdout
+    expect { cli.dispatch(['version']) }
+      .to output(/\d+\.\d+\.\d+/).to_stdout
+      .and output(/DEPRECATED: deploy-agent/).to_stderr
   end

   it 'shows usage for invalid command' do
-    expect { cli.dispatch(['invalid']) }.to output(/Usage: deploy-agent/).to_stdout
+    expect { cli.dispatch(['invalid']) }
+      .to output(/Usage: deploy-agent/).to_stdout
+      .and output(/DEPRECATED: deploy-agent/).to_stderr
   end

   it 'shows usage when no arguments provided' do
-    expect { cli.dispatch([]) }.to output(/Usage: deploy-agent/).to_stdout
+    expect { cli.dispatch([]) }
+      .to output(/Usage: deploy-agent/).to_stdout
+      .and output(/DEPRECATED: deploy-agent/).to_stderr
   end
 end
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/deploy_agent/cli.rb` around lines 19 - 20, The CLI now always emits a
deprecation warning via warn DEPRECATION_NOTICE (stderr), so update the CLI
specs that only assert stdout to either (a) assert the expected stderr contains
DEPRECATION_NOTICE (or the exact message) or (b) suppress/capture stderr in the
test (e.g., using capture_io/capture_stream or silence_stderr) so assertions
focus on stdout; modify the CLI spec for the command dispatch tests to check
stderr for DEPRECATION_NOTICE or wrap the call in a stderr-suppression helper to
restore test expectations.

methods = self.public_methods(false).delete_if { |n| n == :dispatch }.sort

@options = {}
Expand Down
Loading