Skip to content

Only yield valid references in ReferenceFilter.references_in

Douwe Maan requested to merge only-yield-valid-reference-matches into master

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/27648 as seen below:

Screen_Shot_2017-02-16_at_14.09.36

Inside IssueReferenceFilter, project_from_ref_cached(perfectly_valid_project_path) resulted in project_refs_cache[perfectly_valid_project_path] being set to nil if an invalid (IID < 0 || IID > MAX_INT) reference was included, which would affect subsequent filters too, sine they use the same project_refs_cache.

This fixes the issue where AbstractReferenceFilter#references_per_project checks object_class.reference_valid?(symbol), but AbstractReferenceFilter.references_in didn't, which resulted in the incorrect cache set.

Merge request reports

Loading