Rake task naming

Our rake tasks are currently using the openfoodnetwork namespace.

rake notes:custom                                           # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rake openfoodnetwork:billing:finalize_account_invoices      # Finalize enterprise user invoices
rake openfoodnetwork:billing:update_account_invoices        # Update enterprise user invoices
rake openfoodnetwork:cache:check_products_integrity         # check the integrity of the products cache
rake openfoodnetwork:cache:warm_products                    # warm the products cache
rake openfoodnetwork:data:create_order_cycle_relationships  # Adding relationships based on recent order cycles
rake openfoodnetwork:dev:export_enterprises                 # export enterprises to CSV
rake openfoodnetwork:dev:load_sample_data                   # load sample data
rake paperclip:clean                                        # Cleans out invalid attachments

@sauloperez suggested to get rid of that namespace for two reasons:

  • It is redundant.
  • It is inefficient to type.

I was just about to agree with him when I thought about one benefit of having our own namespace:

  • rake -T lists tasks by namespace and groups our tasks together.

We have 93 tasks in 31 namespaces. Some come from Rails and others from our gems. If we wouldn’t use a namespace, we wouldn’t see which tasks are ours.

Now I would like to discuss two options:

  • Change our rake namespace to ofn.
  • Use ls lib/tasks/ instead of rake -T.

Any opinions?

I wonder if all those tasks are actually used but if you want to still keep the namespace let’s rename it to ofn at least.

Yes, agree. Lets rename it to ofn.

we should still aim to get rid of the openfoodnetwork namespace in the code (/lib).

1 Like

I also prefer to keep the namespace for the Rake task. Happy with renaming it to “ofn”. :slight_smile:

I created https://github.com/openfoodfoundation/openfoodnetwork/issues/3248 to make the change.

1 Like