buildframework/helium/sf/java/metadata/metadata.rst
author kelvzhu
Tue, 27 Jul 2010 13:00:43 +0800
changeset 621 96fee2635b19
parent 587 85df38eb4012
permissions -rw-r--r--
Fixed Bug 2413 for evalid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
  module: Configuring Metadata
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
====================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Configuring Metadata
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
====================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
.. contents::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
This document describes the purpose of metadata and how is being used in helium and
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
how it can be used by the customer.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
Overview
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
========
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
Metadata is process to find the errors, warnings from the output log differnt section of the build
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
and store it to the database, which could be used during each stage of the build to process efficiently
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
and send details to diamonds, used for signaling, and generating summary file.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
Metadata Details
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
1. Metadatarecord : Which is used to store the errors, warnings information to the database
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    1.1. It takes the metadatainput (the type of log parsing to be used), currently supported parsing are
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
       a. sbsmetadatainput - sbs log processing (based on xml processing)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
       b. textmetadatainput - general text log processing (based on text processing)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
       c. policylogmetadatainput - policy log output processing (based on xml processing)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
       d. antlogmetadatainput - ant log output processing (based on text processing)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
       e. abldlogmetadatainput - abld log output processing (based on text processing)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
       
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
       Please see ant doc for more details on metadatarecord.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
   1.2 It takes the fileset containing list of log files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
   
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
   1.3 It takes the metadata filter, list of regular expression for searching strings.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
   
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
Metadata Filters
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
This document describes the usage of metadata filter to change the severity level during different stages of the build.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
Overview
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
--------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
Metadata filters are set of regular expressions used to match the text of the build output and process the errors, categorize it,
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
and used to generate the output for diamonds, summary file, email output. Predefined set of ids are defined for each stage of the
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
build. For example for raptor compilation filter is defined as below,
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
The default definition of filterset.sbs is
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    <hlm:metadatafilterset id="filterset.sbs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        <metadatafilterset refid="filterset.common" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
    </hlm:metadatafilterset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
which is using the common definition which is,
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
    <hlm:metadatafilterset id="filterset.common">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
        <metadatafilterset filterfile="${helium.dir}/config/metadata_regex.csv" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
    </hlm:metadatafilterset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
The complete list of predefined ids for various stages of the build are defined in this file,
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
helium/config/metadata_filter_config_default.xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
Each ID can be overridden to provide additional regular expression to control the results of the build for different stages.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
Two ways to add the regular expressions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
---------------------------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
 - Adding more than one regular expression
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
Define your own csv file and override it in your configuration as below (add this after importing helium.ant.xml file),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
    <hlm:metadatafilterset id="filterset.sbs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
        <metadatafilterset filterfile="${s60.config}/config/metadata_regex.csv" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
    </hlm:metadatafilterset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
 - Adding just one regular expression
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
This can be done as below,
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
    <hlm:metadatafilterset id="filterset.sbs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
      <metadatafilter priority="error" regex=".*Error\s*:\s+.*" description="sbs compilation error" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
      <metadatafilterset filterfile="${helium.dir}/config/metadata_regex.csv" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
    </hlm:metadatafilterset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
Note
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
----
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
1. The order of metadatafilter / metadatafilterset is important, so the first one takes precedence than the second one.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
2. Order is also preserved in the csv file, the expressions which are defined first get precedence than the later one.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
3. All the regular expressions are JAVA patterns.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
         
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
Usage in Helium
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
===============
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
Different build stages were processed and identified the type of output and added the metadatarecord
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
task for each build stage and captured the output in the database. And after storing it, using fmpp 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
template the error information from database are processed to send to diamonds, raised signal accordingly.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
Usage
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
=====
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
Examples:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
    SBS comilation output in db:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
    <hlm:metadatarecord database="${metadata.dbfile}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
        <hlm:sbsmetadatainput cleanLogFile="${sbs.clean.log.file}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
            <fileset casesensitive="false" file="${sbs.log.file}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
            <metadatafilterset refid="filterset.sbs" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
        </hlm:sbsmetadatainput>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   134
    </hlm:metadatarecord>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   135
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   136
This example is to process sbs output. The metadatainput is sbsmetadatainput to process the sbs log file, takes the sbs.log.file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
uses the regular expression defined by filterset.sbs
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
    <hlm:metadatarecord database="${metadata.dbfile}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
        <hlm:abldmetadatainput>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
            <fileset casesensitive="false" file="${build.log.dir}/${build.id}${cmaker.log.label}.export.cmaker.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
            <metadatafilterset refid="filterset.compile" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
        </hlm:abldmetadatainput>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   146
    </hlm:metadatarecord>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   147
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
This example process the cmaker output as abld output log. It takes abldmetadatainput as metadatainput
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
and the logfile as ${build.log.dir}/${build.id}${cmaker.log.label}.export.cmaker.log and the regular
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
expression is used from the reference filterset.compile.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
Similarly any of the log output file can be easily processed in a similar way.