Skip to content

Add Copilot instructions for repository context#81

Merged
logicminds merged 3 commits into
mainfrom
copilot/set-up-copilot-instructions
Feb 6, 2026
Merged

Add Copilot instructions for repository context#81
logicminds merged 3 commits into
mainfrom
copilot/set-up-copilot-instructions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

Configures GitHub Copilot with repository-specific context for code generation and reviews.

Changes

Created .github/copilot-instructions.md covering:

  • Architecture: Dual-provider pattern (freeipmi/ipmitool), command-based design with BaseCommand inheritance
  • Security: Credential handling requirements—temp files (mode 0600), no CLI args, randomized paths, log exclusions
  • Coding patterns: BaseCommand subclassing, runcmd helpers, option cleanup, connection wiring
  • Standards: RuboCop config (hash rockets, 149 char lines), Ruby 3.0+ compatibility
  • Testing: Unit (mock-only) vs integration (real BMC, power cycling warnings)
  • CI/CD: Workflow descriptions, Dependabot configuration

Key sections for IPMI context

Security requirements are critical—IPMI credentials must never appear in process listings or logs:

def some_action
  options["chassis-identify"] = "FORCE"
  runcmd
  options.delete("chassis-identify")  # Clean up command-specific keys
end

Provider differences documented: freeipmi uses separate binaries (ipmi-chassis, bmc-info), ipmitool uses single binary with subcommands.

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:

  • gh.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

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

Original prompt

This section details on the original issue you should resolve

<issue_title>✨ Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 6, 2026 02:42
Co-authored-by: logicminds <563900+logicminds@users.noreply.github.com>
Co-authored-by: logicminds <563900+logicminds@users.noreply.github.com>
Copilot AI changed the title [WIP] Set up Copilot instructions for repository Add Copilot instructions for repository context Feb 6, 2026
Copilot AI requested a review from logicminds February 6, 2026 02:44
@logicminds logicminds marked this pull request as ready for review February 6, 2026 02:54
Copilot AI review requested due to automatic review settings February 6, 2026 02:54
@logicminds logicminds merged commit c8c4e27 into main Feb 6, 2026
20 checks passed
@logicminds logicminds deleted the copilot/set-up-copilot-instructions branch February 6, 2026 02:54
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 PR adds comprehensive GitHub Copilot instructions to help the AI assistant understand the rubyipmi codebase's architecture, coding patterns, security requirements, and testing practices. The instructions document the dual-provider pattern (freeipmi/ipmitool), command-based architecture, and critical security practices for handling IPMI credentials.

Changes:

  • Created .github/copilot-instructions.md with detailed repository context covering architecture, security, coding patterns, testing, and CI/CD
  • Documents the dual-provider pattern with separate command hierarchies for freeipmi and ipmitool
  • Includes critical security requirements for credential handling via temporary files

Comment on lines +179 to +182
- **lint.yml**: RuboCop style checks
- **codeql.yml**: Security and code quality analysis
- **security.yml**: Dependency review and bundler-audit

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The documentation mentions a "lint.yml" workflow that does not exist in the repository. The .github/workflows directory contains test.yml, codeql.yml, and security.yml, but no lint.yml or separate RuboCop workflow. Either remove this reference or clarify that RuboCop checks are expected to be run locally rather than in CI.

Suggested change
- **lint.yml**: RuboCop style checks
- **codeql.yml**: Security and code quality analysis
- **security.yml**: Dependency review and bundler-audit
- **codeql.yml**: Security and code quality analysis
- **security.yml**: Dependency review and bundler-audit
### Local linting
- RuboCop style checks are expected to be run locally (e.g., via `bundle exec rubocop`)
- There is currently no dedicated GitHub Actions workflow for RuboCop

Copilot uses AI. Check for mistakes.
**Credential handling is paramount. Follow these rules strictly:**

1. **Never pass credentials on the command line** - they would appear in process listings
2. **Use temporary files (mode 0600)** for password passing to CLI tools
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The documentation states that temporary files are created with "mode 0600", but this mode is not explicitly set in the code - it's the default behavior of Ruby's Tempfile class. While this is technically accurate, it might be clearer to note that this is the default behavior rather than something explicitly configured in the codebase. Consider clarifying: "Use temporary files (which Ruby's Tempfile creates with mode 0600 by default)".

Suggested change
2. **Use temporary files (mode 0600)** for password passing to CLI tools
2. **Use temporary files (which Ruby's Tempfile creates with mode 0600 by default)** for password passing to CLI tools

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
- `runcmd(["--extra-arg"])` - Run with additional arguments
- `runcmd_with_args([...])` - Run with only specified arguments
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The documentation describes execution helpers including runcmd(["--extra-arg"]) and runcmd_with_args([...]), but these methods don't exist in the codebase. The actual runcmd method takes no arguments. Commands modify the @options hash to pass arguments, then call runcmd without parameters. For example, see how ipmitool commands set options["cmdargs"] before calling runcmd. Remove the mention of passing arrays to runcmd and runcmd_with_args as these patterns are not used in the codebase.

Suggested change
- `runcmd(["--extra-arg"])` - Run with additional arguments
- `runcmd_with_args([...])` - Run with only specified arguments
- To pass extra CLI arguments, set `options["cmdargs"]` (e.g. `options["cmdargs"] = ["--extra-arg"]`) before calling `runcmd`, then clean it up afterward

Copilot uses AI. Check for mistakes.
def some_action
options["chassis-identify"] = "FORCE"
runcmd
options.delete("chassis-identify") # Clean up after!
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The instruction example shows options.delete("chassis-identify") but the actual codebase consistently uses options.delete_notify(key) throughout. The ObservableHash class provides delete_notify to ensure observers are notified when options are removed. The example should be updated to use delete_notify to match actual usage patterns in the codebase.

Suggested change
options.delete("chassis-identify") # Clean up after!
options.delete_notify("chassis-identify") # Clean up after!

Copilot uses AI. Check for mistakes.
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.

✨ Set up Copilot instructions

3 participants