Loading
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]toconsole.errorand Vue 3 sends it toconsole.warn. The bug exists in both builds. Only the visibility differs. - One entry is Vue 3 only because
@vue/apollo-optionlogs an extraGraphQL execution errors for subscriptionline for the sameUnauthorized subscriptionerror 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
syncWithwriting to a getter: see References
What
app/helpers/breadcrumbs_helper.rb:breadcrumbs_as_jsoncasts the text to a String. Two views pass a record id (add_to_breadcrumbs @broadcast_message.id,breadcrumb_title @migration.id), which reachedGlBreadcrumbItemas a Number.registry_breadcrumb.vue: the details crumb casts$route.params.idto a String. The packages and container registry lists navigate with numeric params, andvue-routerkeeps the type.integrations/base/irker.rb: the port placeholder is the String'6659'.DynamicFieldandGlFormInputexpect a String.rapid_diffs/app/discussions/note_form.vue:noteIdaccepts[String, Number]. Draft notes come from REST with a numeric id.new_project_url_select.vue:dropdownTextreturns''instead ofnullwhile a preselected namespace has no path yet, whichGlTruncaterejected.
Not fixed here
GlBreadcrumbreading 'clientWidth'(Vue 2 only, service account specs). The bug is in@gitlab/ui: the asyncitemswatcher measures$refs.dropdownafter 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 subscriptionand the Vue 3 onlyGraphQL execution errors for subscriptionlines inee/spec/features/merge_request/user_sees_approve_via_custom_role_spec.rb. Locally, with logging inSubscriptions::BaseSubscription, two full runs of the file made 33 authorizations and all passed. In CI it appeared in one of three runs, always in theprevents approvingexample that runs right afterallows 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
bin/rspec spec/helpers/breadcrumbs_helper_spec.rb spec/models/integrations/irker_spec.rbyarn 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- On the branch of !256639 (merged) with this commit on top, remove the
Invalid propentries fortext,placeholderandnoteIdand 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
- Follow-up to !256639 (merged), whose allowlist scopes these entries to one Vue version
- Sibling MRs from the same analysis: API fuzzing !257065 (merged), Pinia !257066 (closed)
- Reveal runs that produced the data: !255199 (closed), pipelines https://gitlab.com/gitlab-org/gitlab/-/pipelines/2867469601 and https://gitlab.com/gitlab-org/gitlab/-/pipelines/2872215632
- Catalogue of the original console errors: #628901
- GitLab UI breadcrumb bug, not fixed here: gitlab-org/gitlab-services/design.gitlab.com#3650 (closed)
- Vue 3 migration (Code Review) epic: gitlab-org#23167 (closed)
Edited by Miguel Rincon