-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Wrong cache version is being pulled #644
Comments
I think it is this assumption that doesn't pan out in the above scenario: Lines 133 to 134 in 2eb6adb
Lines 156 to 160 in 2eb6adb
After Are you able to share complete logs? |
Maybe you can workaround this issue by not utilizing the cache for Dependabot PRs, if you can set |
That should work, but at that point I think I'd rather just require/force a rebase which would build with the right cache |
note that |
also, i am in agreement. I think the problem is the restore key ends up being |
I'm working on other things, so I really haven't dove into this. But, doesn't the above imply an issue with Bundler? The cache only allows Bundler to skip installing a gem iff it exists in the cache. It should have no effect on what gems are installed. Assuming a lock file exists... |
There is no way to log Gemfile.lock before setup-ruby starts the Bundler operations. That might be a helpful option for debugging, possibly with before/after flags. Have you logged/dumped Gemfile.lock to GHA log after setup-ruby? |
I have not, though i expect it to be updated. Is there a good way to do that in a GHA context? |
At present, the only way is to log it after the setup-ruby step. Just a This issue seems to imply that Bundler is changing/updating the lock file, and that shouldn't be happening. JFYI, most of the repos I work do not have a committed lock file. |
Sorry for the month delay, but this looks like an issue with the What's happening is our Gemfile will have a non-versioned dependency on DepA. Dependabot will create PRs for DepA and DepB. While the workflow for DepA is running, it gets cached. The workflow for DepB will run a workflow and use the new cached version but the Gemfile.lock is pointing to the old version of DepA. This results in the Gemfile.lock being updated to point to the new version of DepA. THEN, Thanks for giving me some ideas in how to look into it! |
Ensure the following before filing this issue
I verified it reproduces with the latest version with
- uses: ruby/setup-ruby@v1
(see Versioning policy)I tried to reproduce the issue locally by following the workflow steps (including all commands done by
ruby/setup-ruby
, except forDownloading Ruby
&Extracting Ruby
),and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)
Are you running on a GitHub-hosted runner or a self-hosted runner?
GitHub-hosted runner
Link to the failed workflow job (must be a public workflow job, so the necessary information is available)
N/A (private repo)
Any other notes?
My repo is configured to update dependencies via dependabot on a weekly basis. This results in several workflow runs happening at the same time. What happens is one will succeed while the others fail.
This is some of the setup-ruby output from a failing workflow.
1024f2d7ec17eca5d662d57aabb33f2b5dbf3151f63ba7387703c6f4a510398c
is from the correct PR whilee79244d076684691f3e3bee941acbd598e01782903e729f356995601ebfe812f
is from an older PR and also used for the master build once that PR is merged successfully.This build will eventually fail when running
wearerequired/lint-action
due to the following:It should be noted that I configured the action to run rubocop in the bundler context (
rubocop_command_prefix: bundle exec
) The Gemfile.lock for this workflow specifiesrspec-expectations-3.13.2
while the Gemfile.lock on the older PR (and master) usesspec-expectations 3.13.3
. I can see this is also what's used during the workflow when it performsbundle install
. The current workaround is to rebase the PR which will update the Gemfile.lock to be based off of the most recent cache.From what I can tell in the code, setup-ruby pulls the latest cache instead of the cache for the previous version of the
Gemfile.lock
. Is this possible to change?The text was updated successfully, but these errors were encountered: