Solved

Merge Requests in GitLab regularly lead to problems

  • 18 March 2022
  • 2 replies
  • 46 views

Badge

Hello everyone,

in contrast to other programming languages, the source code of an AIMMS model usually is in a single file. Our code is hosted at a GitLab instance. Our team notices, that GitLab struggles with the large .ams-file, especially in merge requests. Sometimes the diff is too large to be shown, posting comments (as a reviewer as part of a code review) fails, or loading already posted comments fails. The size of our .ams-file is usually between 1 MB and 5 MB.

Has anyone else experienced similar issues? Does anyone know a good alternative to conduct code reviews, which does not involve hosting the code on a different platform?

I’m aware that we could use libraries to divide the code in smaller chunks, however, I feel like this is not as easy as in other programming languages and not the way it’s “supposed to be” in AIMMS.

Best regards

Benedikt

icon

Best answer by SDjohan 18 March 2022, 16:07

View original

2 replies

Userlevel 1
Badge

Hi Benedikt,

If you are using “sections” in your model, you could try saving those “sections” in different .ams files. That way you can breakdown the .ams file into smaller chunks without the use of libraries. 

To save a “section” in a different section → double click on a “section” → click on the “wand” next to “source file → select “write...” → select a destination where you want to save the .ams file for that section.

Next to breaking down the .ams file into smaller parts, I also find this useful for code reviewing. You can immediately see which “section” has been changed and identify changes in “sections” which aren't expected (e.g. change in the optimization section, while only a UI updated should have been done). 

Hope this helps.

Badge

HI SDjohan,

this is great, thank you! I was completely unaware of this feature. It will definitely make coding collaboratively much easier.

Best regards,

Benedikt

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator