Skip to content

Fix Rubocop CI failure in ForemanInventoryUpload.base_folder path selection update - #1263

Draft
nofaralfasi with Copilot wants to merge 3 commits into
developfrom
copilot/fix-rubocop-actions-job
Draft

nofaralfasi with Copilot wants to merge 3 commits into
developfrom
copilot/fix-rubocop-actions-job

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown

The Rubocop / Rubocop GitHub Actions job failed due to style violations introduced in the base_folder writable/fallback path update. This PR keeps the intended runtime behavior and aligns the implementation with repository Rubocop rules.

  • CI failure source

    • Resolves Rubocop offenses in the updated ForemanInventoryUpload.base_folder logic (Layout/*Alignment, Layout/IndentationWidth, Rails/FilePath).
  • Production code adjustments

    • Keeps shared tmpdir behavior: use /var/run/foreman when writable.
    • Keeps fallback behavior: use Rails.root/tmp/red_hat_inventory when shared tmpdir is unavailable/unwritable.
    • Refactors path construction/alignment to conform to repository cops.
  • Focused test coverage

    • Adds/updates unit tests to explicitly cover:
      • writable shared tmpdir path selection
      • fallback Rails tmp path selection
base_path = if File.writable?(SHARED_TMPDIR)
              Pathname.new(SHARED_TMPDIR).join('red_hat_inventory')
            else
              Rails.root.join('tmp/red_hat_inventory')
            end
"#{base_path}/"

Copilot AI and others added 2 commits September 24, 2026 15:11
Co-authored-by: nofaralfasi <38184193+nofaralfasi@users.noreply.github.com>
Co-authored-by: nofaralfasi <38184193+nofaralfasi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Rubocop Fix Rubocop CI failure in ForemanInventoryUpload.base_folder path selection update Sep 24, 2026
Copilot stopped work on behalf of nofaralfasi due to an error September 24, 2026 15:20
Copilot AI requested a review from nofaralfasi September 24, 2026 15:21

This branch has not been deployed

No deployments
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.

2 participants