Opened 9 years ago

Closed 9 years ago

#16 closed task (fixed)

Establish HTTP redirect to GitLab for trac.common-lisp.net/<project>/browser

Reported by: ehuelsmann Owned by: ehuelsmann
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:
Parent Tickets: 12

Description

This ticket requires to identify

  1. the list of affected projects
  2. the url structure for the redirection

Change History (12)

comment:1 Changed 9 years ago by ehuelsmann

The list of affected projects:

ehuelsmann@lisp:~$ grep -E 'repository_type[[:space:]]*=[[:space:]]*git' /project/*/trac/conf/trac.ini
/project/clfswm/trac/conf/trac.ini:repository_type = git
/project/cmucl/trac/conf/trac.ini:repository_type = git
/project/oct/trac/conf/trac.ini:repository_type = git
/project/sheeple/trac/conf/trac.ini:repository_type = git

Conclusion: only 4 trac projects are affected by their repositories moving to GitLab?. All of these projects have their repository directory in their public_html folder, so, these repositories *will* in fact be moved to GitLab? and published through the repository browser there.

Evidence:

ehuelsmann@lisp:~$ grep 'repository_dir' $(grep -E -l 'repository_type[[:space:]]*=[[:space:]]*git' /project/*/trac/conf/trac.ini)
/project/clfswm/trac/conf/trac.ini:repository_dir = /project/clfswm/public_html/git/clfswm.git
/project/cmucl/trac/conf/trac.ini:repository_dir = /project/cmucl/public_html/git/cmucl.git
/project/oct/trac/conf/trac.ini:repository_dir = /project/oct/public_html/git/oct.git
/project/sheeple/trac/conf/trac.ini:repository_dir = /project/sheeple/public_html/git/sheeple.git

comment:2 Changed 9 years ago by ehuelsmann

Priority remains 'major', since among the projects listed, there are the cmucl and oct repositories which are used by one of the most active users that *I* know of (Raymond Toy).

comment:3 Changed 9 years ago by ehuelsmann

We need to understand the Trac URL structure for the following scenarios:

  1. Browsing HEAD of the default branch
  2. Browsing HEAD of a named branch
  3. Browsing a specific commit as a uni-diff (full commit)
  4. Browsing a specific commit as a uni-diff (single file within commit)
  5. Browsing the 2nd to 4th item with blamed content
  6. Browsing the 2nd to 4th item with raw content

comment:4 Changed 9 years ago by ehuelsmann

The Trac URL structure houses a problem: the URL structure for tree browsing is https://trac.common-lisp.net/<project>/browser/<repository-without-.git-extension-if-not-default>/<within-repo-path>

E.g.

URLs for directory and file content are the same (which poses an issue, because the receiver distinguishes between directory (tree) and file (blob) content browsing).

comment:5 Changed 9 years ago by ehuelsmann

Trac URL structure investigation:

1. Browsing HEAD of default branch Uses the structure described in comment 4
2. Browsing HEAD of a named branch Transforms the branch name to a commit hash and browses that
3. Browsing a specific commit as a uni-diff (full commit) https://trac.common-lisp.net/cmucl/changeset/<commit-hash>/<repository-if-not-default>
4. Browsing a specific commit as a uni-diff (single file within commit) https://trac.common-lisp.net/cmucl/changeset/<commit-hash>/<repository-if-not-default>/<within-repo-path>
5. Browsing the 2nd to 4th item with blamed content adds 'annotate=blame' query parameter
6. Browsing the 2nd to 4th item with raw content https://trac.common-lisp.net/<project>/export/<commit-hash>/<repository-if-not-default>/<within-repo-path>

comment:6 Changed 9 years ago by ehuelsmann

Ok. More investigation: out of the 4 projects, only 1 uses a secondary repository (cmucl has the cmucl-www repository as its secondary).

comment:7 Changed 9 years ago by ehuelsmann

More Trac URL structure:

7. Revision log (for a path) https://trac.common-lisp.net/<project>/log/<repository-if-not-default>/<within-repo-path>
8. Raw unidiff Adds 'format=diff' at the end of a changeset URL

comment:8 Changed 9 years ago by ehuelsmann

This needs a rewritemap, implemented as:

   RewriteMap tracmap prg:/usr/local/bin/trac-rewritemap

And the following rewrite rule:

   RewriteRule /(cmucl|oct|sheeple|clfswm)/browser/(.*) ${tracmap:$2} 

comment:9 Changed 9 years ago by mevenson

Owner: changed from somebody to mevenson

comment:10 Changed 9 years ago by mevenson

Owner: changed from mevenson to ehuelsmann

comment:11 Changed 9 years ago by ehuelsmann

Implemented 'tracgit-rewritemap'; can be found in /home/ehuelsmann/clo-software. The URL structure is a bit different from what I expected; meaning that the rewrite rule should become:

RewriteRule  /(cmucl|oct|sheeple|clfswm)/(browser|export)/(.*) ${tracmap:$1?$2?$3}

comment:12 Changed 9 years ago by ehuelsmann

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.