Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git_worktree checkout with a Pathname #23308

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

agrare
Copy link
Member

@agrare agrare commented Jan 15, 2025

Fix git_repository.checkout with a Pathname in ConfigurationScriptSource#checkout_git_repository

  1) ManageIQ::Providers::EmbeddedTerraform::AutomationManager::ConfigurationScriptSource with a local repo create_in_provider runs sync finds top level template
     Failure/Error:
           checkout_git_repository do |git_checkout_tempdir|
             # traverse through files in git-worktree
             git_repository.with_worktree do |worktree|
               worktree.ref = scm_branch
       
               # Find all dir's with .tf/.tf.json files
               worktree.blob_list
                       .group_by          { |file| File.dirname(file) }
                       .select            { |_dir, files| files.any? { |f| f.end_with?(".tf", ".tf.json") } }
                       .transform_values! { |files| files.map { |f| File.basename(f) } }
     
     MiqException::Error:
       no implicit conversion of Pathname into String
     # /home/grare/adam/src/manageiq/manageiq/app/models/git_repository.rb:222:in `rescue in handling_worktree_errors'
     # /home/grare/adam/src/manageiq/manageiq/app/models/git_repository.rb:217:in `handling_worktree_errors'
     # /home/grare/adam/src/manageiq/manageiq/app/models/git_repository.rb:108:in `with_worktree'
     # /home/grare/adam/src/manageiq/manageiq/app/models/git_repository.rb:87:in `checkout'
     # /home/grare/adam/src/manageiq/manageiq/app/models/manageiq/providers/embedded_automation_manager/configuration_script_source.rb:96:in `checkout_git_repository'
     # ./app/models/manageiq/providers/embedded_terraform/automation_manager/configuration_script_source.rb:79:in `find_templates_in_git_repo'
     # ./app/models/manageiq/providers/embedded_terraform/automation_manager/configuration_script_source.rb:18:in `block in sync'

Fixes ManageIQ/manageiq-providers-embedded_terraform#79 test failures

Fix `git_repository.checkout` with a `Pathname` in
`ConfigurationScriptSource#checkout_git_repository`
@Fryguy Fryguy merged commit 10857fb into ManageIQ:master Jan 15, 2025
8 checks passed
@Fryguy Fryguy self-assigned this Jan 15, 2025
@agrare agrare deleted the fix_checkout_git_repository_pathname branch January 15, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants