You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/14 11:35:10 UTC

[GitHub] [incubator-devlake] likyh opened a new pull request, #3734: fix: fix some bugs

likyh opened a new pull request, #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734

   # Summary
   
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Does this close any open issues?
   Closes #3733 
   Closes https://github.com/apache/incubator-devlake/issues/3640
   Closes https://github.com/apache/incubator-devlake/issues/3522
   Closes https://github.com/apache/incubator-devlake/issues/3490
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1021395410


##########
config-ui/src/hooks/usePipelineManager.jsx:
##########
@@ -184,18 +181,18 @@ function usePipelineManager(
     }
   }, [])
 
-  const fetchAllPipelines = useCallback((status = null, fetchTimeout = 500) => {
+  const fetchAllPipelines = useCallback((blueprintId, status = null, fetchTimeout = 500) => {

Review Comment:
   related to #3733 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1021401839


##########
config-ui/src/pages/blueprints/blueprint-detail.jsx:
##########
@@ -409,40 +335,49 @@ const BlueprintDetail = (props) => {
       )
       setCurrentRun((cR) => ({
         ...cR,
-        startedAt: activePipeline?.beganAt
-          ? dayjs(activePipeline?.beganAt).format('L LTS')
+        id: activePipeline.id,
+        status: activePipeline.status,
+        statusLabel: TaskStatusLabels[activePipeline.status],
+        icon: getTaskStatusIcon(activePipeline.status),
+        startedAt: activePipeline.beganAt
+          ? dayjs(activePipeline.beganAt).format('L LTS')
           : '-',
+        duration: [TaskStatus.CREATED, TaskStatus.RUNNING].includes(
+          activePipeline.status
+        )
+          ? dayjs(activePipeline.beganAt || activePipeline.createdAt).toNow(true)
+          : dayjs(activePipeline.beganAt).from(
+            activePipeline.finishedAt || activePipeline.updatedAt,
+              true
+            ),
         stage: `Stage ${activePipeline.stage}`,
-        status: activePipeline?.status,
-        statusLabel: TaskStatusLabels[activePipeline?.status],
-        icon: getTaskStatusIcon(activePipeline?.status)
+        tasksFinished: Number(activePipeline.finishedTasks),
+        tasksTotal: Number(activePipeline.totalTasks),
+        error: activePipeline.message || null
       }))
     }
-  }, [activePipeline, buildPipelineStages])
+  }, [activePipeline])
 
   useEffect(() => {
     console.log('>> BUILDING CURRENT STAGES...', currentStages)
   }, [currentStages])
 
   useEffect(() => {
-    if (autoRefresh && activePipeline?.id) {
-      console.log('>> ACTIVITY POLLING ENABLED!')
-      pollInterval.current = setInterval(() => {
-        fetchPipeline(activePipeline?.id)
-        // setLastPipeline(activePipeline)
-      }, pollTimer)
-    } else {
-      console.log('>> ACTIVITY POLLING DISABLED!')
-      clearInterval(pollInterval.current)
-      if (activePipeline?.id) {
-        fetchPipeline(activePipeline?.id)
-        fetchAllPipelines()
+    if (activePipeline?.id) {
+      if (autoRefresh) {
+        console.log('>> ACTIVITY POLLING ENABLED!')
+        pollInterval.current = setInterval(() => {
+          fetchPipeline(activePipeline?.id)
+          // setLastPipeline(activePipeline)
+        }, pollTimer)
+        return () => {

Review Comment:
   related to https://github.com/apache/incubator-devlake/issues/3640.
   add a return func to cancel `setInterval`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1022335359


##########
config-ui/src/components/pipelines/StageLane.jsx:
##########
@@ -130,7 +130,6 @@ const StageLane = (props) => {
 
   useEffect(() => {
     setActiveStage(stages[sK])
-    console.log('>> ACTIVE STAGE LANE', stages[sK])

Review Comment:
   nice job.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1021398169


##########
config-ui/src/components/pipelines/StageLane.jsx:
##########
@@ -130,7 +130,6 @@ const StageLane = (props) => {
 
   useEffect(() => {
     setActiveStage(stages[sK])
-    console.log('>> ACTIVE STAGE LANE', stages[sK])

Review Comment:
   related to https://github.com/apache/incubator-devlake/issues/3490



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1021408474


##########
config-ui/src/pages/blueprints/blueprint-detail.jsx:
##########
@@ -409,40 +335,49 @@ const BlueprintDetail = (props) => {
       )
       setCurrentRun((cR) => ({
         ...cR,
-        startedAt: activePipeline?.beganAt
-          ? dayjs(activePipeline?.beganAt).format('L LTS')
+        id: activePipeline.id,

Review Comment:
   related to https://github.com/apache/incubator-devlake/issues/3522.
   delete `lastPipeline` and replace with `activePipeline`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh merged pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
klesh merged PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3734: fix: fix some bugs

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3734:
URL: https://github.com/apache/incubator-devlake/pull/3734#discussion_r1021397102


##########
config-ui/src/hooks/usePipelineManager.jsx:
##########
@@ -131,9 +131,10 @@ function usePipelineManager(
     }
   }, [])
 
-  const fetchPipeline = useCallback((pipelineID, refresh = false) => {

Review Comment:
   `refresh` hasn't been used and I don't know what it means. so it has been deleted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org