Skip to content

Commit

Permalink
Merge branch 'master' into ib/upgrade-jetty
Browse files Browse the repository at this point in the history
  • Loading branch information
ibodrov authored Feb 28, 2024
2 parents 8e46eff + 0a5031c commit cfb6fb3
Show file tree
Hide file tree
Showing 101 changed files with 211 additions and 129 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Change log

## [2.9.0] - 2024-02-28

### Added

- concord-server: option to permanently disable a user
([#875](https://github.com/walmartlabs/concord/pull/875));
- tasks: asserts
([#876](https://github.com/walmartlabs/concord/pull/876));
- concord-agent, dependency-manager: support for Maven offline
mode ([#869](https://github.com/walmartlabs/concord/pull/869));
- concord-server: skip repository refresh when repo is disabled
([#872](https://github.com/walmartlabs/concord/pull/872));
- runtime-v2: threadId to task details
([#874](https://github.com/walmartlabs/concord/pull/874));
- concord-console2: add more details to trigger list
([#878](https://github.com/walmartlabs/concord/pull/878));

### Changed

- concord-console: adjust polling frequency based on client
activity
([#634](https://github.com/walmartlabs/concord/pull/634));
- runtime-v1: fix for resume from same step (bpm version up)
([#879](https://github.com/walmartlabs/concord/pull/879));
- cli: api client provider for cli (just to load tasks)
([#877](https://github.com/walmartlabs/concord/pull/877));
- ansible: add module_defaults callback, remove deprecated gather_subset in config
([#873](https://github.com/walmartlabs/concord/pull/873));
- runtime-v2: ignore empty string as sensitive data
([#871](https://github.com/walmartlabs/concord/pull/871));
- project: fix maven compiler source version in parent pom
([#870](https://github.com/walmartlabs/concord/pull/870)).



## [2.8.0] - 2024-01-15

### Added
Expand Down
2 changes: 1 addition & 1 deletion agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion client2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
16 changes: 16 additions & 0 deletions console2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions console2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "7.21.2",
"react-idle-timer": "5.4.1",
"react-json-view": "1.21.3",
"react-redux": "7.2.6",
"react-router": "5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion console2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>parent</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
35 changes: 33 additions & 2 deletions console2/src/components/organisms/ProcessActivity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { usePolling } from '../../../api/usePolling';
import RequestErrorActivity from '../RequestErrorActivity';
import { useStatusFavicon } from './favicon';
import { gitUrlParse } from '../../molecules/GitHubLink';
import { useIdleTimer } from 'react-idle-timer';

export type TabLink =
| 'status'
Expand All @@ -60,7 +61,9 @@ interface ExternalProps {
activeTab: TabLink;
}

const DATA_FETCH_INTERVAL = 5000;
const DATA_FETCH_INTERVAL_ACTIVE = 5_000;
const DATA_FETCH_INTERVAL_IDLE = 60_000;
const IDLE_TIMEOUT = 1_000 * 60 * 10;

const normalizePath = (p: string) => {
let result = p;
Expand Down Expand Up @@ -109,6 +112,11 @@ const ProcessActivity = (props: ExternalProps) => {
const [loading, setLoading] = useState<boolean>(false);
const loadingCounter = useRef<number>(0);
const [refresh, toggleRefresh] = useState<boolean>(false);
const [dataFetchInterval, setDataFetchInterval] = useState(
document.visibilityState === 'visible'
? DATA_FETCH_INTERVAL_ACTIVE
: DATA_FETCH_INTERVAL_IDLE
);

const loadingHandler = useCallback((inc: number) => {
loadingCounter.current += inc;
Expand Down Expand Up @@ -139,7 +147,21 @@ const ProcessActivity = (props: ExternalProps) => {
toggleRefresh((prevState) => !prevState);
}, []);

const error = usePolling(fetchData, DATA_FETCH_INTERVAL, loadingHandler, refresh);
useIdleTimer({
timeout: IDLE_TIMEOUT,
immediateEvents: ['visibilitychange'],
onActive: (event?: Event) => {
// this essentially prevents a data fetch on processes we already know are "final"
if (process !== undefined && !isFinal(process.status)) {
setDataFetchInterval(DATA_FETCH_INTERVAL_ACTIVE);
}
},
onIdle: () => {
setDataFetchInterval(DATA_FETCH_INTERVAL_IDLE);
}
});

const error = usePolling(fetchData, dataFetchInterval, loadingHandler, refresh);

if (error) {
return <RequestErrorActivity error={error} />;
Expand Down Expand Up @@ -205,6 +227,7 @@ const ProcessActivity = (props: ExternalProps) => {
loadingHandler={loadingHandler}
forceRefresh={refresh}
refreshHandler={refreshHandler}
dataFetchInterval={dataFetchInterval}
/>
</Route>

Expand All @@ -215,13 +238,15 @@ const ProcessActivity = (props: ExternalProps) => {
loadingHandler={loadingHandler}
forceRefresh={refresh}
definitionLinkBase={buildDefinitionLinkBase(process)}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route path={`${baseUrl}/ansible`}>
<ProcessAnsibleActivity
instanceId={instanceId}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route path={`${baseUrl}/log`} exact={true}>
Expand All @@ -232,6 +257,7 @@ const ProcessActivity = (props: ExternalProps) => {
processStatus={process ? process.status : undefined}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
)}
{process && process.runtime === 'concord-v2' && (
Expand All @@ -240,6 +266,7 @@ const ProcessActivity = (props: ExternalProps) => {
processStatus={process ? process.status : undefined}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
)}
</Route>
Expand All @@ -248,6 +275,7 @@ const ProcessActivity = (props: ExternalProps) => {
instanceId={instanceId}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route path={`${baseUrl}/wait`} exact={true}>
Expand All @@ -256,6 +284,7 @@ const ProcessActivity = (props: ExternalProps) => {
processStatus={process ? process.status : undefined}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route path={`${baseUrl}/children`} exact={true}>
Expand All @@ -264,6 +293,7 @@ const ProcessActivity = (props: ExternalProps) => {
processStatus={process ? process.status : undefined}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route path={`${baseUrl}/attachments`} exact={true}>
Expand All @@ -272,6 +302,7 @@ const ProcessActivity = (props: ExternalProps) => {
processStatus={process ? process.status : undefined}
loadingHandler={loadingHandler}
forceRefresh={refresh}
dataFetchInterval={dataFetchInterval}
/>
</Route>
<Route component={NotFoundPage} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ interface ExternalProps {
loadingHandler: (inc: number) => void;
processStatus?: ProcessStatus;
forceRefresh: boolean;
dataFetchInterval: number;
}

const DATA_FETCH_INTERVAL = 5000;

const ProcessAttachmentsActivity = ({
instanceId,
processStatus,
loadingHandler,
forceRefresh
forceRefresh,
dataFetchInterval
}: ExternalProps) => {
const [data, setData] = useState<string[]>();

Expand All @@ -53,7 +53,7 @@ const ProcessAttachmentsActivity = ({
return !isFinal(processStatus);
}, [instanceId, processStatus]);

const error = usePolling(fetchData, DATA_FETCH_INTERVAL, loadingHandler, forceRefresh);
const error = usePolling(fetchData, dataFetchInterval, loadingHandler, forceRefresh);

if (error) {
return <RequestErrorActivity error={error} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ import RequestErrorActivity from '../RequestErrorActivity';
import { useCallback, useEffect, useRef, useState } from 'react';
import { usePolling } from '../../../api/usePolling';

const DATA_FETCH_INTERVAL = 5000;

const COLUMNS = [
STATUS_COLUMN,
INSTANCE_ID_COLUMN,
Expand All @@ -58,13 +56,15 @@ interface ExternalProps {
loadingHandler: (inc: number) => void;
processStatus?: ProcessStatus;
forceRefresh: boolean;
dataFetchInterval: number;
}

const ProcessChildrenActivity = ({
instanceId,
loadingHandler,
processStatus,
forceRefresh
forceRefresh,
dataFetchInterval
}: ExternalProps) => {
const isInitialMount = useRef(true);
const location = useLocation();
Expand Down Expand Up @@ -94,7 +94,7 @@ const ProcessChildrenActivity = ({
return !isFinal(processStatus);
}, [instanceId, searchFilter, processStatus]);

const error = usePolling(fetchData, DATA_FETCH_INTERVAL, loadingHandler, forceRefresh);
const error = usePolling(fetchData, dataFetchInterval, loadingHandler, forceRefresh);

const onRefresh = useCallback(
(processFilters?: ProcessFilters, paginationFilters?: Pagination) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ interface ExternalProps {
forceRefresh: boolean;
processStatus?: ProcessStatus;
definitionLinkBase?: string;
dataFetchInterval: number;
}

const DATA_FETCH_INTERVAL = 5000;

const ProcessEventsActivity = (props: ExternalProps) => {
const { instanceId, processStatus, loadingHandler, forceRefresh, definitionLinkBase } = props;
const { instanceId, processStatus, loadingHandler, forceRefresh, definitionLinkBase, dataFetchInterval } = props;

const lastEventId = useRef<number>();

Expand All @@ -71,7 +71,7 @@ const ProcessEventsActivity = (props: ExternalProps) => {
return !(events.length === 0 && isFinal(processStatus));
}, [instanceId, processStatus]);

const error = usePolling(fetchData, DATA_FETCH_INTERVAL, loadingHandler, forceRefresh);
const error = usePolling(fetchData, dataFetchInterval, loadingHandler, forceRefresh);

if (error) {
return <RequestErrorActivity error={error} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ interface ExternalProps {
instanceId: ConcordId;
loadingHandler: (inc: number) => void;
forceRefresh: boolean;
dataFetchInterval: number;
}

const DATA_FETCH_INTERVAL = 5000;

const ProcessHistoryActivity = ({ instanceId, loadingHandler, forceRefresh }: ExternalProps) => {
const ProcessHistoryActivity = ({ instanceId, loadingHandler, forceRefresh, dataFetchInterval }: ExternalProps) => {
const [data, setData] = useState<ProcessHistoryEntry[]>();

const fetchData = useCallback(async () => {
Expand All @@ -46,7 +45,7 @@ const ProcessHistoryActivity = ({ instanceId, loadingHandler, forceRefresh }: Ex
return !isFinal(process.status);
}, [instanceId]);

const error = usePolling(fetchData, DATA_FETCH_INTERVAL, loadingHandler, forceRefresh);
const error = usePolling(fetchData, dataFetchInterval, loadingHandler, forceRefresh);

if (error) {
return <RequestErrorActivity error={error} />;
Expand Down
Loading

0 comments on commit cfb6fb3

Please sign in to comment.