3

We are looking at using Git for all our sources. We have different languages (PHP, SQL, RPGLE, JavaScript, etc), and want to try to centralize the source locations. Also, Git offers a plethora of other advantages over the iSeries based SCM.

Getting the sources to Git is fairly straight forward, what I am struggling with is how to move the code from the Git repos to the iSeries.

We use RDi for our IDE, and I have installed the eGit plugin, but I am struggling on how to move the modified sources from my local PC to the iSeries (developer's personal libraries).

Has any one done this? Can you assist me in getting this setup running?

David G
  • 3,940
  • 1
  • 22
  • 30
jgriffin
  • 176
  • 1
  • 11
  • Why are you trying to "move modified sources" "from your PC to iSeries"? Shouldn't you "commit the modification to Git" and then shouldn't the iSeries (whatever it is) read/get/see/pull the modification from Git? – quetzalcoatl Nov 19 '14 at 16:41
  • Also (excuse me if it's nonsense, but I don't know what RDi/iSeries are - I judge try to make some rough sense from what you have written) - why did you name the question "RPGLE code in Git"? Do you really have problems with committing/storing/pushing/pulling those into a Git repo? Or shouldn't the quesiton be rather "Integrating iSeries with Git repo" or something like that? – quetzalcoatl Nov 19 '14 at 16:43
  • 2
    @quetzalcoatl, [iSeries](http://en.wikipedia.org/wiki/IBM_System_i) (now called IBM System i) used to be called AS/400, a "midrange computer" (think "smallish mainframe") from IBM. [RDi](http://arcadsoftware.com/products/rdi-rational-developer-for-i/) is an IDE for iSeries built on top of Eclipse. – ChrisGPT was on strike Nov 19 '14 at 17:00
  • 1
    [This answer](http://stackoverflow.com/a/11803221/354577) suggests installing Git via PASE. I'm not an expert on System i, but I think that PASE is just a different interface to your libraries, so you should be able to use Git via PASE to populate your user libraries. – ChrisGPT was on strike Nov 19 '14 at 17:04
  • 2
    Not to pick nits, but the system's name is now "IBM i on Power Systems". :) – David G Nov 19 '14 at 17:35
  • @Chris: thanks, once I'm not dead tired, I could've digged that up on the net, but now don't have to, thanks again!:) Anyways, my point was about the odd title (that's still quite shapeless as would "C++ in Git" be) and the merit of the question (which actually is a bit clearer now). – quetzalcoatl Nov 19 '14 at 23:12
  • @david, it's easy to get out of date with a platform that changes names so frequently! I worked in this space for four and a half years, and I'm pretty sure I saw *three official names* during that time span. – ChrisGPT was on strike Nov 19 '14 at 23:37
  • Thanks all. I have changed the title to more accurately describe my question. Getting the code into and out of GitHub is not the issue. I am able to pull/modify/commit the code with no issue. What I am struggling with is how to bring it into RDi and have RDi move the modified code into the developer's library. Ideally, the developer should be able to check out the branch in RDi, make changes, and as they are saving the changes, the code is placed in their library for compilation and testing. Commitment should not happen until the code is unit tested and ready for sys/integration testing. – jgriffin Nov 20 '14 at 17:44

4 Answers4

5

One thing to keep in mind is the fact that 'change control' on IBM i means a lot more than just source change management.

Recompilation, object attribute retention, remote deployment, file data retention, object relationships, etc, all need to be considered for a serious change control system.

If all you're concerned with is source code change control, then GIT in PASE (or SVN) might be sufficient ... but if you're trying to satisfy auditor requirements, you will probably need something much more robust.

David G
  • 3,940
  • 1
  • 22
  • 30
  • 1
    david. Git would only be the source repository. For all the other aspects listed, we will still use an iSeries SCM (Implementer) for promotion. The best way to describe this is similar to a PHP stack, where Git holds the code, but Jenkins will handle deployment. – jgriffin Nov 20 '14 at 17:41
  • @jgriffin it just so happens I work for PTC, on Implementer (I avoided specific product references in my answer though), so I'm pretty familiar. We have a source management function available via Integrity. Contact me at dgibbs ptc.com if you're interested in info (I hope I'm not breaking any rules with this comment). – David G Nov 20 '14 at 17:57
3

For RDi, the easiest interface is iProjects.

There is a writeup of interfacing SVN with iProjects at http://www.taskforce-it.de/en/download.html No, it's not Git, but the pdf describes the general mechanism for how you edit and push changes back to IBM i.

You WILL lose your source change date and sequence numbers.

Buck Calabro
  • 7,558
  • 22
  • 25
  • There is a reason Git (and SVN before it and CVS before that) call themselves *version* control systems. Standard stream-based source files and their attendant diff tools make line change dates much less important. That being said, line dates are still valuable in much of the IBM midrange community, and when using Mercurial to manage a combined Python/RPG/CL project, I included the line change dates for the RPG and CL. (The sequence numbers are truly useless, and really screw up diffs.) – John Y Nov 20 '14 at 19:20
  • Is there a way yet to KEEP the source change date and sequence number metadata? – SovietFrontier Jun 11 '19 at 18:08
2

OK, I think I got this solved. Here is what I did:

Install eGit

Projects: To get this working, you will need to use projects. This part will be a slight learning curve, but it is really easy once you get the hang of it.

Configure I Projects: We do not want line numbers and dates (causes errors on push/pulls).
Navigate to Window > Preferences > I Projects Click ‘Remove sequence number and date fields on download’ Click ‘Enable add and remove sequence number actions’

Create iSeries Project: Click File > New > Project Search for IBM Select the IBM I Project Click Next Name the project Click Next Select your connection to your remote server Select an associated Library (your PD lib is best) Click finish

You should see a project in the Project explorer.

Navigate to the Remote System Explorer Create an object filter for your Q* source files In the context of the filter, right click and select ‘Add to I Project’

Now you should have the entire Qblah source file in the project

Create Git Project Right click in the project explorer and select import. (May need to pick Import > Import) Type Git Select Projects from Git Click Next

Here you can use an existing local checkout, or clone a new repo.
Select clone URI Click next Enter the protocol/URI (just like in the wiki you visited earlier) Select branch(s) you want to import (recommend Master) Click Next Select destination folder Click Next Make sure ‘Import as a general project’ and click next Name your project (Recommend Git-repoName) Click finish

You should now see two projects listed.

Editing You can select the source and edit in the Git project. It will open the correct lpex editor and you are good to go.

Sending to iSeries This is where things get a bit tricky.
When it is time to send to the iSeries and compile, right click on the modified source in the Git repo Select Copy Right click on the appropriate Q* in your IBM project source file and select paste

Next go to the remote reconciler tab Right click on the source or file and select ‘push to’, then select the remote entry

BAM! Code is on the iSeries, ready for compilation.

Commit back to Git In the Git project, right click and select Team > Commit. Select/de-select the desired changed sources Enter message Click commit (local commit only) or commit and push (commit to remote repo)

Done! Now you can start importing the iSeries based code to Git!

jgriffin
  • 176
  • 1
  • 11
  • I'm using iProjects to Remote Actions > Push and Remote Actions > Compile. When I'm happy with the code base, I switch to Git repo view and Commit. – Buck Calabro Jul 29 '15 at 15:02
1

jgriffin, I'm doing exactly this as an experiment for my projects, not for the entire enterprise sources.

This is what I've learned:
1. Create a connection on RDi to your sources.
2. Create an iSeries project on your local machine.
3. Create a folder on your project. This will be your sources location.
4. Init a git repository in this folder.
5. Use your iSeries connection to import your sources to your local folder.
6. Make a your first commit and that's it! You have now your codebase to your projects.

Work on your sources as usual on your iseries. Then when you consider a new commit shoul be done, use the Remote Reconcilier view on your RDi or just import the modified code into your folder and make a new commit using git.

I haven't tested rollbacks, checkouts and other things. When the time comes I will. Let me know how this work for you.

Good Luck.

JF.

Community
  • 1
  • 1
Jairo R. Flores
  • 724
  • 4
  • 11
  • 1
    how did you get the remote reconciler to work? Whenever I attempt to push to the iseries, it gives me a conflict error, and I am not able to see what is in conflict (especially since it is a new file/member). – jgriffin Nov 20 '14 at 19:15