Belle II Software  release-08-01-10
ValidationRoot Class Reference

Public Member Functions

def __init__ (self, working_folder, gitlab_object, gitlab_config)
 
def create_comparison (self)
 
def index (self)
 
def plots (self, *args)
 
def check_comparison_status (self)
 
def revisions (self, revision_label=None)
 
def comparisons (self, comparison_label=None)
 
def system_info (self)
 
def retrieve_file_metadata (self, filename)
 
def create_issue (self, title, description)
 
def issue (self, file_path, rev_label)
 
def issue_redirect (self, iid)
 
def update_issue (self, id, file_path, rev_label)
 

Public Attributes

 working_folder
 html folder that contains plots etc.
 
 last_restart
 Date when this object was instantiated.
 
 version
 Git version.
 
 gitlab_object
 Gitlab object.
 
 gitlab_config
 Gitlab config.
 
 plot_path
 placeholder variable for path
 
 revision_label
 placeholder variable for revision label
 

Detailed Description

Root Validation class to handle non-static HTTP requests into the
validation server. The two main functions are to hand out compiled json
objects of revisions and comparisons and to start and monitor the
creation of comparison plots.

Definition at line 415 of file validationserver.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  working_folder,
  gitlab_object,
  gitlab_config 
)
class initializer, which takes the path to the folders containing the
validation run results and plots (aka comparison), gitlab object and
config

Definition at line 425 of file validationserver.py.

425  def __init__(self, working_folder, gitlab_object, gitlab_config):
426  """
427  class initializer, which takes the path to the folders containing the
428  validation run results and plots (aka comparison), gitlab object and
429  config
430  """
431 
432 
433  self.working_folder = working_folder
434 
435 
436  self.last_restart = datetime.datetime.now()
437 
438 
440  os.environ["BELLE2_LOCAL_DIR"]
441  )
442 
443 
444  self.gitlab_object = gitlab_object
445 
446 
447  self.gitlab_config = gitlab_config
448 
449 
450  self.plot_path = None
451 
452  self.revision_label = None
453 
Optional[str] get_compact_git_hash(str repo_folder)

Member Function Documentation

◆ check_comparison_status()

def check_comparison_status (   self)
Checks on the status of a comparison creation

Definition at line 503 of file validationserver.py.

◆ comparisons()

def comparisons (   self,
  comparison_label = None 
)
return the json file of the comparison results of one specific
comparison

Definition at line 618 of file validationserver.py.

◆ create_comparison()

def create_comparison (   self)
Triggers the start of a now comparison between the revisions supplied
in revision_list

Definition at line 457 of file validationserver.py.

◆ create_issue()

def create_issue (   self,
  title,
  description 
)
Call the functions to create the issue and redirect
to the created Gitlab issue page.

Definition at line 679 of file validationserver.py.

◆ index()

def index (   self)
forward to the static landing page if
the default url is used (like http://localhost:8080/)

Definition at line 471 of file validationserver.py.

◆ issue()

def issue (   self,
  file_path,
  rev_label 
)
Return a template issue creation interface
for the user to add title and description.

Definition at line 732 of file validationserver.py.

◆ issue_redirect()

def issue_redirect (   self,
  iid 
)
Redirect to the Gitlab issue page.

Definition at line 749 of file validationserver.py.

◆ plots()

def plots (   self,
args 
)
Serve file from the html/plot directory.
:param args: For the request /plots/a/b/c, these will be the strings
    "a", "b", "c"

Definition at line 479 of file validationserver.py.

◆ retrieve_file_metadata()

def retrieve_file_metadata (   self,
  filename 
)
Returns:
    Metadata(str) of the file

Definition at line 667 of file validationserver.py.

◆ revisions()

def revisions (   self,
  revision_label = None 
)
Return a combined json object with all revisions and
mark the newest one with the field most_recent=true

Definition at line 514 of file validationserver.py.

◆ system_info()

def system_info (   self)
Returns:
    JSON file containing git versions and time of last restart

Definition at line 647 of file validationserver.py.

◆ update_issue()

def update_issue (   self,
  id,
  file_path,
  rev_label 
)
Update existing issue in Gitlab with current result plot
and redirect to the updated Gitlab issue page.

Definition at line 765 of file validationserver.py.


The documentation for this class was generated from the following file: