How can I offer a beta feature to select users? (rails)

We want to start offering our users help in testing the changes to our function in front of the wider version. Our rails application already has roles, but I don’t know how we need to implement the beta without moving the whole application.

Some problems that I cannot think of solutions about:

  • Beta may require database migration. How can you handle this if it can cause problems with an existing application?
  • Changing templates and css / sass will most likely change it to existing functions.
  • Changing the model’s base code can break existing controllers / interfaces that rely on it.

One solution (a bad option) is to encode a new function and transfer it to logic, which shows / uses it only if the user has a beta role. The problem with this is when you finally take it live, you can unwind / change a lot. This is a waste of time, and can lead to errors.

Another solution is to launch a separate branch of the beta application from the subdomain and redirect users with the beta role to it. The problem is that the complexity of ssl certificates, email links, and other domain-related issues makes this a bit of a maintenance pain (although not as bad as the first solution).

How can I offer this most effectively in order to minimize the extra maintenance work and then switch the beta to the full version?

+6
ruby-on-rails beta roles
source share
5 answers

One possibility to consider: changing destructive (i.e., one-way, irreversible) changes in your model can be problematic for reasons that do not impede your ability to provide this beta functionality. For example, it may be difficult to backslide from a change if you have a problem during the migration.

Instead, I would recommend looking at ways to add only to the model: add columns, leaving the old columns in place for backward compatibility, version stored procedures if you use them, etc. If you need to change the column data types, create a new column of the target data type instead, then transfer the transfer and copy the existing row data from the old column to the new column in the new format. You can then migrate the database in a test environment and confirm that both old and new versions of the application continue to work with database changes.

One possible way to serve multiple versions of your application is to use an alternative response_to format for your beta site. You can create a method in your ApplicationController to check if the user was in beta. If true, you can override the request.format value, and in your response_to block, you can use a response of the format.beta type.

The objective of this approach is the logic of the controller. Without implementing any switching logic in your controller methods, you will not have a way to change the controller code path. This may not be a serious problem, depending on how many controller changes you have.

(By the way, it looks like we have very similar names! :-))

0
source share

I think that the only reasonable chance that these tests will work without affecting the current application will use an “intermediate” environment and it is really easy to redirect beta users to this environment.

Compared to issues related to domain related features, this is really nothing compared to migration / functionality issues.

In our company, we do just that, but we do not have beta users, but without a separate environment it will be very attractive so that new functions do not get confused with current functions.

For functions, just use different branches for these new functions and create this "intermediate" environment from this branch, once the functions have been tested, you just combine them with HEAD, and there will be a new function:]

+1
source share

What I can think of is like having a user_type column in your users table. so that you can mark them as beta users. (Even you can set this flag by default, so you don’t need to change the existing code. All new users who create will be beta users.)

For this, I assume

You provide all the features to your beta users Beta users will have the same features that a regular user will have in the future.

** The only advantage is that you can filter beta users as they log in. After that, you can do something like permission to log in or not, etc.

When you upgrade to the full version, just upgrade your beta users as regular users.

I do not know how this applies to your scenario.

thanks

sameera

0
source share

I personally don’t think it’s a bad idea to wrap the code with a check for a user with a beta role. It will be pretty easy to find all the calls, for example if current_user.authorized?(:beta) , and delete them completely.

0
source share

One thing I’m thinking about is creating a beta “intermediate” environment, which is actually a production environment. The idea would be to have beta.mydomain.com, and then send users there who want to get features earlier. Basically, it will only be a branch that will be deployed to a beta site that is live.

0
source share

All Articles