Skip to content

Add routing to secrets page

Miranda Fluharty requested to merge 424453-tanukey-ui-vue-router into master

What does this MR do and why?

Inside the feature-flagged secrets vue app, this MR sets up vue-router routing and breadcrumbs (and adds some mock data so that we can navigate around for testing).

Screenshots or screen recordings

Before After
Screen_Recording_2023-11-06_at_14.48.14 Screen_Recording_2023-11-06_at_14.46.38
route expected view/breadcrumbs
/-/secrets/ Screenshot_2023-11-06_at_15.35.58
/-/secrets/new Screenshot_2023-11-06_at_15.36.06
/-/secrets/:key/details Screenshot_2023-11-06_at_15.37.48
/-/secrets/:key/auditlog Screenshot_2023-11-06_at_15.37.53
/-/secrets/:key/edit Screenshot_2023-11-06_at_15.37.59

How to set up and validate locally

Check out the branch and enable the feature flag for a root group:

git checkout 424453-tanukey-ui-vue-router
echo "Feature.enable(:ci_tanukey_ui, Group.find_by_full_path(\"gitlab-org\"))" | gdk rails c
  1. have developer-or-higher access to a root group and enable the feature flag for that group
    • note: make sure this is a root group - enabling the flag for a subgroup will have no effect because we check for the flag on the project.group.root_ancestor/project.root_ancestor
  2. navigate to the root group, for example: http://gdk.test:3000/gitlab-org
  3. insert /groups into the url and add /-/secrets onto the end of the url: http://gdk.test:3000/groups/gitlab-org/-/secrets
  4. click around and verify that the links and buttons do what you would expect (and that the breadcrumbs are correct)
  5. all descendants of the group for which the feature flag is enabled should show secrets pages - navigate to any subgroup or project that belongs to the group (that you also have developer-or-higher access to) and repeat the process:
    1. navigate to some project: http://gdk.test:3000/gitlab-org/gitlab-test
    2. add /-/secrets onto the end of the url: http://gdk.test:3000/gitlab-org/gitlab-test/-/secrets
    3. click around and verify that the links and buttons do what you would expect (and that the breadcrumbs are correct)
    4. navigate to some subgroup: http://gdk.test:3000/gitlab-org/gitlab-test/some-subgroup
    5. insert /groups into the url and add /-/secrets onto the end of the url: http://gdk.test:3000/groups/gitlab-org/gitlab-test/some-subgroup/-/secrets
    6. click around and verify that the links and buttons do what you would expect (and that the breadcrumbs are correct)

to run tests:

yarn install
yarn jest ci/secrets

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #424453 (closed)

Edited by Miranda Fluharty

Merge request reports