Class: Gitlab::Ci::Build::Rules::Rule::Clause::Changes
- Inherits:
-
Gitlab::Ci::Build::Rules::Rule::Clause
- Object
- Gitlab::Ci::Build::Rules::Rule::Clause
- Gitlab::Ci::Build::Rules::Rule::Clause::Changes
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/build/rules/rule/clause/changes.rb
Constant Summary collapse
- CHANGES_MAX_PATTERN_COMPARISONS =
The maximum number of patterned glob comparisons that will be performed before the rule assumes that it has a match
50_000
Constants inherited from Gitlab::Ci::Build::Rules::Rule::Clause
ParseError, UnknownClauseError
Instance Method Summary collapse
-
#initialize(globs) ⇒ Changes
constructor
A new instance of Changes.
- #satisfied_by?(pipeline, context) ⇒ Boolean
Methods inherited from Gitlab::Ci::Build::Rules::Rule::Clause
Constructor Details
#initialize(globs) ⇒ Changes
Returns a new instance of Changes.
13 14 15 |
# File 'lib/gitlab/ci/build/rules/rule/clause/changes.rb', line 13 def initialize(globs) @globs = globs end |
Instance Method Details
#satisfied_by?(pipeline, context) ⇒ Boolean
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/gitlab/ci/build/rules/rule/clause/changes.rb', line 17 def satisfied_by?(pipeline, context) compare_to_sha = find_compare_to_sha(pipeline, context) modified_paths = find_modified_paths(pipeline, compare_to_sha) return true unless modified_paths return false if modified_paths.empty? = (context).uniq return false if .empty? comparison_cache_key = comparison_key(pipeline, , compare_to_sha) changes_match?(modified_paths, , context, comparison_cache_key) end |