INTO-CPS-Association / DTaaS

:factory: :left_right_arrow: :busts_in_silhouette: Digital Twin as a Service
https://into-cps-association.github.io/DTaaS/
Other
115 stars 57 forks source link

Add 'Execute' tab to Digital Twins page preview #903

Closed VanessaScherma closed 1 month ago

VanessaScherma commented 2 months ago

It replaces PR #891. It completes the Execute tab present on the Digital twins page preview, which is accessible from the appropriate link within the Workbench. Only some unit tests are still incomplete due to the library import error.

prasadtalasila commented 2 months ago

@VanessaScherma suggestions to improve the PR:

  1. Remove job number from status messages. Only store the latest log in the browser cache.
  2. Write about the need to add "pipeline trigger token" in GITLAB-RUNNER.md
  3. Do not "busy wait" for job logs. Have a 5 second wait between sequential log requests.
  4. If the job execution takes too long (how long?), the DT execution "Start" button is active forever.

Also replace text at the top of "Execute" Tab with the following

"This page demonstrates integration of DTaaS with gitlab CI/CD workflows. The feature is experimental and requires certain gitlab setup in order for it to work."

prasadtalasila commented 1 month ago

@VanessaScherma The yarn syntax is throwing up errors. The .eslintignore file needs to be updated with the following content.

api/
build/
config/
node_modules/
script/
coverage/
dist/
test-results/
playwright-report/
public/
prasadtalasila commented 1 month ago

Since the gitlabDriver.ts has moved, the jest.config.ts needs to be updated as well.

....
  "coveragePathIgnorePatterns": [
    ...
    "src/preview/util/gitlabDriver.ts"
  ],
....
prasadtalasila commented 1 month ago

@VanessaScherma The following changes are required for package.json.

{
  ...
  "contributors": [
    ...
    "Cesar Vela",
    "Vanessa Scherma"
  ],
  ...
  "scripts": {
    "build": "npx react-scripts build",
    "clean": "npx rimraf build/ dist/ node_modules/ coverage/ playwright-report/ test-results/  test.svg src.svg src/util/gitlab.json",
    ...
    "develop": "npx react-scripts start",
    ...
    "gitlab:compile": "npx tsc --project tsconfig.gitlab.json",
    ...
  },
  ...
}

Please double check the proposed changes by running all the yarn commands suggested in DEVELOPER.md. Thanks.

codeclimate[bot] commented 1 month ago

Code Climate has analyzed commit 9938e33b and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1

View more on Code Climate.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 33.69565% with 244 lines in your changes missing coverage. Please review.

Project coverage is 64.82%. Comparing base (eaa22d5) to head (9938e33). Report is 30 commits behind head on feature/distributed-demo.

Files with missing lines Patch % Lines
client/src/preview/util/gitlabDigitalTwin.ts 6.52% 40 Missing and 3 partials :warning:
client/src/preview/util/gitlab.ts 9.30% 35 Missing and 4 partials :warning:
...eview/route/digitaltwins/execute/pipelineChecks.ts 25.00% 27 Missing and 6 partials :warning:
...preview/route/digitaltwins/DigitalTwinsPreview.tsx 37.50% 28 Missing and 2 partials :warning:
...review/route/digitaltwins/execute/pipelineUtils.ts 25.00% 22 Missing and 2 partials :warning:
...view/route/digitaltwins/execute/pipelineHandler.ts 27.58% 18 Missing and 3 partials :warning:
client/src/preview/store/digitalTwin.slice.ts 35.29% 8 Missing and 3 partials :warning:
client/src/preview/components/asset/AssetCard.tsx 62.96% 10 Missing :warning:
client/src/preview/components/asset/AssetBoard.tsx 57.14% 5 Missing and 1 partial :warning:
client/src/preview/route/digitaltwins/Snackbar.tsx 53.84% 6 Missing :warning:
... and 6 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## feature/distributed-demo #903 +/- ## ============================================================ - Coverage 66.49% 64.82% -1.68% ============================================================ Files 31 48 +17 Lines 394 813 +419 Branches 26 59 +33 ============================================================ + Hits 262 527 +265 - Misses 117 244 +127 - Partials 15 42 +27 ``` | [Files with missing lines](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | Coverage Δ | | |---|---|---| | [client/src/components/LinkIconsLib.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fcomponents%2FLinkIconsLib.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9jb21wb25lbnRzL0xpbmtJY29uc0xpYi50c3g=) | `100.00% <100.00%> (ø)` | | | [...ew/route/digitaltwins/DigitalTwinTabDataPreview.ts](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Froute%2Fdigitaltwins%2FDigitalTwinTabDataPreview.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L3JvdXRlL2RpZ2l0YWx0d2lucy9EaWdpdGFsVHdpblRhYkRhdGFQcmV2aWV3LnRz) | `100.00% <100.00%> (ø)` | | | [client/src/routes.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Froutes.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9yb3V0ZXMudHN4) | `100.00% <100.00%> (ø)` | | | [client/src/preview/store/assets.slice.ts](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Fstore%2Fassets.slice.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L3N0b3JlL2Fzc2V0cy5zbGljZS50cw==) | `83.33% <83.33%> (ø)` | | | [client/src/util/envUtil.ts](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Futil%2FenvUtil.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy91dGlsL2VudlV0aWwudHM=) | `82.05% <66.66%> (-0.81%)` | :arrow_down: | | [client/src/preview/components/asset/LogButton.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Fcomponents%2Fasset%2FLogButton.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L2NvbXBvbmVudHMvYXNzZXQvTG9nQnV0dG9uLnRzeA==) | `57.14% <57.14%> (ø)` | | | [...t/src/preview/components/asset/StartStopButton.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Fcomponents%2Fasset%2FStartStopButton.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L2NvbXBvbmVudHMvYXNzZXQvU3RhcnRTdG9wQnV0dG9uLnRzeA==) | `58.33% <58.33%> (ø)` | | | [...c/preview/route/digitaltwins/execute/LogDialog.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Froute%2Fdigitaltwins%2Fexecute%2FLogDialog.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L3JvdXRlL2RpZ2l0YWx0d2lucy9leGVjdXRlL0xvZ0RpYWxvZy50c3g=) | `58.33% <58.33%> (ø)` | | | [client/src/preview/components/asset/AssetBoard.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Fcomponents%2Fasset%2FAssetBoard.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L2NvbXBvbmVudHMvYXNzZXQvQXNzZXRCb2FyZC50c3g=) | `57.14% <57.14%> (ø)` | | | [client/src/preview/route/digitaltwins/Snackbar.tsx](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree&filepath=client%2Fsrc%2Fpreview%2Froute%2Fdigitaltwins%2FSnackbar.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association#diff-Y2xpZW50L3NyYy9wcmV2aWV3L3JvdXRlL2RpZ2l0YWx0d2lucy9TbmFja2Jhci50c3g=) | `53.84% <53.84%> (ø)` | | | ... and [9 more](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | [Components](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | Coverage Δ | | |---|---|---| | [Website](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | `64.82% <43.82%> (-1.68%)` | :arrow_down: | | [Lib Microservice](https://app.codecov.io/gh/INTO-CPS-Association/DTaaS/pull/903/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=INTO-CPS-Association) | `∅ <ø> (∅)` | |
VanessaScherma commented 1 month ago

I have applied the requested changes. The commands in DEVELOPER.md work correctly.