Code Monkey home page Code Monkey logo

gitax's Introduction

GitAx

Please keep in mind that in D365 F&O, development is 100% done within Visual Studio and we're all aware that VS already provides an out of box integration with Git.

This is an experimental project, bringing git for Microsoft Dynamics AX 2012 R2/R3. Started as a hack, might evolve to something useful.

Model

Right now you can't just clone the repo and code in AX. Current version needs to be imported from a model. You can get the model from a list of releases

Documentation

We have a small wiki here that will guide you building and contributing.

gitax's People

Contributors

fraga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitax's Issues

Fill up item history

We want to see the history of the item (commits history) from within AX, this needs to be implemented.

Implement fileDelete method

/// <summary>
///    Checks out a file for delete.
/// </summary>
/// <param name="_filename">
///    The file to delete.
/// </param>
/// <returns>
///    true if the file was deleted successful; otherwise, false.
/// </returns>
/// <remarks>
///    The file is deleted in the system by a subsequent check-in operation.
/// </remarks>
public boolean fileDelete(Filename _filename)
{
    return true;
}

Implement fileExists

This is to support #10 in case you issue command 'ADD' but file does exists in the repo.

AX will delete it and asks if file exists. If it exists, pull the latest and synchronize

Assembly not referenced.

Hi,

I followed all the instructions but keep getting "an Assembly containing type GTXLibGit2Sharp.GTXRepo is not referenced." error.
I have copied the whole of git bin to the client bin folder, added the gtxlibgit2sharp dll to the references in the aot etc...

Any ideas why this might not be working?

thanks

Compile CIL exception on .NET instance method GTXLibGit2Sharp.GTXRepo.GetFileStatus

When compiling incremental CIL having the following message:

__Finished pass 1 at 5/29/2014 4:56:54 AM__
__Finished pass 2 at 5/29/2014 4:56:56 AM__
Exception was thrown because the .NET instance method GTXLibGit2Sharp.GTXRepo.GetFileStatus was not found during CIL generation in class GTXFileUtil.fileIsDirt. Generating the code to make a reflection call during run time.
Information: Either the .NET instance method GTXLibGit2Sharp.GTXRepo.GetFileStatus or its parameters could not be resolved during CIL generation, in class GTXFileUtil.fileIsDirt. Generating the code to make a reflection call during run time.
__Finished pass 3 at 5/29/2014 4:56:59 AM__
__Finished creating types at 5/29/2014 4:56:59 AM__
Errors: 0
Warnings: 1

Implement Visual Studio projects

Need to implement basic functionality for projects that are contained in a directory, example as VS projects are, as stated on #49

Repro-steps as per @weedgarden

1) VS: create VS project (Visual C# -> Windows project)
2) VS: add to AOT, build, deploy
3) AX2012: add VS project to version control
4) commit
5) AX2012: delete the VS project
I got @SYS343905 (The project cannot be deleted because %1 is checked out.) when trying the last step.
No pending objects. "Undo checkout" does not help.

Implement test for SysVersionControlSystem\NewType

public static SysVersionControlSystem newType(SysVersionControlType _type)
{
    switch (_type)
    {
        case SysVersionControlType::SysVersionControlSourceDepot:
            return SysVersionControlSystemFileBased::newBackEnd(SysVersionControlFileBasedBackEndSD::construct());

        case SysVersionControlType::SysVersionControlSourceSafe:
            return SysVersionControlSystemFileBased::newBackEnd(SysVersionControlFileBasedBackEndVSS::construct());

        case SysVersionControlType::SysVersionControlMorphX:
            return SysVersionControlSystemMorphX::construct();

        case SysVersionControlType::SysVersionControlTfs:
            return SysVersionControlSystemFileBased::newBackEnd(SysVersionControlFilebasedBackEndTfs::construct());
//<GTX>
        case SysVersionControlType::SysVersionControlGitax:
            return SysVersionControlSystemFileBased::newBackEnd(new SysVersionControlFileBased_GTX());
//</GTX>
    }
    return null;
}

getting err msg @SYS343905 when trying to delete VS project

  1. VS: create VS project (Visual C# -> Windows project)
  2. VS: add to AOT, build, deploy
  3. AX2012: add VS project to version control
  4. commit
  5. AX2012: delete the VS project
    I got @SYS343905 (The project cannot be deleted because %1 is checked out.) when trying the last step.
    No pending objects. "Undo checkout" does not help.
    Did I understood something wrong or made a mistake? Or is this relevant to your last comment in #1 ? Thanks for your reply.

file structure reflecting AX layer structure

Hi Rodrigo,
thanks for your work at gitax.
Anyway, as I think about using git with AX, I find using model-based versioning insufficient:

  • When overloading single method of a class from another model (or lower layer? srry .. not sure), I have to move whole the class to one model to be able to use VC.
  • I also can't version the changes in other layers - if update or external contractor changes behaviour of lower layer class, I won't even noticed it

Would it be useful to reimplement the file structure to reflect layer structure of AOT?
Or do you have other solution for such an issue?

Synchronize AX with git repo

To make this interface clean and simple, if we merge code using git, we supposed to issue the version control's sync from within AX. This would get all the xpo's in the repo folder and bring them back with 3 types of actions: add, update, delete.

Implement test for SysVErsionControlSystem\GTXstripFilePathDelimiter

/// <summary>
/// Removes the folders delimiter
/// </summary>
/// <param name="_fileName">
/// Filename to remove folder
/// </param>
/// <returns>
/// A fileName without folder delimiters
/// </returns>
public str GTXstripFilePathDelimiter(Filename _fileName)
{
    #file

    return strReplace(_filename, #FilePathDelimiter, '');
}

Adding to source control and then undo checkout

After you add for the first time an item but decided to remove it, the version control should delete the file

Repro steps

  1. Create new job for instance
  2. Add it to source control (a file is created)
  3. Undo checkout

Expected
File not to be there because since there's no history system should delete it

Actual
File still there

History for renamed items

History for renamed items is being tracked like the console git log

History for instance in class GTXDummyClass shows:

history

The same with console:
history

But in reality history should track to its name before:
history

Renaming an object in AOT that is linked to a Project node does not update Project

Need to check if can be reproduced under other VCS control (like morphX or TFS)

Premises

  • Both objects must be source controlled (previously added in AX source control)
  • An AX object (like a class for instance) is part of projectB project node in AOT
  • Project Node cannot be checked out

Steps

  • Create classA under classes node
  • Add classA to source control and checkin
  • Create projectA under nodes
  • Add classA under the projectA node
  • Add projectA to source control and checkin
  • Rename ClassA to ClassB
  • Open projectA and verify the node got Changed

Expected

A change in the XPO: removed old object name, added new object name

Current

ProjectA will never get changed

Example expected result

diff --git a/Projects/Shared/GTX.xpo b/Projects/Shared/GTX.xpo
index 3ba4e0f..9d7f73f 100644
--- a/Projects/Shared/GTX.xpo
+++ b/Projects/Shared/GTX.xpo
@@ -93,6 +93,12 @@ Formatversion: 1
         PreventEditProperties #No
       ENDPROPERTIES

+      BEGINNODE
+        FILETYPE 0
+        UTILTYPE 45
+        NODETYPE 329
+        NAME #GTXDummyClass
+      ENDNODE
       GROUP #Mocks
         PROPERTIES
           Name                #Mocks
@@ -113,12 +119,6 @@ Formatversion: 1
         FILETYPE 0
         UTILTYPE 45
         NODETYPE 329
-        NAME #GTXDummy
-      ENDNODE
-      BEGINNODE
-        FILETYPE 0
-        UTILTYPE 45
-        NODETYPE 329
         NAME #GTXFileUtil
       ENDNODE
       BEGINNODE

Resolve creation of labels

Creation of labels while in VCS in AX 2012 helps solving a past issue from AX 2009 - it creates a temporary label and when you checkin it will populate the ald file with the label id.

We should now investigate how we could fix this for gitax.

Implement "Get directory" method

Need to implement DirectoryGetVersion continuing on #8

/// <summary>
/// Gets the directory of the specific version.
/// </summary>
/// <param name="_localDirectoryPath">The local directory path.</param>
/// <param name="_item">The instance of the source control item.</param>
/// <returns>The path where the directory was extracted.</returns>
public FilePath directoryGetVersion(FilePath _localDirectoryPath, SysVersionControlTmpItem _item)
{
    return '';
}

Business connector exception while browsing history on Project node

while on a project node, server stopped with exception

The description for Event ID 180 from source Microsoft Dynamics AX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Microsoft Dynamics AX Business Connector Session 3.


RPC exception 3762504530 occurred in session 3 process is Ax32.exe thread is 4296(User: Admin, ClientType: GUI)

and more details

Dynamics Adapter CallStaticClassMethod failed.

External component has thrown an exception.

System.Runtime.InteropServices.SEHException
   at interpret.callStatic(interpret* , UInt32 , Char* )
   at AxCore.AxRuntime.Call(AxRuntime* , String className, String methodName, Type returnType, Object& result, Object[] paramList)
   at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.CallStaticClassMethodWithReturnType(String className, String methodName, Type returnType, Object[] paramList)
   at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.CallStaticClassMethod(String className, String methodName)
   at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.CallStaticClassMethod(String className, String methodName)

Overview_GTXFileRepoStatus has not been declared.

I'm also getting these 2 errors. Any ideas?

Variable Overview_GTXFileRepoStatus has not been declared. \Forms\SysVersionControlCheckedOut\Methods\init 38 init Err:9

Variable ModifiedBy_GTXSha has not been declared. \Forms\SysVersionControlItemHistory\Methods\init 35 init Err:9

Installation issue R3

After importing the model, having this problem on R3

Message (07:30:21 pm)
Assembly containing type GTXLibGit2Sharp.GTXRepo is not referenced.

Implement directoryGetVersion

Will get the version of an entire directory

Implement the following method

/// <summary>
/// Gets the directory of the specific version.
/// </summary>
/// <param name="_localDirectoryPath">The local directory path.</param>
/// <param name="_item">The instance of the source control item.</param>
/// <returns>The path where the directory was extracted.</returns>
public FilePath directoryGetVersion(FilePath _localDirectoryPath, SysVersionControlTmpItem _item)
{
    return '';
}

CIL compile warning investigation

When compiling incremental CIL

Finished pass 1 at 6/27/2014 11:32:21 AM

Finished pass 2 at 6/27/2014 11:34:22 AM

Exception was thrown because the .NET instance method GTXLibGit2Sharp.GTXRepo.GetFileStatus was not found during CIL generation in class GTXFileUtil.fileIsDirt. Generating the code to make a reflection call during run time.

Information: Either the .NET instance method GTXLibGit2Sharp.GTXRepo.GetFileStatus or its parameters could not be resolved during CIL generation, in class GTXFileUtil.fileIsDirt. Generating the code to make a reflection call during run time.

Finished pass 3 at 6/27/2014 11:41:48 AM

Finished creating types at 6/27/2014 11:42:22 AM

Errors: 0

Warnings: 1

Model folder with source control

Currently the model folder attribute under models is not set

<VCSParameters>
...
<?xml version="1.0" encoding="utf-8"?>
  <Models>
    <Model folder="" description="Gitax" aldlocation="" />
  </Models>
  <PluginSettings />
</VCSParameters>

This causes some problems like you can't guarantee all files will be source controlled and generates confusion while syncing the whole folder

Implement feature UndoCheckout

Feature undo checkout in AX undo the modified file and synchronize it to it's latest version
We need then to check the last commit and issue an update command to the backend so it will resync the file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.