Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #33418
Closed
Open
Issue created Jun 07, 2017 by Sid Sijbrandij@sytsesDeveloper

Link directly to changed pages in Review App from MR Widget

Problem to solve

The default review app link is often not handy as it is not context aware.

Further details

Usecase: When I write a blog post I want to preview the blog post, not the whole website

Proposal

As a user, when I change one page on the static website, the review app should link to that page instead of (or in addition to) the root of the server.

Look at the mapped paths, and only show if it ends in no extension (like our blogpost) or .html. That would take care of html.md.erb. Images will of course always keep their extension, so would be ignored. It would pretty accurately identify web pages.

This could look something like this:

image

Solution

  • Split button dropdown
    • Dropdown menu options trigger in two clicks (click 1: open dropdown, click 2: select action)
    • Default option split dropdown always defaults to the default environment url and states View app as it already does
      • changed url: http://www.example.com/blob/categories
      • changed url - no host: /blog/categories
/blog/categories
http://www.example.com/blob/categories
  • Dropdown features changed url and changed url - no host for relevant changes
  • Search included for if there are many relevant changes
  • Deleted pages are not shown
  • Use one of the predefined dropdown widths that comes closest to 560px
  • Urls should be ellipsed (at the beginning) when too long instead of wrapping

Artboard_2

Artboard

Note: The dropdown width should match what is detailed in the specs (400px): https://gitlab-org.gitlab.io/gitlab-design/hosted/design-gitlab-specs/dropdown-spec-previews/

backend changes

As decided in https://gitlab.com/gitlab-org/release/framework/issues/23 this feature will be developed under a feature flag named ci_environments_status_changes.

Today the deployment widget is populated from the following API

# GET http://localhost:3000/root/test-pages/merge_requests/5/ci_environments_status
[
  {
    "id": 40,
    "name": "review/root-master-patch-91341",
    "url": "/root/test-pages/environments/40",
    "metrics_url": null,
    "metrics_monitoring_url": "/root/test-pages/environments/40/metrics",
    "stop_url": "/root/test-pages/environments/40/stop",
    "external_url": "http://root-master-patch-91341.volatile-watch.surge.sh",
    "external_url_formatted": "root-master-patch-91341.volatile-watch.surge.sh",
    "deployed_at": "2018-10-12T13:08:21.839Z",
    "deployed_at_formatted": "Oct 12, 2018 1:08pm"
  }
]

We will add a new key changed: an array with path and external_url of the affected pages. This includes every file added, moved or modified that has a relative path, after the URL transformation, that has no extension or .html extension.

# GET http://localhost:3000/root/test-pages/merge_requests/5/ci_environments_status
[
  {
    "id": 40,
    "name": "review/root-master-patch-91341",
    "url": "/root/test-pages/environments/40",
    "metrics_url": null,
    "metrics_monitoring_url": "/root/test-pages/environments/40/metrics",
    "stop_url": "/root/test-pages/environments/40/stop",
    "external_url": "http://root-master-patch-91341.volatile-watch.surge.sh",
    "external_url_formatted": "root-master-patch-91341.volatile-watch.surge.sh",
    "deployed_at": "2018-10-12T13:08:21.839Z",
    "deployed_at_formatted": "Oct 12, 2018 1:08pm",
    "changes": [
      {
        path: "index.html",
        external_url: "http://root-master-patch-91341.volatile-watch.surge.sh/index.html"
      },
      {
        path: "imgs/gallery.html",
        external_url: "http://root-master-patch-91341.volatile-watch.surge.sh/imgs/gallery.html"
      },
      {
        path: "about/",
        external_url: "http://root-master-patch-91341.volatile-watch.surge.sh/about/"
      }
    ]
  }
]

What does success look like, and how can we measure that?

The user is able to directly open the url with its contents changed by the current merge request.

Links / references

Edited Oct 30, 2018 by Jason Yavorska
Assignee
Assign to
Time tracking