Skip to content

Make Coveralls conditional to prevent firewall blocks in restricted CI environments#82

Merged
logicminds merged 2 commits into
mainfrom
copilot/fix-github-actions-firewall
Feb 6, 2026
Merged

Make Coveralls conditional to prevent firewall blocks in restricted CI environments#82
logicminds merged 2 commits into
mainfrom
copilot/fix-github-actions-firewall

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

GitHub Actions in restricted network environments cannot reach coveralls.io. The test suite unconditionally loads Coveralls on every run, causing connection attempts that hit firewall blocks.

Changes

  • Modified spec/spec_helper.rb: Guard Coveralls initialization with environment checks
# Before: Always attempts connection
require 'coveralls'
Coveralls.wear!

# After: Only connects when explicitly configured
if ENV['CI'] && ENV['COVERALLS_REPO_TOKEN']
  require 'coveralls'
  Coveralls.wear!
end

Behavior

  • Tests run without coverage reporting by default (no network connection)
  • Coverage reporting activates when COVERALLS_REPO_TOKEN secret is configured
  • CI environment variable already set by GitHub Actions

Enabling Coverage (Optional)

Add COVERALLS_REPO_TOKEN repository secret with Coveralls API token. No workflow changes required.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Only load Coveralls when CI env and COVERALLS_REPO_TOKEN are present
- This prevents connection attempts to coveralls.io when not configured
- Tests will run successfully without coverage reporting by default
- To enable coverage, add COVERALLS_REPO_TOKEN secret to GitHub Actions

Co-authored-by: logicminds <563900+logicminds@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix firewall settings for GitHub Actions to connect to Coveralls Make Coveralls conditional to prevent firewall blocks in restricted CI environments Feb 6, 2026
Copilot AI requested a review from logicminds February 6, 2026 02:58
@logicminds logicminds marked this pull request as ready for review February 6, 2026 02:59
Copilot AI review requested due to automatic review settings February 6, 2026 02:59
Copy link
Copy Markdown

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 pull request modifies the test suite to make Coveralls code coverage reporting conditional based on environment variables, preventing firewall connection issues in restricted CI environments.

Changes:

  • Guard Coveralls initialization with ENV['CI'] && ENV['COVERALLS_REPO_TOKEN'] check to prevent unconditional connection attempts to coveralls.io

@logicminds logicminds merged commit 6fe1e07 into main Feb 6, 2026
22 checks passed
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