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

pulibrary / tigerdata-app / a58d2114-3bb5-4615-9966-6a8fa8bc5e8f

29 Oct 2025 07:13PM UTC coverage: 91.355% (+0.02%) from 91.333%
a58d2114-3bb5-4615-9966-6a8fa8bc5e8f

push

circleci

web-flow
Log long Mediaflux requests (#2120)

Since we are going to fetch data from Mediaflux more frequently now that
we fetch the list of projects straight from Mediaflux (issue #2037) and
soon also the project details (#2039) it will be good to have a sense of
how long these queries are taking in Mediaflux.

For now I am logging as a warning any query that takes longer than 3
seconds. We can tweak that value once we see what's a good benchmark to
use. We could also send to Honeybadger extremely slow requests, again,
once we know what "extreme" means in the Mediaflux sense.

7 of 8 new or added lines in 1 file covered. (87.5%)

687 existing lines in 31 files now uncovered.

2811 of 3077 relevant lines covered (91.36%)

499.05 hits per line

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

88.89
/app/models/provenance_event.rb
1
# frozen_string_literal: true
2
class ProvenanceEvent < ApplicationRecord
5✔
3
  SUBMISSION_EVENT_TYPE = "Submission"
5✔
4
  APPROVAL_EVENT_TYPE = "Approved"
5✔
5
  ACTIVE_EVENT_TYPE = "Active"
5✔
6
  STATUS_UPDATE_EVENT_TYPE = "Status Update"
5✔
7
  DEBUG_OUTPUT_TYPE = "Debug Output"
5✔
8
  belongs_to :project
5✔
9

10
  def self.generate_submission_events(project:, user:)
5✔
UNCOV
11
    project.provenance_events.create(
2✔
12
      event_type: ProvenanceEvent::SUBMISSION_EVENT_TYPE,
13
      event_person: user.uid,
14
      event_details: "Requested by #{user.display_name_safe}"
15
    )
UNCOV
16
    project.provenance_events.create(
2✔
17
      event_type: ProvenanceEvent::STATUS_UPDATE_EVENT_TYPE,
18
      event_person: user.uid,
19
      event_details: "The Status of this project has been set to pending"
20
    )
21
  end
22

23
  def self.generate_approval_events(project:, user:, debug_output: nil)
5✔
24
    project.provenance_events.create(
235✔
25
      event_type: ProvenanceEvent::APPROVAL_EVENT_TYPE,
26
      event_person: user.uid,
27
      event_details: "Approved by #{user.display_name_safe}",
28
      event_note: project.metadata_model.approval_note
29
    )
30
    project.provenance_events.create(
235✔
31
      event_type: ProvenanceEvent::STATUS_UPDATE_EVENT_TYPE,
32
      event_person: user.uid,
33
      event_details: "The Status of this project has been set to approved"
34
    )
35
    unless debug_output.nil?
235✔
36
      project.provenance_events.create(event_type: ProvenanceEvent::DEBUG_OUTPUT_TYPE, event_person: user.uid, event_details: "Debug output", event_note: debug_output)
235✔
37
    end
38
  end
39

40
  def self.generate_active_events(project:, user:)
5✔
41
    project.provenance_events.create(
×
42
      event_type: ProvenanceEvent::ACTIVE_EVENT_TYPE,
43
      event_person: user.uid,
44
      event_details: "Activated by Tigerdata Staff"
45
    )
46
    project.provenance_events.create(
×
47
      event_type: ProvenanceEvent::STATUS_UPDATE_EVENT_TYPE,
48
      event_person: user.uid,
49
      event_details: "The Status of this project has been set to active"
50
    )
51
  end
52
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