All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Please mark backwards incompatible changes with an exclamation mark at the start.
PropertiesFetcher#last
now correctly returns the last set of properties (ordered chronologically).
QueryBuilder#source
can now takefalse
,Array
andHash
in addition to simple strings.
- The
max
method to theQueryBuilders::Aggregations
class. - Added the
Aggregations::Max
class. To model Elasticsearch'smax
aggregation type.
- !
QueryClauses#merge
no longer produces nested boolean clauses when two boolean queries are merged.
- The
#negate
and#negate!
methods to theQueryClauses
class. - The
QueryClauses::Negator
class. - The
QueryClauses::MatchNone
class and the corresponding#match_none
method to theMatchClauses
module. This allows the use of Elasticsearch's match_none query to be used with the Query Builder - The
QueryClauses::MatchAll
class and the corresponding#match_all
method to theMatchClauses
module. This allows the use of Elasticsearch's match_all query to be used with the Query Builder #merge
and#merge!
to theQueryClauses:Bool
class
Elasticsearch::Index#delete_by_query_async
, a method that asynchronously deletes the documents matching a query from the indexJayAPI::Elasticsearch::Async
, a class that provides functionality to perform asynchronous operations on an Elasticsearch indexJayAPI::Elasticsearch::Tasks
, a class that represents Elasticsearch tasks- Two additional optional parameters:
slices
andwait_for_completion
toElasticsearch::Index#delete_by_query
. QueryBuilder::QueryClauses::MatchClauses#regexp
, a method that adds aJayAPI::Elasticsearch::QueryBuilder::QueryClauses::Regexp
clause to the Query Clauses set.QueryBuilder::QueryClauses::Regexp
, a class that represents a Regexp query in Elasticsearch.
- The
type
parameter toElasticsearch::Index
's#index
method. The parameter can be set tonil
to avoid the creation of nested documents. - The
Aggregations::TopHits
class and theAggregations#top_hits
method. They make it possible to use Elasticsearch'stop_hits
aggregations.
- The
clone
method to theQueryBuilder::Aggregations
class.
- Merging two
QueryBuilder
instances now preserves nested aggregations. QueryBuilder::Aggregations::ValueCount
no longer accepts nested aggregations.QueryBuilder::Aggregations::Sum
no longer accepts nested aggregations.
QueryBuilder::Aggregations::Avg
no longer accepts nested aggregations.Elasticsearch::Client
will no longer retry requests when they fail with one of the following errors:BadRequest
,Unauthorized
,Forbidden
,Not Found
,MethodNotAllowed
,RequestEntityTooLarge
,NotImplemented
.
- The
Aggregations::ValueCount
class and theAggregations#value_count
method. They make it possible to use Elasticsearch'svalue_count
aggregations.
- The
Aggregations::Filter
class and theAggregations#filter
method. They make it possible to use Elasticsearch'sfilter
aggregations.
- ! The return value of
Aggregations#to_h
. Instead of returning only the aggregations themselves as aHash
the method now returns aHash
with a rootaggs
key under which the actual aggregations are placed.
- The
Aggregations::Sum
class andAggregations#sum
method. They allow Elasticsearch'ssum
aggregation to be used. - The
clone
method to theAggregation
classes. - The
aggs
method to theAggregation
classes. This allows Elasticsearch aggregations to be nested allowing the creation of composite aggregations. - The
none?
method to theAggregations
class.
! The CLI. The Gem no longer offers a CLI. The CLI functionality has been
moved the jay_cli
gem. Please install that gem instead.
- An issue in the
PropertiesFetcher
class'slast
andfirst
methods which produced incorrect results when thebuild_number
field resets, for example, when build jobs are moved or re-created.
- ! The following methods from the
QueryBuilder::Aggregations
class:add
,clear
,[]
- The
terms
,avg
andscripted_metric
methods to theQueryBuilders::Aggregations
class. These replace the formeradd
method. - Added the
Aggregations::Avg
class. To model Elasticsearch'savg
aggregation type. - Added the
Aggregations::ScriptedMetric
class. To model Elasticsearch'sscripted_metric
aggregation type. - Added the
Aggregations::Terms
class. To model Elasticsearch'sterms
aggregation type. - Added the
QueryBuilder::Script
class. The class represents ascript
ed element in an Elasticsearch query (can be used with some query clauses and aggregations).
- Added the
merge
method toQueryBuilder
- Added the
merge
method toAggregations
- Added the
merge
method toQueryClauses
- Added the
clone
method toQueryClauses
- Added the
empty?
method toQueryClauses
- Added the
clone
method toQueryClauses::Bool
- ! Removed the
query=
method fromQueryClauses::QueryString
- ! Removed the
conditions
method from theQueryBuilder
class.
- Added a missing
require
offaraday/error
toJayAPI::Elasticsearch::Client
- ! The
PriorVersionFetcherBase
class no longer accepts acluster_url
and aport
parameter, it now requires an already-initializedJayAPI::Elasticsearch::Client
object.
- Added the
delete_by_query
method to theElasticsearch::Index
class. - Added the
QueryClauses::Terms
class and the corresponding#terms
method to theMatchClauses
module. These allow Elasticsearch's Terms query to be used when making use of theQueryBuilder
class.
- Enhanced
ClientFactory#create
with new configurable parameters:max_attempts
,wait_strategy
andwait_time
.
- A
Response
class that wraps around the raw Elasticsearch response Hash - A
BatchCounter
class that keeps track of which batch of results the QueryResults object is for. - A
SearchAfterResults
class that is a QueryResults class but for the Elasticsearch 'search_after' query type. - Added 'search_after' param to Index#search, as a replacement for Scroll API.
- ! Scroll API feature is removed, because it is deprecated.
- Fixed a
NoMethodError
that was introduced withactivesupport 7.1.0
.
- Add missing double splat operators to the calls for methods with keyword
arguments. This fixes the
ArgumentError
being raised when running with Ruby 3.0+ - Fixed the
Elasticsearch::ClientFactory
class's type-hint documentation.
- ! Changed the
PropertiesFetcher#all
method:- The method can now take a block, if a block is given each of the fetched documents will be yielded to the given block.
- If no block is given then an
Enumerator
is returned. Which can be used to iterate or access each of the individual elements of the fetched set. - The method no longer returns a
QueryResults
object.
- Added
by_sut_revision
method toPropertiesFetcher
class. This allows build properties to be fetched by specifying the desired 'sut_revision'.
- Requirements in RSpec tests whose results are being collected with the
TestDataCollector
class can now be annotated with eitherrequirements
orrefs
.
- Fixed a set of
ArgumentError
s that were happening during the initialization of theJayAPI::Elasticsearch::Index
.
- A wrapper class
JayAPI::Elasticsearch::Client
is introduced to wrap overElasticsearch::Client
class. Its API is the same as the original Client, but it will now retry a request a few times if one of the following errors are raised:Elasticsearch::Transport::Transport::ServerError
Faraday::TimeoutError
- !The Index class's constructor changed its signature to take an already initialized JayAPI::Elasticsearch::Client object, instead of the parameters needed to initialize it.
- ! Removed the
-b
switch from the J-Unit and C-Dash parsers. The parsers will no longer read build properties files.
- ! Changed the J-Unit and C-Dash parsers, they will no longer read environment variables from the environment, instead they require the Test Environment to be specified in the configuration.
- ! Updated
activesupport
from~> 6
to~> 7
- ! Updated
dredge
from~> 0
to~> 2
- ! Set the minimum requirement for Ruby to 2.7.0
- Restricted the version of the
ox
gem to<= 2.14.14
- ! Changed the
JayAPI::PropertiesFetcher
class. Instead of receiving all the parameters to initialize an index internally it now takes an already initializedJayAPI::Elasticsearch::Index
object.
- Fixed a bug in the
Elasticsearch::Index
class which caused the error message to be empty when an error occurred during push and the error details were not found in the first element of the response body.
- Added the
json
as subcommand to the CLI'simport
command.
- The
TestDataCollector
class will now push the remote URL of the repository from which the tests are running to Elasticsearch.
- Added the
TimestampHandler
class for the Parsers. - Added the
JSON::Parser
class. - Added a
#to_yaml
method toConfiguration
, which allows to print the entire configuration in a human readable YAML format. - If a search query causes an error, the corrupt query will be logged.
- Improved the timestamp handling in the JUnit parser. The parser is now capable
of parsing JUnit files in which the
timestamp
attribute is given in thetestsuite
tag, thetestcase
tag or both.
- Added the possibility to use the
-m
command line switch when importing JUnit tests to provide test meta-data. The meta-data is expected to be stored in JSON files following ESR Labs's custom format for test meta-data.
- Added functionality to merge, with specific rules,
JayAPI::Configuration
objects.
- Fixed a bug in the methods
by_build_job
andby_software_version
in thePropertiesFetcher
class that caused the wrong data to be fetched from Elasticsearch for certain queries.
- Adapted the JUnit and CDash parsers to make them take the Test Environment from the Configuration instead of taking it from a hardcoded set of environment variables (backwards compatible).
- Added a
deep_to_h
method to theJayAPI::Configuration
class. - Added a
with_indifferent_access
method to theJayAPI::Configuration
class.
- Extended the CDash parser implementation to allow it to use the Dredge gem to extract meta-data from the source files and attach it to the test results before pushing them to Elasticsearch.
- Removed the
jira-ruby
runtime dependency.
- Updated activesupport to version 6.x
- Changed the minimum Ruby version required by the gem to 2.5.0 (because of the
activesupport
gem update).
- Added a public Repository#open_or_clone! method.
- Added the JayAPI::Git::Repository#remote_url method.
- Updated the
elasticsearch
gem to version 7.9.0 - Changed the minimum Ruby version required by the gem to 2.4.0 (because of the
elasticsearch
gem update).
- Added the
cdash
subcommand to theimport
command that allows to parse CDash XML files and import them to Elasticsearch.
- Changed the
QueryString
clause to allow the user to omit thefields
parameter.
- Added the
Exists
query clause to Elasticsearch'sQueryBuilder
- Added the
Term
query clause to Elasticsearch'sQueryBuilder
- Added the
Range
query clause to Elasticsearch'sQueryBuilder
- Moved the functions
document
,each
, andinitialize
to the base classParsers::Parser
so that both,CDash::Parser
andJUnit::Parser
can also use them. - Changed the attribute
version_array
toexistent_versions
for readability purposes for the classPriorVersionFetcherBase
.
- Added a new parser
CDash::Parser
that is able to parse XML files in CDash format. - Added multiple classes
CDash::TestObject
,CDash::Testing
that are able to parse specific CDash XML tags and extract information from them. - Added a class
CDash::TestSuite
that is responsible for collectingCDash::Test
objects and compute various information using those.
PriorVesionFetcherBase
used the functionquery
fromQueryBuilder
which has changed its meaning. Fixed the issue by usingto_query
instead.
- Added the
before
method to thePropertiesFetcher
class.
- Changed the
after
method of thePropertiesFetcher
class to use>
instead of>=
when composing the query string (mainly to keep the two methods consistent).
- Allows the
after
method from thePropertiesFetcher
to takeString
s as arguments. The string should of course be in format expected by Elasticsearch.
- Added the
after
method to thePropertiesFetcher
to fetch only properties that were pushed after the given timestamp.
- Added authentication params to the
Elasticsearch::Index
class constructor. It is now possible to specify authentication credentials for the connection to the Elasticsearch Clusters. The change is backwards compatible, if the cluster has no authentication these parameters can be omitted altogether.
- Refactored the
PropertiesFetcher
class to make it more flexible. The Class now allows the combination of multiple conditions and allows the caller to decide if it wants the first, the last or all the Build Properties records.
- Added a new class
PriorVersionFetcherBase
which is responsible for fetching the previous software version from the one provided. For that it checks all the versions on Jay to return a prior version that actually exists. - Added the
MatchPhrase
query clause.
(yanked)
- Changed the name of the file that contains the
PropertiesFetcher
class to match the name of the class. - Changed the name of the
index
parameter of thePropertiesFetcher
class's constructor toindex_name
to make it consistent with the same parameter in theElasticsearch::Index
class. - Changed the way the
QueryBuilder
for Elasticsearch handles query clauses. These are now handled by theQueryClauses
class, which allows for multiple types of query clauses. This also makes the API exposed by theQueryBuilder
class backwards incompatible.
- Modified the J-Unit parser to attach the build properties
version_code
andversion_name
to each test suite.
- Added the
--version
switch to the CLI.
- Expanded Jay API's J-Unit parser to make it work with the J-Unit files produced
by Gradle (this requires the build job name and number, the project name and
the version code to be provided via different means). Environment variables
and
build.proprties
files are supported for this purpose.
- Removed all the
JayAPI::JIRA
modules and tests due to their migration to theJIRATamer
gem. - Change the way the
JayAPI::IDBuilder
class generates short IDs for test cases. Instead of removing all special characters from the string before computing the hash hyphens are now kept. This produces different Short IDs for test cases whose names differ only by a minus sign.
- Functionality to access the Elasticsearch Scroll API. This allows to surpass the allowed query limit of data (default 10k docs).
- Added the Aggregations feature to the Elasticsearch classes. This means:
- The
QueryBuilder
class can now take aggregations and add them to the composed query. - The
QueryResults
object is now aware of the possibility that a Query result may contain anaggregations
key and will provide direct access to it. (The implementation here is very crude). - Added the
Aggregations
class to manipulate aggregations when working with aQueryBuilder
.
- The
- Added the
PropertiesFetcher
class that is responsible for fetching build properties from JAY when provided with proper configuration.
- Added the
remotes
method to theJayAPI::Git::Repository
class. The method returns the list of Remote Repositories linked to the repository. - Added the
GitilesHelper
module. A module with methods to handle Gerrit's Gitiles URLs.
- A bug in the
JIRA::CachedIssueBrowser
. When checking for known JIRA issues for a specific test case id, it would check whether the string value of the issue inside the ticket includes the specified test case id with 'include?' method. This would only be the case when they are identical. For a lot of cases, the test case id specified in a JIRA ticket is shorter and more general, so that it could encompass many different test cases that share a common namespace. In those cases, however, the current implementation would discard the relavant jira tickets, because their annotated test case ids are shorter than the specified one, and hence could not include it. - Another issue in
JIRA::CachedIssueBrowser
. The class would split test case ids inside a JIRA issue by using a regular expression. This would generate a list, with different test case ids. However, sometimes empty elements would show up in the list which are now filtered out.
- Added a 'checkout' method to the JayAPI::Git::Repository class.
-
Added the
JIRA::CachedIssueBrowser
class. This class is a drop-in replacement for the standardJIRA::IssueBrowser
class. The major difference is that this class fetches all the issues and builds a local cache with them, then it performs a local search on the cache to find the issues related to a given Test Case ID.This is needed when a big number of failed test cases are expected. Querying JIRA for each failed test case takes a huge amount of time whereas searching the local cache is a lot faster, albeit it requires more memory and processing power on the machine executing the search.
- Fixed a bug in the
JIRA::IssueBrowser
class that caused the class to always use the fieldTestcase_ID
without any regard for the given field name. This means that with a different field name issues would be found but never returned because they would be discarded by thefilter_issues
method.
- Updates the
thor
gem to Version 1.1.0. The changes betweenthor
0.x and 1.x do not affectjay_api
directly as it is already compliant. But other gems might need to add theexit_on_failure?
method to their CLI classes. - Documents the possibility of passing
nil
on theurl
parameter of theRepository
class' constructor. Adjusts the class to react correctly under such circumstances. Tests were also added to verify the behaviour.
- Added the
TestDataCollector
class. This class is a Formatter forRSpec
that allows the pushing of test results to Jay's Elasticsearch backend. Its main purpose is to push the test results and in particular the annotated requirements for projects whose tests are running on pureRSpec
(i.e. not inside Elite).
- Moved
rspec
from the development to the runtime dependencies. This is needed because RSpec is now being included directly by one of the classes exposed by the API.
- Removed the security feature for the ERB evaluation on configuration files.
This was causing a
SecurityError
to be raised even when the statements inside the files were perfectly safe. The feature will be disabled until the root cause for the problem can be established and addressed.
- Allow configuration files to use ERB, this allows (among other things) the use of environmental variables inside the configuration files.
- Add the
configuration_file
andcheck_configration
methods to theJayAPI::CLI::Base
class. This methods allows the given configuration file to be checked before it is loaded. Only basic checks are performed.
- Added a
version_clause
method to theQueryComposer
class. The method allows subclasses to add a clause to restrict the query results to a particular software version, branch, or in the case of certain OEMs a specific cluster.
JIRA::IssueBrowser
will now catchSocketError
as well.
- Allows the
IssueBrowser
class to receive aHash
of options in addition to aQueryComposer
class. This hash of options is then passed down to the givenQueryComposer
class' constructor during initialization.
Elasticsearch::QueryResults#all
can now be called without a block. In this case the method will return anEnumerator
that can be used to iterate over the whole set of documents. AnEnumerator
is also anEnumerable
so the whole spectrum of collection-based Ruby methods will be available.
- Added a new module to elasticsearch that stores the time format recognized by elasticsearch and provides a function that transforms time into this format.
- Added the
source
method to theJayAPI::Elasticsearch::QueryBuilder
class to allow the user to extract only a subset of the document from Elasticsearch.
- Added the
branches
method to theJayAPI::Git::Repository
class to allow the user to fetch the list of available branches. - Added the
log
method to theJayAPI::Git::Repository
class to allow the user to get the list of commits in the current branch or a given branch. - Added the
add_worktree
method to theJayAPI::Git::Repository
class to allow the user to create worktrees out of a repository. - Added the
worktrees
method to theJayAPI::Git::Repository
class to allow the user to manipulate worktrees, list them, and remove them.
- Changed JIRA's
QueryComposer
class to filter out rejected tickets from the results.
-
Added the
object
method to theJayAPI::Git::Repository
class to allow the user to fetch commit information by providing the commitSHA1
or another Git reference (tag, branch, etc). -
Added the
all
method to theJayAPI::Elasticsearch::QueryResults
class, the method allows the caller to easily iterate over all the records, not only the ones in the currentQueryResults
objects but all the available records until the whole result set has been traversed.This is a very common task, therefore the code was abstracted to the API.
- Fixed a bug in the
JayAPI::Elasticsearch::QueryBuilder
class that was causing strings to be improperly escaped when building the query. The quotation marks don't need to be escaped twice because this is being handled by the JSON library when converting the queryHash
to a JSON string.
- Changed the
JayAPI::Configuration
class to allow it to parse Hashes that are nested inside arrays.
- Added the necessary logic to generate the Short ID (
id
) and the Secure ID (id_secure
) for the Imported JUnit Test Cases
- Modifies the JUnit Parser it now receives a
project_name
, it uses it to generate the Test Case ID.
- Added the
collapse
method to theElasticsearch::QueryBuilder
class. - Added some convenient methods to the
Elasticsearch::QueryResults
class:first
,last
,any?
- Moved the
empty?
method on theElasticsearch::QueryResults
class to the delegator.
- Added the
RequirementsExtractor
class for the JUnit Parser. The Class is able to parse the output of the Test Suites and extract the requirements for each of the Test Cases from it. - Added the
IDBuilder
class to generate Short and Secure IDs for the Test Cases.
- Fixed a dependency issue with the
Ox
gem. The gemspec was requesting the Gem on version >= 2.13.2 which was not really required and was causing issues when trying to use thejay_api
Gem inside Elise.
- Fix a bug causing a
NoMethodError
when calling thenext_batch
method in theQueryResults
class. The error was occurring because thesearch
method in theIndex
class is returning an instance of theQueryResults
class instead of a simple Hash. This change is backwards incompatible because the method no longer updates the state of the current instance but returns a different instance instead.
- Added the Import/Parse feature for J-Unit files:
- CLI for importing J-Unit files.
- Parsing and importing logic.
- Locked the version of the elasticsearch gem to be less than
7.6.0
(because that version requires Ruby >= 2.4.0) - Fixed a bug that caused the Repository class to clone the repositories in the wrong location (the name of the repository was being added twice to the path because of the way the git gem works).
- Made the second parameter for
JayAPI::Errors::ConfigurationError
optional.
- Added the Git::Repository class which features methods to perform lazy cloning and fetching of git repositories and to update they as needed.
- Added Unit Tests for the
fetch_ticket
method.
- Changed the
fetch_ticket
method in theJayAPI::JIRA::IssueBrowser
class to raise an error when an invalid JIRA Ticket ID is given.
- Added the IssueBrowser and QueryComposer classes for JIRA, they provide functionality to search for issues by TestCase ID or to fetch an issue by its ID.
- Added the Elasticsearch related classes. They provide access to Elastic Search functions and provide an easy interface to query, search and insert records into an Elasticsearch Index