Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#469: Static Validation for DMN and BPMN Editors on VS Code extensions - Part 1 #2165

Merged
merged 14 commits into from
Jun 18, 2024

Conversation

Josephblt
Copy link
Member

@Josephblt Josephblt commented Feb 19, 2024

Part 1 of: incubator-kie-issues/issues/469.

All functionality implemented. A new VS Code extension project was created. It is possible to validate BPMN and DMN files. You can connect to any Extended-Service or choose to locally run one.

A separate PR will be sent with tests for all features that this one introduced.

Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josephblt hello, thank you for this new extension extended-services-vscode-extension. From the ticket description it seems to be very important and useful, however I would like to ask few questions about its usage.

  • Once it is installed into VS Code, are validation messages automatically shown to the user?
  • Or does use need to do any additional setting?
  • Does user needs to open some specific panel in VS Code?
  • Does user need to start validation by some command?
  • Is user prompted to install this new extension once old DMN or BPMN extension is installed and the new is not detected?

@Josephblt
Copy link
Member Author

Hello @jomarko.

  • Once it is installed into VS Code, are validation messages automatically shown to the user?
    Yes. Once installed, Bpmn and Dmn files behave like any other supported language. So any time the user opens a file or changes something, the files are validated. If any error is detected it is reported to the Problems tab.
  • Or does use need to do any additional setting?
    It works right out of the box. But it supports a few configurations. You can run the services locally or point to any address you want. You can also set how long between each connection check.
  • Does user needs to open some specific panel in VS Code?
    Nothing, it is intended to work just as any other script/language validator. If you change a file it reports the errors.
  • Does user need to start validation by some command?
    You can, but it's not necessary. It detects file activity, both from VS Code itself and outside sources (Git changes for example).
  • Is user prompted to install this new extension once old DMN or BPMN extension is installed and the new is not detected?
    No, but this is a cool feature that we already discussed. However, this is a change that needs to be implemented in the DMN and BPMN extensions themselves. So not part of this PR.

@tiagobento tiagobento changed the title Static Validation for DMN and BPMN Editors on VS Code extensions kie-issue#469: Static Validation for DMN and BPMN Editors on VS Code extensions - Part 1 Feb 20, 2024
@tiagobento tiagobento added area:bpmn area:dmn area:core pr: wip PR is still under development labels Feb 20, 2024
@Josephblt Josephblt force-pushed the incubator-kie-issues#469 branch from 754415f to 6474002 Compare February 20, 2024 20:14
@Josephblt
Copy link
Member Author

03 Automatic run of the local instance

Nice catch. This is fixed now.

@Josephblt
Copy link
Member Author

02 Restart extended-services

After some tinkering, I managed to reproduce this error using WSL. I changed the way the process is started and finished. This is fixed now.

@Josephblt
Copy link
Member Author

04 KIE Editor changes effect delay

Hello @jomarko. Nice catch. According to an old bug reported in the VS Code repository, it is possible to get stale data from tracked textDocuments. The last commit fixes that.

@Josephblt Josephblt requested a review from jomarko June 5, 2024 15:50
@danielzhe
Copy link
Contributor

I found an issue regarding the "02 Restart extended-services", reported before: if you click to disable the extended-service and don't wait for it to disable and click again in the icon at the right bottom of the VSCode, the extended-service doesn't come back live again, being necessary to kill the process manually in task manager.

In my opinion, I don't see why the user would like to completely disable it. Maybe just an option to "ignore the errors" instead of disable and enable? I don't know.

@Josephblt
Copy link
Member Author

Hello @danielzhe. I got an idea of what could be causing this. I'll let you know when I fix this. Thanks.

Josephblt added 14 commits June 12, 2024 22:34
Kogito Bundle
KIE Business Automation Bundle
Custom editor only detect changes after saving 2 times.
Changes from outside sources were not detected
Changed folders, function and class names
Changed file structure
Applied functional style where possible
Variable Grooming
Solved nesting issues
Removed pretier configuration from settings.
Changed description for connect/disconnect commands.
Fix for wrong status bar visibility on extension activation.
@Josephblt Josephblt force-pushed the incubator-kie-issues#469 branch from edf066b to da1b4aa Compare June 13, 2024 10:45
@Josephblt
Copy link
Member Author

Hello @danielzhe. All done. I could only reproduce the issue you reported by fast clicking the status bar icon. This last commit fix that issue.

@Josephblt Josephblt requested a review from danielzhe June 13, 2024 14:54
Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josephblt thank you for updates. I think the points I raised during my previous review are addressed now. I have one more question. I tried to run extended services externally, I mean I set Automatically run a local instance of the service as false. It worked fine, I was doing updates for the dmn file and the problems tab was updated correctly, however then when I stopped that external extended service, the VS Code displayed this, an error message and the livenes indicator as live. Not sure, just asking, if this is intended behavior, or the extended services vscode extension should automatically detect the external extended service is offline and change the indicator to offline?
Screenshot 2024-06-14 135212

@Josephblt
Copy link
Member Author

Josephblt commented Jun 14, 2024

Hello @jomarko. To update the liveness indicator we use a heartbeat check. When the connection is lost the check fails, all diagnostics are cleared, the icon changes, and the following error appears:
Connection Lost
In the image you sent, there is a validation error. So I assume you tried to validate before the heartbeat check, so the validation failed and that error appeared instead.

Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you @Josephblt , this PR is fine for me, I will get in touch in private channel with you to chat a little bit about the documentation for this extension.

@tiagobento tiagobento merged commit c787ed0 into apache:main Jun 18, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants