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 rake tasks #38

Merged
merged 2 commits into from
Aug 10, 2022
Merged

Fix rake tasks #38

merged 2 commits into from
Aug 10, 2022

Conversation

darokel
Copy link
Contributor

@darokel darokel commented Aug 10, 2022

Tried to run one of the rake tasks in Publish and it was complaining about structure of args. This PR introduces a couple of fixes:

  • Fixes rake task :import_all_entities, eg:
NameError: undefined local variable or method `entities_for_analytics' for main:Object

      entities_for_analytics.each do |entity_name|
  • Fixes rake task :import_entity to correctly destructure args otherwise we get:
ArgumentError: wrong number of arguments (given 1, expected 0; required keyword: entity_name)
  • Pins async gem to a version that hasn't been yanked

Also pinned the async gem to a version that hasn't been yanked, let me know if this is ok.

@misaka
Copy link
Contributor

misaka commented Aug 10, 2022

Just to add context, apply and register are still on Ruby 2.7.x, which is why despite the Ruby version being set to 3.1.2 in .tool-versions, we never encountered this error. The are also no tests for that slim bit of the code in the task.

Copy link
Contributor

@misaka misaka left a comment

Choose a reason for hiding this comment

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

🚀

@misaka misaka merged commit a2343d9 into main Aug 10, 2022
@misaka misaka deleted the fix-rake-task-args branch August 10, 2022 16:02
thomasleese added a commit to DFE-Digital/apply-for-qualified-teacher-status that referenced this pull request Sep 29, 2022
This should fix a bug when trying to import an entity using the Rails
console: DFE-Digital/dfe-analytics#38
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