Skip to content

Conversation

that-jill
Copy link
Contributor

Motivation / Background

Was testing the 8.1 upgrade and noticed that bundler-audit files got added when running bin/rails app:update, regardless of whether that gem was included in the gemfile.

Since the new/update passes are tightly coupled, this also adds the option to --skip-bundler-audit when generating a new app. This flag was passed in to the --minimal generator option as well.

Additional information

Added automated testing for newly-generated apps and tested with an app I'm using to test the Rails 8.1 upgrade.

Checklist

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Sep 19, 2025
Copy link
Member

@skipkayhil skipkayhil left a comment

Choose a reason for hiding this comment

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

Some small things but generally looks good

template "application.rb"
template "environment.rb"
template "bundler-audit.yml"
template "bundler-audit.yml" unless options[:skip_bundler_audit]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
template "bundler-audit.yml" unless options[:skip_bundler_audit]
template "bundler-audit.yml" unless skip_bundler_audit?

Is there a reason to use options here?

end

if !bundle_audit_config_exist
if !@options[:skip_bundler_audit] && !bundle_audit_config_exist
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@that-jill that-jill force-pushed the jk/conditional-bundler-audit branch from 136209f to 722f442 Compare September 19, 2025 21:21
@rafaelfranca
Copy link
Member

Tests are broken

@rafaelfranca rafaelfranca added this to the 8.1.0 milestone Sep 22, 2025
@that-jill that-jill force-pushed the jk/conditional-bundler-audit branch from a65d957 to 10040f8 Compare September 23, 2025 17:34
Running `bin/rails app:update` with Rails 8.1 adds bin/bundler-audit and config/bundler-audit.yml even if it's not in the Gemfile already. This checks whether bundler_audit is in the bundle and otherwise skips for the app generator.

Adds config option to skip bundler-audit in new applications.

Extends --minimal option to include bundler-audit

Updates changelog

Updates test assertions re: bundler-audit;
the #generate_test_dummy method skips bundle and bundler-audit, so it should not be expected to be present
@that-jill that-jill force-pushed the jk/conditional-bundler-audit branch from 10040f8 to 0a0addc Compare September 23, 2025 17:49
@that-jill
Copy link
Contributor Author

Sorry for the delay -- all comments have been addressed and tests are green :)

@skipkayhil skipkayhil merged commit dec9fd9 into rails:main Sep 23, 2025
3 checks passed
@skipkayhil
Copy link
Member

Amazing, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants