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

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

Conversation

VanessaScherma
Copy link
Contributor

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.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 6946 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 7108 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 7093 lines exceeds the maximum allowed for the inline comments feature.

@prasadtalasila
Copy link
Contributor

@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."

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 7103 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 7245 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 7817 lines exceeds the maximum allowed for the inline comments feature.

@prasadtalasila prasadtalasila added this to the Release v0.6.0 milestone Sep 20, 2024
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5149 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5072 lines exceeds the maximum allowed for the inline comments feature.

if (typeof log === 'string') {
log
.replace(
// TODO: Fix ansi character stripping
Copy link

Choose a reason for hiding this comment

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

TODO found

Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

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

@VanessaScherma please check the comments. Thanks for the updates.

client/config/test.js Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
{
"name": "@into-cps-association/dtaas-web",
"version": "0.4.0",
"version": "0.4.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be 0.5.0

@@ -71,6 +75,7 @@
"react-redux": "^8.1.3",
"react-router-dom": "^6.20.0",
"react-scripts": "^5.0.1",
"react-syntax-highlighter": "^15.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

not required in this PR

client/src/preview/components/asset/AssetBoard.tsx Outdated Show resolved Hide resolved
client/src/preview/components/asset/AssetBoard.tsx Outdated Show resolved Hide resolved
client/src/store/store.ts Outdated Show resolved Hide resolved
client/src/util/gitlab.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

please move this file to preview/util/gitlabDigitalTwin.ts. But we will do pair programming to move the gitlabDriver.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I move the gitlabDriver.ts now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that will be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please give better names to checkFirstPipelineStatus and checkSecondPipelineStatus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed into checkParentPipelineStatus and checkChildPipelineStatus.

digitalTwin.gitlabInstance.projectId,
digitalTwin.pipelineId,
);
await digitalTwin.stop(
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this being called twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To stop both the parent pipeline and the child pipeline.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. I guess the change of function names makes this point clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide pipeline name instead of pipelineId. The names can be parent pipeline and child pipeline. Perhaps there can be a mapping from name to id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@prasadtalasila
Copy link
Contributor

@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
Copy link
Contributor

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

....
  "coveragePathIgnorePatterns": [
    ...
    "src/preview/util/gitlabDriver.ts"
  ],
....

@prasadtalasila
Copy link
Contributor

@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.

Copy link

codeclimate bot commented Oct 6, 2024

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

Here's the issue category breakdown:

Category Count
Bug Risk 1

View more on Code Climate.

Copy link

codecov bot commented Oct 6, 2024

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 ⚠️
client/src/preview/util/gitlab.ts 9.30% 35 Missing and 4 partials ⚠️
...eview/route/digitaltwins/execute/pipelineChecks.ts 25.00% 27 Missing and 6 partials ⚠️
...preview/route/digitaltwins/DigitalTwinsPreview.tsx 37.50% 28 Missing and 2 partials ⚠️
...review/route/digitaltwins/execute/pipelineUtils.ts 25.00% 22 Missing and 2 partials ⚠️
...view/route/digitaltwins/execute/pipelineHandler.ts 27.58% 18 Missing and 3 partials ⚠️
client/src/preview/store/digitalTwin.slice.ts 35.29% 8 Missing and 3 partials ⚠️
client/src/preview/components/asset/AssetCard.tsx 62.96% 10 Missing ⚠️
client/src/preview/components/asset/AssetBoard.tsx 57.14% 5 Missing and 1 partial ⚠️
client/src/preview/route/digitaltwins/Snackbar.tsx 53.84% 6 Missing ⚠️
... and 6 more
Additional details and impacted files
@@                     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 Coverage Δ
client/src/components/LinkIconsLib.tsx 100.00% <100.00%> (ø)
...ew/route/digitaltwins/DigitalTwinTabDataPreview.ts 100.00% <100.00%> (ø)
client/src/routes.tsx 100.00% <100.00%> (ø)
client/src/preview/store/assets.slice.ts 83.33% <83.33%> (ø)
client/src/util/envUtil.ts 82.05% <66.66%> (-0.81%) ⬇️
client/src/preview/components/asset/LogButton.tsx 57.14% <57.14%> (ø)
...t/src/preview/components/asset/StartStopButton.tsx 58.33% <58.33%> (ø)
...c/preview/route/digitaltwins/execute/LogDialog.tsx 58.33% <58.33%> (ø)
client/src/preview/components/asset/AssetBoard.tsx 57.14% <57.14%> (ø)
client/src/preview/route/digitaltwins/Snackbar.tsx 53.84% <53.84%> (ø)
... and 9 more

... and 6 files with indirect coverage changes

Components Coverage Δ
Website 64.82% <43.82%> (-1.68%) ⬇️
Lib Microservice ∅ <ø> (∅)

@VanessaScherma
Copy link
Contributor Author

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

@prasadtalasila prasadtalasila merged commit 865c74b into INTO-CPS-Association:feature/distributed-demo Oct 7, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants