Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !1568

Merged
Created Sep 26, 2012 by Administrator@rootOwner

Routing overhaul

  • Overview 4
  • Commits 63
  • Changes 106

Created by: rspeicher

Closes #1507 (closed) and #1452 (closed)

New Routes

Redesigns all routes that work with branch/tag names and file paths:

# /:project_id/blame/*path
#   /gitlabhq/blame/master/app/contexts/base_context.rb
#   /gitlabhq/blame/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/blob/*path
#   /gitlabhq/blob/master/app/contexts/base_context.rb
#   /gitlabhq/blob/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/commit/:id
#   /gitlabhq/commit/caef9ed1121a16ca0cc78715695daaa974271bfd
#
# /:project_id/commits
#
# /:project_id/commits/*path
#   /gitlabhq/commits/master/app/contexts/base_context.rb
#   /gitlabhq/commits/test/branch/name/app/contexts/base_context.rb
#
# /:project_id/tree/*path
#   /gitlabhq/tree/master/app
#   /gitlabhq/tree/test/branch/name/app
#
# /:project_id/compare
#
# /:project_id/compare/:from...:to
#   /gitlabhq/compare/master...stable

It does this by basically allowing anything for the :id parameter on these routes, and uses a special module called ExtractsPaths to separate the branch/tag from the file path.

As a consequence of this, I had to do some hack-ish stuff to still allow the Atom feeds to work. See 33126227, 6b90f36f and 1799cf3b.

"Active Tab" cleanup

Adds a new nav_link helper to the TabHelper module. It's well documented, so have a look. I also added comprehensive Spinach features to ensure that the correct main and sub tabs are marked as active across the various pages (see cada511f).

Misc. Cleanup

  • I replaced all instances of File.join(Rails.root, ...) with Rails.root.join(...).
  • I removed a before_filter called render_full_content that didn't seem to be doing anything.
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/rspeicher/routing_overhaul