Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 2, 2025

This PR implements comprehensive runner registration options to streamline runner setup and reduce manual configuration overhead for enterprise usage.

New CLI Options

The semaphore runner register command now supports the following flags:

semaphore runner register \
  --hostname "my-runner-01" \
  --enabled \
  --project-name "my-project" \
  --webhook "https://example.com/hook" \
  --tags "linux,aws,build"

# Or with stdin token:
echo "REGISTRATION_TOKEN" | semaphore runner register \
  --stdin-registration-token \
  --hostname "my-runner-01" \
  --disabled \
  --tags "windows,test"

Key Features

  • --hostname: Sets runner name/hostname for unique identification
  • --enabled/--disabled: Controls runner active state with proper precedence (disabled takes priority)
  • --project-name: Associates runner with specified project (foundation for future project lookup enhancement)
  • --webhook: Sets webhook URL for runner integration
  • --tags: Accepts comma-separated list of tags for runner categorization and filtering

Implementation Details

  • CLI flags override config file values as designed
  • Defaults to enabled=true when neither flag is specified
  • Added robust nil pointer checks and config initialization
  • Extended RunnerRegistration struct and API endpoint to handle new fields
  • Full backward compatibility maintained

Testing

  • Added comprehensive unit tests for CLI flag processing
  • API structure validation tests
  • Manual testing with live server confirms all scenarios work correctly
  • All existing tests continue to pass

This enhancement makes runner registration more declarative, supports both automated and manual workflows, and significantly reduces post-setup configuration requirements.

Fixes #3220.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ohn
    • Triggering command: ./bin/semaphore setup (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Feature: Runner registration options Add runner registration options for enhanced CLI configuration Sep 2, 2025
@Copilot Copilot AI requested a review from fiftin September 2, 2025 20:45
Copilot finished work on behalf of fiftin September 2, 2025 20:45
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.

Feature: Runner registration options

2 participants