Project milestone references in Epics can cause 500s
When Markdown in an Epic title / description / comment has a project milestone reference and a group milestone reference, the Epic / comment cannot be saved.
Steps to reproduce
-
Type this in the description:
%"Group milestone" issue-reproduce/issue-reproduce%1
-
Click on Preview. It will fail with an error.
-
Saving the epic also fails
Stacktrace
lib/banzai/filter/references/milestone_reference_filter.rb:128:in `group_and_ancestors_ids',
lib/banzai/filter/references/milestone_reference_filter.rb:120:in `block in milestone_finder_params',
lib/banzai/filter/references/milestone_reference_filter.rb:115:in `tap',
lib/banzai/filter/references/milestone_reference_filter.rb:115:in `milestone_finder_params',
lib/banzai/filter/references/milestone_reference_filter.rb:109:in `find_milestones',
lib/banzai/filter/references/milestone_reference_filter.rb:23:in `parent_records',
lib/banzai/filter/references/reference_cache.rb:89:in `block in load_records_per_parent',
lib/banzai/filter/references/reference_cache.rb:86:in `each',
lib/banzai/filter/references/reference_cache.rb:86:in `load_records_per_parent',
lib/banzai/filter/references/reference_cache.rb:18:in `load_reference_cache',
lib/banzai/filter/references/abstract_reference_filter.rb:121:in `call',
lib/banzai/filter/references/reference_filter.rb:40:in `block in call_and_update_nodes',
lib/banzai/filter/references/reference_filter.rb:281:in `with_update_nodes',
lib/banzai/filter/references/reference_filter.rb:40:in `call_and_update_nodes',
lib/banzai/filter/references/reference_filter.rb:28:in `call',
lib/banzai/pipeline/base_pipeline.rb:23:in `block (2 levels) in singleton class',
lib/banzai/renderer.rb:130:in `render_result',
lib/banzai/renderer.rb:164:in `block in cacheless_render',
lib/gitlab/metrics.rb:79:in `measure',
lib/banzai/renderer.rb:163:in `cacheless_render',
lib/banzai/renderer.rb:30:in `render',
lib/banzai.rb:16:in `render',
app/helpers/markup_helper.rb:262:in `markdown_unsafe',
app/helpers/markup_helper.rb:105:in `markdown',
app/controllers/concerns/preview_markdown.rb:11:in `preview_markdown',
ee/lib/gitlab/ip_address_state.rb:10:in `with',
ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address',
app/controllers/application_controller.rb:489:in `set_current_admin',
lib/gitlab/session.rb:11:in `with_session',
app/controllers/application_controller.rb:480:in `set_session_storage',
lib/gitlab/i18n.rb:105:in `with_locale',
lib/gitlab/i18n.rb:111:in `with_user_locale',
app/controllers/application_controller.rb:474:in `set_locale',
app/controllers/application_controller.rb:468:in `set_current_context',
ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase',
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call',
lib/gitlab/middleware/rails_queue_duration.rb:33:in `call',
lib/gitlab/middleware/speedscope.rb:13:in `call',
lib/gitlab/request_profiler/middleware.rb:17:in `call',
lib/gitlab/database/load_balancing/rack_middleware.rb:38:in `call',
lib/gitlab/metrics/rack_middleware.rb:16:in `block in call',
lib/gitlab/metrics/web_transaction.rb:21:in `run',
lib/gitlab/metrics/rack_middleware.rb:16:in `call',
lib/gitlab/jira/middleware.rb:19:in `call',
lib/gitlab/middleware/go.rb:20:in `call',
lib/gitlab/etag_caching/middleware.rb:21:in `call',
lib/gitlab/middleware/multipart.rb:172:in `call',
lib/gitlab/middleware/read_only/controller.rb:50:in `call',
lib/gitlab/middleware/read_only.rb:18:in `call',
lib/gitlab/middleware/same_site_cookies.rb:27:in `call',
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call',
lib/gitlab/middleware/basic_health_check.rb:25:in `call',
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call',
lib/gitlab/middleware/request_context.rb:21:in `call',
config/initializers/fix_local_cache_middleware.rb:11:in `call',
lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call',
lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call',
lib/gitlab/metrics/requests_rack_middleware.rb:75:in `call',
lib/gitlab/middleware/release_env.rb:12:in `call'