• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

curationexperts / laevigata / 3d3af85f-d15e-4a16-9ec1-f834b564ac67

01 Jul 2025 05:48PM UTC coverage: 97.424%. Remained the same
3d3af85f-d15e-4a16-9ec1-f834b564ac67

push

circleci

mark-dce
Fix redlock deprecation warnings

**ISSUE**
After the `Redis.current` fix, we are now seeing significant numbers
of deprecations warnings like:
```
Passing 'call' command to redis as is; blind passthrough has been
  deprecated and will be removed in redis-namespace 2.0
  (at /Users/mark/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/
   redlock-2.0.6/lib/redlock/client.rb:214:in `block (2 levels) in unlock')
```

**DIAGNOSIS**
We were passing a RedisNamespace object to Redlock instead of a
plain Redis connection specifier. RedisNamespace was complaining
any time an admin (not-namespace-able) command was received.

**RESOLUTION**
Pass a Redis URI to RedLock instead of a RedisNamespace object.

2 of 2 new or added lines in 1 file covered. (100.0%)

286 existing lines in 34 files now uncovered.

2837 of 2912 relevant lines covered (97.42%)

52.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.37
/app/controllers/in_progress_etds_controller.rb
1
class InProgressEtdsController < ApplicationController
3✔
2
  def new
3✔
3
    authorize! :create, InProgressEtd
10✔
4

5
    @in_progress_etd = if params[:etd_id]
9✔
6
                         InProgressEtd.find_or_create_by(etd_id: params[:etd_id])
5✔
7
                       else
UNCOV
8
                         InProgressEtd.find_or_create_by(user_ppid: current_user.ppid)
4✔
9
                       end
10

11
    # Now that the record has been created, render the form so student can edit it:
12
    redirect_to action: :edit, id: @in_progress_etd.id
9✔
13
  end
14

15
  # Note: There is no 'create' action because the 'new' action does 'find or create'.
16

17
  def edit
3✔
18
    if current_user.nil?
13✔
UNCOV
19
      redirect_to new_user_session_path
2✔
20
    else
21
      @in_progress_etd = InProgressEtd.find(params[:id])
11✔
22
      authorize! :update, @in_progress_etd
10✔
23
      @in_progress_etd.refresh_from_etd!
8✔
24
      @data = @in_progress_etd.data
8✔
25
    end
26
  rescue ActiveRecord::RecordNotFound
UNCOV
27
    redirect_to root_url
1✔
28
  end
29

30
  # The Vue.js form uses this action to update the record.
31
  def update
3✔
UNCOV
32
    @in_progress_etd = InProgressEtd.find(params[:id])
11✔
UNCOV
33
    authorize! :update, @in_progress_etd
11✔
UNCOV
34
    @in_progress_etd.data = prepare_etd_data.to_json
9✔
35

UNCOV
36
    if @in_progress_etd.save
9✔
UNCOV
37
      @data = @in_progress_etd.data
9✔
UNCOV
38
      render json: { in_progress_etd: @data, lastCompletedStep: current_step(@data), tab_name: tab_name }, status: 200
9✔
39
    else
40
      render json: { errors: @in_progress_etd.errors.messages }, status: 422
×
41
    end
42
  end
43

44
  def destroy
3✔
UNCOV
45
    @in_progress_etd = InProgressEtd.find(params[:id])
2✔
UNCOV
46
    authorize! :update, @in_progress_etd
2✔
UNCOV
47
    @in_progress_etd.destroy
1✔
48

UNCOV
49
    redirect_to root_url
1✔
50
  end
51

52
  private
3✔
53

54
    def current_step(data)
3✔
UNCOV
55
      saved_data = JSON.parse(data)
9✔
UNCOV
56
      saved_data['currentStep']
9✔
57
    end
58

59
    def tab_name
3✔
UNCOV
60
      etd = request.parameters.fetch(:etd)
9✔
UNCOV
61
      etd.fetch(:currentTab, "About Me")
9✔
62
    end
63

64
    def prepare_etd_data
3✔
65
      # TODO: strong params
UNCOV
66
      new_data = request.parameters.fetch(:etd, {})
9✔
67

68
      # Add the new data to the existing persisted data
UNCOV
69
      @in_progress_etd.add_data(new_data)
9✔
70
    end
71
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc