Skip to content

ci: add Dependabot, CodeQL, lint, and security workflows#73

Closed
logicminds wants to merge 4 commits into
mainfrom
ci_automations
Closed

ci: add Dependabot, CodeQL, lint, and security workflows#73
logicminds wants to merge 4 commits into
mainfrom
ci_automations

Conversation

@logicminds
Copy link
Copy Markdown
Owner

  • Add .github/dependabot.yml for Bundler and GitHub Actions updates
  • Add CodeQL workflow for Ruby security/code analysis (security-extended)
  • Add lint workflow running RuboCop on PR/push
  • Add security workflow: dependency-review on PRs, bundler-audit for gems
  • Document workflows and Copilot Code Review (Rulesets) in README

- Add .github/dependabot.yml for Bundler and GitHub Actions updates
- Add CodeQL workflow for Ruby security/code analysis (security-extended)
- Add lint workflow running RuboCop on PR/push
- Add security workflow: dependency-review on PRs, bundler-audit for gems
- Document workflows and Copilot Code Review (Rulesets) in README
@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copilot AI review requested due to automatic review settings February 5, 2026 06:55
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 establishes a comprehensive CI/CD and security automation infrastructure for the rubyipmi project. It adds Dependabot for automated dependency updates, CodeQL for security analysis, RuboCop linting automation, and security scanning workflows, along with documentation for all these tools.

Changes:

  • Added automated dependency management with weekly Bundler and GitHub Actions updates via Dependabot
  • Added CodeQL security analysis workflow with security-extended query suite
  • Added automated RuboCop linting on PRs and main/master pushes
  • Added security scanning with dependency-review for PRs and bundler-audit for gem vulnerabilities
  • Updated Gemfile source from http to https for security
  • Documented all CI/security workflows and GitHub Copilot Code Review setup in README

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/dependabot.yml Configures weekly dependency updates for Bundler and GitHub Actions with appropriate labels and commit message prefixes
.github/workflows/codeql.yml Sets up CodeQL security analysis with security-extended queries, running on PRs, pushes to main/master, and weekly schedule
.github/workflows/lint.yml Configures RuboCop linting workflow to run on PRs and main/master pushes
.github/workflows/security.yml Implements dependency-review for PRs and bundler-audit for gem vulnerability scanning
Gemfile Updates RubyGems source from http to https for improved security
README.md Adds comprehensive documentation table for all workflows and instructions for Dependabot and GitHub Copilot Code Review

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

- Rename moved cops (Metrics/LineLength → Layout/LineLength, etc.)
- Add department prefixes (Style/SignalException, Layout/SpaceInsideHashLiteralBraces)
- Style/PredicateName → Naming/PredicatePrefix
- Add AllCops: NewCops: enable
- Exclude spec blocks from Metrics/BlockLength
- Add exclusions for OptionalBooleanParameter, DuplicateMethods,
  MissingRespondToMissing, MissingSuper, EmptyBlock, EmptyFile, Lint/Void
- Exclude lib/rubyipmi.rb from complexity/module length limits
- Gemfile: frozen_string_literal, hash rockets, alphabetical gem order
- Rakefile: remove redundant encoding comment, add frozen_string_literal,
  use warn instead of $stderr.puts, modifier if, heredoc indentation
Copilot AI review requested due to automatic review settings February 5, 2026 07:31
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

Copilot reviewed 61 out of 61 changed files in this pull request and generated 3 comments.


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

Comment on lines +10 to +11
def list
@sensors ||= parse(getsensors)
@list ||= parse(getsensors)
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The variable name was changed from @sensors to @list on line 11, but the refresh method on line 6 still references @sensors. This should be changed to @list = nil to properly clear the cached sensor list.

Copilot uses AI. Check for mistakes.
Comment on lines 59 to 86
def run
# we search for the command everytime just in case its removed during execution
# we also don't want to add this to the initialize since mocking is difficult and we don't want to
# throw errors upon object creation
retrycount = 0
process_status = false
@cmd = locate_command(@cmdname)
setpass
@result = nil
logger.debug(makecommand) if logger
logger&.debug(makecommand)
begin
command = makecommand
@lastcall = command
@result, @result_err, status = Rubyipmi.capture3(command)
# sometimes the command tool does not return the correct result, validate it with additional code
process_status = validate_status(status)
rescue
validate_status(status)
rescue StandardError
if retrycount < max_retry_count
find_fix(@result)
retrycount = retrycount.next
retry
else
logger.error("Exhausted all auto fixes, cannot determine what the problem is") if logger
logger&.error("Exhausted all auto fixes, cannot determine what the problem is")
raise "Exhausted all auto fixes, cannot determine what the problem is"
end
ensure
removepass
process_status
end
end
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The refactoring has changed the return value of the run method. Previously, the method would return process_status (the result of validate_status) via the ensure block. Now, the ensure block returns the result of removepass (likely nil). This could break code that depends on the return value of run. The method should explicitly return the result of validate_status before the ensure block or use a variable to preserve the return value.

Copilot uses AI. Check for mistakes.
Comment thread .rubocop.yml Outdated
Comment on lines +1 to +3
# require:
# - rubocop-rake
# - rubocop-rspec
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The require statements for rubocop-rake and rubocop-rspec are commented out, but these gems are added to the Gemfile. These requires should be uncommented to enable the additional cops provided by these gems, otherwise they won't be used during linting.

Suggested change
# require:
# - rubocop-rake
# - rubocop-rspec
require:
- rubocop-rake
- rubocop-rspec

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 5, 2026 20:22
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


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

@logicminds
Copy link
Copy Markdown
Owner Author

automated rubocop fixes break code, ignoring for now

@logicminds logicminds closed this Feb 5, 2026
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