Child pages
  • Discard profiles concept in SVN repository
Skip to end of metadata
Go to start of metadata

In-Portal repository has following structure:

|-- in-portal
|   |-- branches
|   |-- releases
|   |-- trunk
|-- modules
|   |-- module-name1
|   |   |-- branches
|   |   |-- releases
|   |   |-- trunk
|   |-- ...
|-- profiles
|   |-- profile-name1
|   |   |-- branches
|   |   |-- releases
|   |   |-- trunk
|   |-- ...
|-- themes
|   |-- theme-name1
|   |   |-- branches
|   |   |-- releases
|   |   |-- trunk
|   |-- ...

So there is:

  • single "in-portal" folder
  • a folder per module
  • a folder per profile
  • a folder per theme

However during development having just In-Portal SVN checkout isn't enough. Usually there needs to be a combination of existing modules & themes checked out as well so the changes can be properly tested. To automate this currently we employ concept of "profiles". Basically profile is an empty folder where different modules are pulled in via "svn:externals" property on root folder of that profile. Such properly might look like that:

# in-portal own folders
^/in-portal/branches/5.2.x/admin admin
^/in-portal/branches/5.2.x/core core
^/in-portal/branches/5.2.x/system system
^/in-portal/branches/5.2.x/tools tools
 
# modules
^/modules/in-link/branches/5.2.x modules/in-link
^/modules/in-news/branches/5.2.x modules/in-news
^/modules/in-bulletin/branches/5.2.x modules/in-bulletin
^/modules/custom/branches/1.2.x modules/custom


# themes
^/themes/default/branches/5.2.x themes/default
^/themes/simple/branches/1.2.x themes/simple
^/themes/advanced/branches/1.2.x themes/advanced


# in-portal files in root folder
^/in-portal/branches/5.2.x/COPYRIGHT COPYRIGHT
^/in-portal/branches/5.2.x/CREDITS CREDITS
^/in-portal/branches/5.2.x/INSTALL INSTALL
^/in-portal/branches/5.2.x/LICENSE LICENSE
^/in-portal/branches/5.2.x/LICENSES LICENSES
^/in-portal/branches/5.2.x/README README
^/in-portal/branches/5.2.x/index.php index.php
^/in-portal/branches/5.2.x/robots.txt robots.txt
^/in-portal/branches/5.2.x/.htaccess .htaccess
^/in-portal/branches/5.2.x/favicon.ico favicon.ico

As you can see it's pretty complex to be manageable by hand and that's why we have a script to generate that "svn:externals" property in each release.

What I propose

  1. remove the profiles concept from repository
  2. create the "configure_profile.php" file within "tools" folder that accepts single argument "profile name"

Script will set "svn:externals" property of current SVN working copy to this:

# modules
^/modules/in-link/branches/5.2.x modules/in-link
^/modules/in-news/branches/5.2.x modules/in-news
^/modules/in-bulletin/branches/5.2.x modules/in-bulletin
^/modules/custom/branches/1.2.x modules/custom
 
# themes
^/themes/default/branches/5.2.x themes/default
^/themes/simple/branches/1.2.x themes/simple
^/themes/advanced/branches/1.2.x themes/advanced

How this will work

  1. checkout main in-portal folder from svn://source.in-portal.org/in-portal/branches/5.2.x instead of checking out profile-name from svn://source.in-portal.org/profiles/profile-name/branches/5.2.x
  2. run "php /tools/configure_profile.php profile-name", which will set needed "svn:externals" property
  3. run "svn update" once to checkout modules/themes that were added

The same script, that currently handles "svn:externals" property generation for profiles needs to be updated to generate the "configure_profile.php" file.

More benefits

Since now we checkout main in-portal repository, then it becomes possible to use Phabricator's tool called Arcanist: https://secure.phabricator.com/book/phabricator/article/arcanist/ which is basically a CLI tool for http://qa.in-portal.org/ website to simplify code contribution.

Related Tasks

INP-1392 - Getting issue details... STATUS

2 Comments

  1. Maintaining content of configure_profile.sh script will require extra programming and that file will have different content for every branch/release as well, so this doesn't sound very good.

    Instead we might:

    1. create http://www.in-portal.com/rest/profiles.json?name=in-portal.community&version=5.2.x url, which will return profile configuration (excluding parts from "in-portal" module itself) from database without even going to SVN server
    2. the configure_profile.sh script will:
      1. accept 2 arguments:
        1. profile name (required)
        2. profile version (optional)
      2. if profile version isn't given, then do "svn info --xml" and just take last part of working copy checkout url (looks like this for me svn://alex@in-portal.org/in-portal/branches/5.2.x)
      3. make a call to profile configuration url

      4. save it's result to /tmp/configure_profile.txt
      5. run "cd .." to ensure we're in the root of working copy
      6. run "svn propset svn:externals -F /tmp/configure_profile.txt" to change "svn:externals" property
      7. run "svn up" to make sure we get these new files, that we've just specified via externals
      8. run "svn changelist ignore-on-commit . --depth empty" to add the root working copy folder to changelist that will be ignored on commit (at least by TortoiseSVN on Windows)

    If for example we need to change some other property on the root folder of working copy, then we can safely roolback changes made to "svn:externals" property and then after we commit rerun the configure_profile.sh script again.

     

  2. I've committed a change to 5.2.x and 5.3.x branch of each profile, that:

    1. removes all what was in there
    2. adds a README.txt file describing how to perform checkout using new scheme

    This way however yet has In-Portal checked out the old way will automatically see these upgrade instructions next time they do "svn update" command.