Warning
|
This repository has been archived as its purpose is complete. The successor to this repository is iso-10302-stepmod-annotate, where the Annotated EXPRESS conversion flow uses the ISO BitBucket Git repository as data source. |
This repository contains a workflow that imports the ISO 10303 STEPmod CVS repository at Boost to the iso-10303-stepmod-cvs Git repository.
There are two repos involved here:
-
Repo with import workflow: https://github.com/metanorma/iso-10303-stepmod-migration
-
Repo to hold converted git repo: https://github.com/metanorma/iso-10303-stepmod-cvs
Under .github/
you will see the import.yml
workflow.
The workflow depends on these two tools:
The workflow goes:
-
Use
rsync
to retrieve the CVS repository hosted at Boost viassh
; -
Run
reposurgeon
with the provided configuration to convert the whole repository history into Git; -
Push all Git tags and branches to the "converted" GitHub repo, using the
metanorma-ci
GitHub user.
Note
|
The Boost Conseil CVS is located at cvs.boost-lab.net .
|
Note
|
Previous (and deprecated) attempts to do the same are documented at previous-attempts.adoc. |
Cloning a remote CVS repository while importing is super slow, especially for a large repository like STEPmod.
We have tested and settled on these steps:
-
Maintain a local
rsync
copy of the CVS repository. -
Resolve all names from the CVS repository (CVS only stores UNIX usernames, in Git are names and emails) with a
reposurgeon
user map. -
Run
reposurgeon
which depends oncvs-fast-import
to import the CVS repository into theiso-10303-stepmod-cvs
Git repo.
rsync -avrPz -e ssh {{username}}@{{cvshost}}:/stepmod/ stepmod-rsync/
The best repository conversion tool, ever. reposurgeon
works on Linux and
macOS.
On Ubuntu the version is outdated and does not contain the functionality we need here, so we must build it from scratch from Git.
Ubuntu:
git clone https://gitlab.com/esr/reposurgeon
cd reposurgeon
git checkout 2f5f83ec63da34beaf8293434b5e1627366dfa7c
sed -i 's/apt-get install /apt-get install -y /' Makefile
make fullinstall
make all
The Homebrew macOS version is recent enough to work with our workflow.
macOS:
brew install reposurgeon
reposurgeon
depends on the cvs-fast-export
tool which works on Linux and
macOS.
Ubuntu:
$ apt-get -y install cvs-fast-export
macOS:
$ brew install cvs-fast-export
This is a first-time only step that is only needed only when you first setup
reposurgeon
migration for a repository.
$ cd stepmod
$ repotool initialize stepmod
repotool: what VCS do you want to convert from? cvs
repotool: what VCS do you want to convert to? git
repotool: generating Makefile, some variables in it need to be set.
repotool: generating a stub options file.
repotool: generating a stub lift file.
repotool: generating a stub map file.
Then you need to fill in:
-
Makefile
atREAD_OPTIONS =
to determine what to convert into Git branches -
stepmod.lift
if you want to add additionalreposurgeon
commands
The way to determine what commands to provide reposurgeon is via testing in the reposurgeon
CLI:
$ reposurgeon
reposurgeon%
Please refer to the
reposurgeon
manual
for details.
Find all authors in the CVS repository using make stubmap
.
$ cd stepmod
$ make stubmap
Then manually edit the stepmod.map
file to provide author information.
After all authors are mapped, run reposurgeon
to create stepmod-git
.
$ # assume that stepmod-rsync is the rsync copy
$ cd stepmod
$ # link the rsync'ed copy's /stepmod directory to stepmod-mirror
$ ln -s ../stepmod-rsync/stepmod stepmod-mirror
$ # run reposurgeon to perform conversion
$ make
The converted Git repo will be available at stepmod/stepmod-git
.
We actually use more complicated steps to upload commits via GHA iteratively in batches of commits (see import.yaml), but locally the following works.
$ cd stepmod/stepmod-git
$ git remote add origin [email protected]/metanorma/iso-10303-stepmod-cvs
$ git push --all
$ git push --tags