Fix prop type warnings that only Vue 2 feature specs report

Why

!256639 (merged) makes feature specs fail on unexpected browser console errors. Its allowlist has nine entries that only one Vue version logs. Each such entry is a place where the Vue 2 and the Vue 3 build of a page do not behave the same, so they are worth understanding before the migration flips more feature flags.

Every one of them was traced. The result:

  • Eight entries are Vue 2 only because Vue 2 sends [Vue warn] to console.error and Vue 3 sends it to console.warn. The bug exists in both builds. Only the visibility differs.
  • One entry is Vue 3 only because @vue/apollo-option logs an extra GraphQL execution errors for subscription line for the same Unauthorized subscription error that the Vue 2 build also logs. The error itself is not Vue related. See "Not fixed here" below.

The fixes are split in three MRs. This one holds the four prop type warnings. The other two:

  • API fuzzing configuration 500 and unguarded form: see References
  • Pinia syncWith writing to a getter: see References

What

  • app/helpers/breadcrumbs_helper.rb: breadcrumbs_as_json casts the text to a String. Two views pass a record id (add_to_breadcrumbs @broadcast_message.id, breadcrumb_title @migration.id), which reached GlBreadcrumbItem as a Number.
  • registry_breadcrumb.vue: the details crumb casts $route.params.id to a String. The packages and container registry lists navigate with numeric params, and vue-router keeps the type.
  • integrations/base/irker.rb: the port placeholder is the String '6659'. DynamicField and GlFormInput expect a String.
  • rapid_diffs/app/discussions/note_form.vue: noteId accepts [String, Number]. Draft notes come from REST with a numeric id.
  • new_project_url_select.vue: dropdownText returns '' instead of null while a preselected namespace has no path yet, which GlTruncate rejected.

Not fixed here

  • GlBreadcrumb reading 'clientWidth' (Vue 2 only, service account specs). The bug is in @gitlab/ui: the async items watcher measures $refs.dropdown after the component unmounted. The Vue 3 build does not hit it. Tracked in gitlab-org/gitlab-services/design.gitlab.com#3650 (closed), needs a GitLab UI fix and a bump.
  • Unauthorized subscription and the Vue 3 only GraphQL execution errors for subscription lines in ee/spec/features/merge_request/user_sees_approve_via_custom_role_spec.rb. Locally, with logging in Subscriptions::BaseSubscription, two full runs of the file made 33 authorizations and all passed. In CI it appeared in one of three runs, always in the prevents approving example that runs right after allows approving and revoking approval. The revoke click fires a subscription trigger that reaches the still-open page after the next example changed the role. This is a test-ordering artefact, not a Vue difference, and not reproduced locally.

How to verify

  1. bin/rspec spec/helpers/breadcrumbs_helper_spec.rb spec/models/integrations/irker_spec.rb
  2. yarn jest spec/frontend/projects/new/components/new_project_url_select_spec.js spec/frontend/rapid_diffs/app/discussions/note_form_spec.js spec/frontend/packages_and_registries/shared/components/registry_breadcrumb_spec.js
  3. On the branch of !256639 (merged) with this commit on top, remove the Invalid prop entries for text, placeholder and noteId and run their spec files. They pass with no console output.

Once this merges, the matching entries can be removed from spec/support/browser_console_allowlist.yml in !256639 (merged).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

References

🤖 Generated with Claude Code

Edited by Miguel Rincon

Merge request reports

Loading
Loading