Designing a deployment procedure

When building a deployment procedure, there is a point that can cause quite intense discussion. How do we prevent code that is not ready for release from being released?

There is no easy way to shelve code in AX, and many would panic at the thought of synchronizing to the tip. We can create a branch and update the VCS settings with this branch, but we can't easily merge this back into the main branch after release.

The solution we use is to create shelvesets. In order for this to work, there are some dos and don'ts; this is the list that we use:

  • Do not check in every small change. Check in a block of changes that we have unit tested.
  • Plan development work to minimize the overlaps in changes being made to similar areas of the system.
  • Check out the label file when work begins.
  • Once the piece of work is complete and has passed the unit testing, check in the work including the label file. We also tag it with the appropriate TFS task so that the checked-in code is linked to the requirement.

Let's say we have two pieces of work in progress, and one is not ready for release. We can check in the code that is ready and create a shelveset within Visual Studio for the code that should be shelved. We can then synchronize the code with TFS in AX to remove the shelved changes. To check for regression, we would run a full compile and rerun our test cases. The full compile is required as the p-code for a shelved method may still be there, and a call to this shelved method may actually still work! This has caught many out when they say, "It worked in my environment!" only to find that recompiling the affected objects highlights the problem as being a compilation error.

We can bring the shelved changes back into our repository after the release has been done and synchronize AX with TFS.

Once all releasable code is checked in, we create a build that we can then release to the appropriate environment, such as a user acceptance test server.

We may also need to remove the checked-in code; a useful trick is to check out the elements and create a project from the Pending Objects form in order to export it. You can then revert the changes as required, create the release build, and eventually, reimport the XPO after the release is done.

Note

Be careful when importing XPOs. When they are exported, they contain the entire object, even though only one field or method was changed or added. You may need to use the compare tool to merge the changes back in again.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.161.30