Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic ATC check when activating

koitka
Explorer
0 Kudos

Hi experts,

is there any possibility to execute ATC checks automatic when source code is activated?

Every once in a while, somebody from SAP writes a blog and points to this open source plugin from some dude

https://github.com/andau/abapCI

But I can't get it running and let's be honest, this should be a feature that SAP takes care of.

I know that there are possibilities to execute ATC automatic once a night or upon transport release, but what we need is to have it automatically triggered upon activation of the code. Like the syntax check.

If in Eclipse I run ATC for my source code, I get nice markers in the code. This is great.

It should be possible to set this automatic upon activation.

Gruß,

Sebastian

21 REPLIES 21

ThFiedler
Product and Topic Expert
Product and Topic Expert

Hi Sebastian,

there is a good reason why this is not included in the development workflow like the syntax check. Usually the ATC checks take quite some time especially when you have configured a large set of checks or when you run it over a huge set of objects. Therefore I'm not sure if this is really helpful.

Do you do this actually manually after each activation?

Regards,

Thomas.

Hi Thomas,

Normally there are two types of ATC checks:

  • Code-Style / Static-Code-Checks / Linting (easy and fast to run)
  • Dynamic checks (Unit-Tests, Integration Tests, Heavy cross-analysis, ...)

When talking about the first point I personally strongly support Sebastian. In the outside-ABAP world it is well established practice to check your code (eslint, tslint, [xyzlint]) while you are writing (like ofc also abaplint; Unfortunatly here we have the problem, that this is not really running in eclipse https://github.com/abaplint/abaplint-eclipse and I personally still don't want to use the VS-Code Plugins 🙂 ).

From my personal feeling it is extremly annoying that developers only see their coding-style issues only when releasing their task (or manually running ATC). When you get errors "while you are typing" the acceptance of these errors is usally very high (quickly correct, remember and forget). When you get errors after some manual key-combination (or 5 days later when trying to release) you are extremly annoyed by it. Therefore I'd love to see an official feature to run a simple specified ATC variant on activation, which immediatly warns the developer.

Only using this immediate feedback developers are not loosing their development time, and will actually get used to better coding style - as they are correcting code while writing.

Regards,

Timo

0 Kudos

In our landscape we have around 20 active ATC checks in a central ATC system. An automated ATC run on every activation is simply not possible, this would break the "development flow" (code, activate, unit test, code,...) because of the long runtime.

If your function is implemented and the unit tests are green, no one hinders you to do a <ctrl>+<shift>+<f2>, correct the results and start the implemenation of the next user story.

I guess I understand the question for more immediate feedback on one hand. On the other you can see the resource consumption of finding those issues. So I would definitly not tie it to the activation of a source code.

However I could imagine some background processing, that is triggered by a save that runs a light weight check variant and when its done the results are reported back to eclipse.

I am using Resharper in Visual Studio, and there you also see some simple checks only in the background but when you want the full coding style feedback you have to start it manually. All software projects where I used a forced style it usually went into the check routine when commiting code to the repository, in SAP this should be equivalent to releasing the transport to the test system.

Cheers,

Peter

"no one hinders you to do a <ctrl>+<shift>+<f2>, correct the results and start the implemenation of the next user story."

Certainly true, that nobody prevents that. Maybe I am just too spoiled by the development using e.g. typescript, where you simply get *instant* feedback. I am typing, i am noticing that i am using "let" instead of "const" --> i correct. After correcting 50 times, i improve my coding style and get better. Most important: I am loosing maybe 0.5 seconds for correction, and I am still inside my programming flow.

Basically: Checking coding style / linting should be seemlessly integrated into your development - so that the required checks are not stopping you from reaching a "flow". Having to execute checks manually (my opinion) breaks that, as I am switchting mentally from a "i am developing" to "i am correcting" mode.

I know that in the ABAP world we got used to the fact, that ATC is "mass optimized" executed for a task or "on-demand". But honestly I can't see the point why ATC should take so much ressources for simple coding-styles issues if e.g. abapLint can do that on my local computer live while typing in vs-code. And in my system ATC takes ~~1 second for a big class (with a reduced amount of checks activated). Running this asynchronously after activation and pushing back the results shouldn't harm a normal sized system.

All of this is of course just my very personal opinion. Other are maybe learning better by just getting a bunch of 30 coding style issues every hour - I personally just think that technical feedback should always be visible and communicated as early as possible, and without any manual action required.#

PS: Also as Peter said. Lightwight and fast (80/20) checks while typing / activating. Heavy and complete checks while "committing" (releasing a task).

8ae6723ab3fa43a8980099fe48f90b04 You are absolutely right, the ATC check is triggered as "Background process" in Eclipse. Have to re-think my answer....

0 Kudos

8ae6723ab3fa43a8980099fe48f90b04 Thank you so much, totally agree. Also, as already stated, ATC is executed in background if manually executed in eclipse. That's perfect.

In the lower right corner it is stating "Running ATC..." and give me the results once you're done. perfect. Just make this automatic and that's it. Could also imagine to make it activatable if you're afraid that people might be annoyed.

Hm, as this function only makes sense in Eclipse, I can imagine that this could be an Eclipse plugin: listen to the key binding <ctrl>+<f3> and trigger "activate" and "ATC check" -> no backend changes needed

0 Kudos

Your last comment did not let me sleep...

"as this function only makes sense in Eclipse"

Why do you think this way?

Having ATC checks (maybe on and off switchable) run automatically and displayed in the coding at a moment when the developer is still active about his coding would be a help to any developer no matter where he is developing...

I can only understand your statement in a way that "People who are using SE80 are used to not get any comfort at all, so this helper function would be too much help for them".

0 Kudos

justacasual No, this meaning was totaly not intended. It was just the like "SAPGUI doesn't have a background process and will never have"

Florian
Active Contributor
0 Kudos

Can you explain a little more what you mean with "I can't get it running"?

A lot are using the plugin and pretty sure someone (at least andreas.gautsch ) will give you a hand if you explain what the problem is.

Regards

Florian

larshp
Active Contributor

For abapGit development, each commit triggers static analysis using abaplint. The ABAP code can be edited in vscode using the abaplint extension, which shows problems immediately like development in most other programming languages.

For integration into Eclipse, each rule that is annotated with SingleFile, only needs the contents of the file currently being edited to determine problems, ie. easy to execute locally without a backend call, but requires some development.

abaplint also offers the possibility for integrating into ATC, see https://github.com/abaplint/abaplint-sci-client

0 Kudos

Hi lars.hvam ,

thanks for your feedback.

I really like ABAPGit and I wish I could get my customers to use a real git workflow, but unfortunately I have to live without it for now.

Also I think it would still be better to give feedback before committing.

Concerning VSCode: Do you really use it for development? It is not supported, right? Does it work smoothly? I remember testing it a while ago and it was very experimental still...

Concerning ABAPLint in Eclipse, not sure from your readmes if this is an option for me....

larshp
Active Contributor

use git workflow: have a look at the recently merged https://github.com/SAP/styleguides/tree/main/abap-code-review

feedback before commit: yea, agree, the abaplint-sci-client can help here. I tend to just push commits, which triggers the CI, instead of triggering locally first, and then CI is triggered. Then I only have to wait once instead of twice.

vscode: there are two approaches, https://marketplace.visualstudio.com/items?itemName=murbani.vscode-abap-remote-fs which calls the same REST APIs as Eclipse, and then abaplint which is standalone, both have pros and cons. I developed https://github.com/abap-openapi/abap-openapi-client using the standalone approach, found lots of bugs, but its moving forward 🙂

former_member183045
Contributor

Of course, let me know what version of Eclipse you use, which ABAP version and the behaviour the plugin shows after installing and I will try to assist you.

Greetings, Andreas

former_member183045
Contributor
0 Kudos

May I also add my point of view.

First of all the intention to create the above mentioned plugin was to get immediate feedback while programming.

Its one approach and especially what is currently happening in abapGit/abapLint and the "central ATC system" areas are others which have features worth to explore. - Lars ist there anything where you are not involved 🙂

The abapCi Plugin works asynchronous, thus after activation you have not to wait on the ATC checks and depending on the size of the activated development objects you get hopefully fast and valuable feedback about not perfect code. So it should not slow down the development flow.

It does not cover all development objects and all development situations. But here I have a pragmatic view: If onces in a while I get the immediate hint that I have broken an ATC rule immediately when I write the specific code then I will more often clean up the code.

As mentioned the performance mainly depends on the number of activated development objects, the lenght of the development code and also if you are working remotely or onside.

Greetings, Andreas

0 Kudos

Hi andreas.gautsch ,


as stated above, maybe we can discuss more on

https://github.com/andau/abapCI/issues/29

My main point is also that I think this feature should be a regular feature of the SAP IDE.

And SAP pointing to an open source plugin, which has not reached major version 1 in quite some years now, is not acceptable in my view.

koitka
Explorer
0 Kudos

Hi andgau thanks for your offer to help.

Are you andau on github?

When writing this question I was already a bit frustrated, so I was not very precise, I am sorry 😉

Now I had a look again, what my really problem is and made a small test setup to dig into this.

I think it more or less boils down to the fact that I cannot get feedback from the feedback. In my test case it runs ATC upon activation (perfect!), but I cannot see the result in the ATC results view and not in the editor.

If I run ATC manually, I get feedback in the editor and that's what the developer needs.

I already opened an issue on the github page a while ago:

https://github.com/andau/abapCI/issues/29

As I did not receive any feedback, I considered the plugin abandoned.

If you want to discuss this in more detail, I can also add a documentation on the github issue. I think here is the wrong place.

marcfbe
Participant

I have done ABAP for over 20 years and my code still breaks every possible rule: syntax, style, unit tests, atc, abaplint, you name it. I will take any help I can. So, hell ya, check my code when I activate it, please!

Or do it in the background while I type, Like Grammaly. Fix obvious things automatically, red undersquiggle for other mistakes, right-click for options to fix those. Bring it on!

0 Kudos

Thanks marcbernardtools !

koitka
Explorer
0 Kudos

Just for anyone else reading this. ABAPCI does NOT offer a list of all the ATC findings that came up during the automated check. Also, it is not possible to see those findings in the ATC results browser or in the problems view (at least it seems not to be reliable).

See

https://github.com/andau/abapCI/issues/29#issuecomment-819045001

SAP people, please stop pointing towards this poor opens source dude and integrate into your IDE...