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

Change how we determine the repo_root in Gemfile. #82

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

myronmarston
Copy link
Collaborator

The old way doesn't appear to be working when dependabot is parsing our Gemfile. We're getting errors like:

Dependabot encountered the following error:

Bundler::Dsl::DSLError with message: [!] There was an error parsing `Gemfile`: Permission denied @ dir_s_mkdir - /log. Bundler cannot continue.

 #  from dependabot_tmp_dir/Gemfile:48
 #  -------------------------------------------
 #  # We create them here since `Gemfile` evaluation happens before anything else.
 >  ::FileUtils.mkdir_p("#{repo_root}/log")
 #  ::FileUtils.mkdir_p("#{repo_root}/tmp")
 #  -------------------------------------------

I think the .git directory may not be there when dependabot parses the Gemfile. Checking for a different file at the root will hopefully fix this.

The old way doesn't appear to be working when dependabot is parsing our `Gemfile`.
We're getting errors like:

```
Dependabot encountered the following error:

Bundler::Dsl::DSLError with message: [!] There was an error parsing `Gemfile`: Permission denied @ dir_s_mkdir - /log. Bundler cannot continue.

 #  from dependabot_tmp_dir/Gemfile:48
 #  -------------------------------------------
 #  # We create them here since `Gemfile` evaluation happens before anything else.
 >  ::FileUtils.mkdir_p("#{repo_root}/log")
 #  ::FileUtils.mkdir_p("#{repo_root}/tmp")
 #  -------------------------------------------
```

I think the `.git` directory may not be there when dependabot parses the `Gemfile`.
Checking for a different file at the root will hopefully fix this.
@myronmarston myronmarston marked this pull request as ready for review January 1, 2025 01:22
Copy link
Collaborator

@BrianSigafoos-SQ BrianSigafoos-SQ left a comment

Choose a reason for hiding this comment

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

LGTM

@myronmarston myronmarston merged commit 83be56f into main Jan 1, 2025
15 checks passed
@myronmarston myronmarston deleted the myron/dependabot-fixes/step8 branch January 1, 2025 01:32
myronmarston added a commit that referenced this pull request Jan 1, 2025
My earlier attempts (e.g. #82) did not work. Using the `dry_run` script[^1],
I've discovered that dependabot runs bundler commands in a temporary
directory that only contains _some_ of the source controlled files (e.g.
the `Gemfile`, `*.gemspec` files, etc). To be compatible with dependabot,
our `Gemfile` cannot assume the presence of any files beyond these.

[^1]: https://github.com/dependabot/dependabot-core/blob/v0.291.0/bin/dry-run.rb
myronmarston added a commit that referenced this pull request Jan 1, 2025
My earlier attempts (e.g. #82) did not work. Using the `dry_run` script[^1],
I've discovered that dependabot runs bundler commands in a temporary
directory that only contains _some_ of the source controlled files (e.g.
the `Gemfile`, `*.gemspec` files, etc). To be compatible with dependabot,
our `Gemfile` cannot assume the presence of any files beyond these.

[^1]: https://github.com/dependabot/dependabot-core/blob/v0.291.0/bin/dry-run.rb
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