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

pulibrary / tigerdata-app / 9744eb62-2116-4c68-a374-4bd7ce4aef41

22 Oct 2025 01:31PM UTC coverage: 91.045% (-0.1%) from 91.184%
9744eb62-2116-4c68-a374-4bd7ce4aef41

Pull #2072

circleci

carolyncole
Getting rid of the New Project Wizard flipper
Pull Request #2072: Getting rid of the New Project Wizard flipper

3 of 4 new or added lines in 1 file covered. (75.0%)

1001 existing lines in 32 files now uncovered.

2735 of 3004 relevant lines covered (91.05%)

376.03 hits per line

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

100.0
/app/operations/project_search.rb
UNCOV
1
class ProjectSearch < Dry::Operation
3✔
UNCOV
2
    def call(search_string:, requestor:, field_name: "Title")
3✔
UNCOV
3
        verified_search_string = step verify_search_string(search_string)
14✔
UNCOV
4
        result_ids = step query_mediaflux(search_string: verified_search_string, requestor:, field_name:)
13✔
UNCOV
5
        step convert_results(result_ids)
12✔
UNCOV
6
    end
7

UNCOV
8
    private
3✔
9

UNCOV
10
    def verify_search_string(search_string)
3✔
11
        # An empty search does not make sense
UNCOV
12
        if search_string.blank?
14✔
UNCOV
13
            Failure("Search String cannot be empty")
1✔
14
        # Assuming there may be more verifications in the future
UNCOV
15
        else
UNCOV
16
            Success(search_string)
13✔
UNCOV
17
        end
UNCOV
18
    end
19

UNCOV
20
    def query_mediaflux(search_string:, requestor:, field_name:)
3✔
UNCOV
21
      query = mediaflux_query(search_string:, requestor:, field_name:)
13✔
UNCOV
22
      if query.error?
13✔
UNCOV
23
        Failure("Error querying mediaflux: #{query.response_error[:message]}")
1✔
UNCOV
24
      else
UNCOV
25
        result_ids = query.result_items.map{|result| result[:id]}
26✔
UNCOV
26
        Success(result_ids)
12✔
UNCOV
27
      end
UNCOV
28
    end
29

UNCOV
30
    def mediaflux_query(search_string:, requestor:, field_name:)
3✔
UNCOV
31
      aql_query = "xpath(tigerdata:project/#{field_name}) matches ignore-case '#{search_string}'"
13✔
UNCOV
32
      Mediaflux::QueryRequest.new(session_token: requestor.mediaflux_session, aql_query: , iterator: false )
13✔
UNCOV
33
    end
34

35

UNCOV
36
    def convert_results(result_ids)
3✔
UNCOV
37
        errors = []
12✔
UNCOV
38
        projects = result_ids.map do |mediaflux_id|
12✔
UNCOV
39
          project = Project.find_by(mediaflux_id: )
14✔
UNCOV
40
          if project.blank?
14✔
UNCOV
41
            errors << mediaflux_id
1✔
UNCOV
42
          end
UNCOV
43
          project
14✔
UNCOV
44
        end
UNCOV
45
        if errors.count > 0
12✔
UNCOV
46
          Failure("The following Mediaflux Projects were not found in the Rails database: #{errors.join(', ')}")
1✔
UNCOV
47
        else
UNCOV
48
          Success(projects)
11✔
UNCOV
49
        end
UNCOV
50
    end
UNCOV
51
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

© 2025 Coveralls, Inc