How to Clone a New Interop

From OSIS Open Source Identity Systems
Jump to: navigation, search

How to Clone a New Interop

OSIS interops are each given an Identifier of I(x) where (x) is a linearly increasing integer. Only administrators can do this! The process of cloning an interop therefore is expected to be as follows:

  • Create a new Interop Identifier
  • Copy all I(x-1) interop features and tests to the new Interop Namespace
  • Update navigation, etc
  • Make any changes or alterations needed to allow the new interop to improve
  • Make the previous Interop results read-only

Note: The following instructions were created for the clone from I3 to I4; please replace I3 with I(x-1) and I4 with I(x) for future clonings.

Step 1: Create a new Interop Namespace

Edit LocalSettings.php

  1. on the backend, edit /home/osis/web/w/LocalSettings.php and add two new namespaces to the following structure as follows:
Before Addition of I4 Namespace
# -- Custom Namespaces
#    - add to the first array to define a new interop namespace
#    - alter the 2nd array to change the "current" interop
$wgExtraNamespaces = array(
        100 => "I3",
        101 => "I3_Talk",
        102 => "Participants",
        103 => "Participants_Talk",
        );
$wgNamespaceAliases = array(
        'Current' => 100,
        );
$wgNamespacesToBeSearchedDefault += array(
        100               => 1,
        101               => 1,
        102               => 1,
        103               => 1,
        );
After Addition of I4 Namespace
# -- Custom Namespaces
#    - add to the first array to define a new interop namespace
#    - alter the 2nd array to change the "current" interop
$wgExtraNamespaces = array(
        100 => "I3",
        101 => "I3_Talk",
        102 => "Participants",
        103 => "Participants_Talk",
        104 => "I4",
        105 => "I4_Talk",
        );
$wgNamespaceAliases = array(
        'Current' => 104,
        );
$wgNamespacesToBeSearchedDefault += array(
        100               => 1,
        101               => 1,
        102               => 1,
        103               => 1,
        104               => 1,
        105               => 1,
        );

Alter InteropList Template to Contain new Interop Namespace

  • Edit [1] and add the new namespace, separated by a vertical bar from those already present
    • ie: I3 becomes I3|I4

Step 2: Copy I3 data to I4 Namespace

Note: do not migrate Talk pages.

Use Special:Allpages to list all pages in the I3 namespace

  1. Copy the results into a text editor and massage them such that you get one page per line
    1. in vi, you can use this command:  %s/\t/\r/g
  2. Prepend the original namespace in front of every line
    1. in vi, use %s/^/I3:/
  3. Clean up any names that don't need to be copied (administrator's discretion)

Use Special:Export to get a text copy of the I3 Namespace Pages

  1. Open Special:Export
  2. Paste your massaged list of files into the page
  3. Save the resulting file to disk - we'll call the file i3.export.xml
  4. Make SURE you keep your file names in alphabetical order, you'll need it that way in later steps

Replace all instances of I3: to I4: in new pages

  1. edit i3.export.xml and replace I3: with I4: (note the colon is critical)
  2. Every reference to I3 without the colon needs to be managed separately
    1. Any reference to I3 with respect to a maturity_date parameter must be left
    2. I have been changing references to .crds file repositories to say I4, but leaving the reference to the card name alone. I assume that if the card changes for the new interop, that the test case will be edited as the card changes
    3. NOTE: There is a reference to all namespaces in the first 15 or so lines of the file -- make sure you leave those references alone! They look like this:
    <generator>MediaWiki 1.11.1</generator>
    <case>first-letter</case>
      <namespaces>
      <namespace key="-2">Media</namespace>
      <namespace key="-1">Special</namespace>
      <namespace key="0" />
      <namespace key="1">Talk</namespace>
      <namespace key="2">User</namespace>
      <namespace key="3">User talk</namespace>
      <namespace key="4">OSIS Open Source Identity Systems</namespace>
      <namespace key="5">OSIS Open Source Identity Systems talk</namespace>
      <namespace key="6">Image</namespace>
      <namespace key="7">Image talk</namespace>
      <namespace key="8">MediaWiki</namespace>
      <namespace key="9">MediaWiki talk</namespace>
      <namespace key="10">Template</namespace>
      <namespace key="11">Template talk</namespace>
      <namespace key="12">Help</namespace>
      <namespace key="13">Help talk</namespace>
      <namespace key="14">Category</namespace>
      <namespace key="15">Category talk</namespace>
      <namespace key="100">I3</namespace>
      <namespace key="101">I3 Talk</namespace>

Use Special:Import to import the newly massaged pages

  1. Open Special:Import
  2. Browse to i3.export.xml
  3. Start the import
    1. Note, your import may not finish, it may time out. If it does, just go back to Special:AllPages for your new namespace, and find the last file listed. Since you did your import in alphabetical order, that last page listed on Allpages in i3.export.xml, and delete everything from the first <page> entry up to that file (note, you need the initial 30-odd lines before that first <page> entry, don't delete that part, and then re-run the import.
  4. If you want to test things out, when you're done you can go to Special:Allpages, get a list of files, and compare the total number of files to the initial number of files you attempted to export.

Step 3A: Copy over Templates

  1. Use Special:Allpages to list everything in the Templates namespace that starts with the previous interop (eg I3)
  2. Any templates beginning with I3 should be exported
  3. Edit the exported file to change I3 to I4
  4. Import the altered file

Template Examples

  • [Template:I4 Information Card Browser Add-On FeatureTest List]
  • [Template:I4 Information Card Identity Provider FeatureTest List]
  • [Template:I4 Information Card Identity Selector FeatureTest List]
  • [Template:I4 Information Card Relying Party FeatureTest List]
  • [Template:I4 OpenID Identity Provider FeatureTest List]
  • [Template:I4 OpenID Relying Party FeatureTest List]

Step 3B: Copy over Categories

  1. Use Special:Allpages to list all pages in the Category namespace that begin with the last interop (eg I3)
  2. Any templates beginning with I3 should be exported
  3. Edit the exported file to change I3 to I4
  4. Import the altered file

Category Examples

  • [Category:I4 FeatureTest Results]
  • [Category:I4 FeatureTests]
  • [Category:I4 Features]
  • [Category:I4 Solution]

Step 4: Copy I3 files to I4 Files

  1. any .crds files that are I3 specific should be copied to I4, as they may be replaced or updated for the new interop.
    1. look in /home/osis/web/w/images for any files starting with I3
    2. Copy those files to filenames where I3 is replaced with I4


Step 5: Edit MediaWiki:Sidebar to replace navigation

Step 6: Create new PagesOnDemand extension File

When you go to a FeatureTest List and see the links that say "Not Tested", you can click on that link to automatically create a result that has the template prepopulated with information.

This functionality is accomplished through an extension called "PagesOnDemand". You have to make a new file for each interop that checks to see if the page being travelled to starts with FTR and is in the new Interop Namespace. You also have to add a new "require" entry in the LocalSettings.php file.

Steps:

  1. go to the /extensions/PagesOnDemand directory in the OSIS root directory, using ssh
  2. Copy a previously existing PagesOnDemand file to one with the new name of the interop
    1. for example copy OC3_Result_PagesOnDemand.php to OC4_Result_PagesOnDemand.php
  3. Edit the file and replace all instances of the old namespace with the new namespace
  4. Find the ONE place in the file where the namespace is referred to by number (ie 112, 117) and replace the old namespace number with the new one
    1. Note you can find the namespace number in the LocalSettings.php file
  5. Edit the LocalSettings.php file in the OSIS root directory (ie web/w/LocalSettings.php)
    1. Find the section called "Pages On Demand Extension" and add a new require statement to the file, eg require_once("$IP/extensions/PagesOnDemand/OC4_Result_OnDemand.php");