Prevent incorrect Tigris configuration in Rails scanner for GitHub integration #4740
+194
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
A user reported that when using the GitHub integration to launch their app, it kept failing because it kept prompting for Tigris bucket creation and getting stuck on the terms of service agreement. Deploying/launching through
flyctlwas unaffected, and worked fine.What and Why:
This was failing in the
scanner/rails.gofile. We had logic for checking a few different things about a user's Rails app, and if any were true, we'd automatically enable Tigris. They were:aws-sdk-s3inGemfile/Gemfile.lock:active_storage_attachmentsfound in anydb/migrate/*.rbconfig/storage.ymlexists, then parse and look forservice: S3sqlite3being present in theDockerfileandSKIP_EXTENSIONSbeing unsetThe user sent over their Dockerfile, which had
sqlite3in it, and they also confirmed that they had old migration files that related to Active Storage. I'm fairly confident the presence ofsqlite3is what's biting them here (I'm less sure about the Active Storage stuff).I've added changes here to try and correct these issues:
os.Getenv("SKIP_EXTENSIONS")conditional line so that Tigris isn't enabled automatically if that env var isn't set (and I'd assume it's not set for most people).Screenshots:
I was able to reproduce the issue with a starter Rails app:
