Question
· Aug 19

ISC Github integration - Missing understanding of one step

Hello All,

  I have used github (outside of IRIS) for many many years and have no problem with it.  Also used SVN and other source control systems.

  I have a conceptual problem understanding the ISC github links and how they work via VSCode.

https://github.com/intersystems/git-source-control

 Our server is on Linux.

What I've done:

1. On Linux Server - d ##class(SourceControl.Git.API).Configure()

2. Create a local repo (we have a local git), say https://repo/myrepo

3. VSCode installed Object script addons, github Pull requests extension

4. VSCode Connect to namespace on server, all good

5. VSCode Initialize a repo on my local PC (VSCode likes to default use c:\ which was fun for a while)

6. Change PCK.Class1 and commit (now everything fails)

 

So I ask WHERE is the master?

1. https://repo/myrepo?

2. /linuxserver/repo/myrepo (created by d ##class(SourceControl.Git.API).Configure()))?

3. Or inside the IRIS.DAT?

 

How does /linuxserver/repo keep uptodate from https:/repo/myrepo if the linux directory isn't a repo?

 

If we have PCK.Class1(v1) on the linuxserver and //myrepo

If I amend and push PCK.Class1(v2) (via ifs) there is now different version on IRIS (IRIS.DAT) compared to /linuxserver/repo and to //myrepo

I've obviously lost a huge understanding of how IRIS.DAT (for want of a better word) and /linusserver/repo stay instep.

And if I create a local repo (c:\repo\myrepo2) from //myrepo and commit and push how does that get to /linuxserver/repo and then into IRIS.DAT?

Discussion (3)2
Log in or sign up to continue

Hi Paul,
There are a couple different ways of doing source control with IRIS and git.

The first is client-side source control. You will have a git repository on your local machine. You use VS Code to edit files in that local git repository. The ObjectScript extension for VS Code will push those edits to the IRIS database. You can then commit those changes and push them up to GitHub/GitLab/etc. using the git CLI locally or whatever git tool you prefer.

The second is server-side source control using Embedded Git. You will have a git repository on the remote server that IRIS is running on. That git repository can be created with `##class(SourceControl.Git.API).Configure()`. You can use VS Code with ISFS (or Studio, or the Interoperability Portal) to edit code in the IRIS database. Embedded Git will export that code to the git repository for you. You can then commit and push those changes using the source control menus embedded into IRIS.

It sounds like you have a mix of both currently which can get chaotic.

The advantage of client-side source control is that it's closer to standard industry practices. There are a lot of helpful tools like GitLens and GitHub Desktop that rely on you having a local git repository.

There are a couple of advantages of server-side source control:
- If you have multiple developers editing code in the same namespace (pretty common with legacy IRIS users) it will prevent them from stepping on each others' toes.
- If you are doing most of your work in the IRIS interoperability editors, server-side source control gives you source control actions embedded directly in those editors.
  
  Let me know if this is helpful or you have other questions.

> Where in IRIS?

If you have VS Code set up with server-side (isfs) editing, there will be a little source control icon in the upper right corner when you open an item for editing:

The same icon will show up in the System Management Portal when you're editing an item that can be source controlled, for example in the production configuration page or the data transformation builder.

Note that these icons will only show up if server-side source control is enabled for the namespace, which `##class(SourceControl.Git.API).Configure()` will do for you automatically.

> Is there some easy to follow tutorials for both solutions?

This isn't a full tutorial but the best I can recommend for now is this video: https://community.intersystems.com/post/video-selecting-right-source-con...