Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into rerun-at-time
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarrsm committed Sep 29, 2023
2 parents c1f028f + 9a16e86 commit d700e31
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 101 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: |
cd db-scheduler-ui-frontend
npm install
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand All @@ -45,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repo
- name: Checkout repo
uses: actions/checkout@v3
- name: Download production-ready build files
uses: actions/download-artifact@v3
Expand All @@ -62,4 +75,4 @@ jobs:
dockerfile_directory: ./example-app/
dockerfile_name: Dockerfile
docker_options: "--no-cache"
process_type: web
process_type: web
10 changes: 10 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: PR validation

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -8,6 +10,14 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
35 changes: 12 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,27 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install
working-directory: db-scheduler-ui-frontend

- name: Build frontend
run: npm run build
working-directory: db-scheduler-ui-frontend

- name: Create static folder in backend
run: mkdir -p db-scheduler-ui/src/main/resources/static

- name: Copy static frontend to java package
run: cp -r db-scheduler-ui-frontend/dist/. db-scheduler-ui/src/main/resources/static/
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
gpg-private-key: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} # Value of the GPG private key to import
gpg-passphrase: JRELEASER_GPG_PASSPHRASE # env variable for GPG private key passphrase
gpg-private-key: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
gpg-passphrase: JRELEASER_GPG_PASSPHRASE

- name: remove v in tag
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
run: echo "VERSION=${{ github.event.release.tag_name#v }}" >> $GITHUB_ENV

- name: Set release version
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
run: mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false

- name: Stage release
run: mvn --no-transfer-progress --batch-mode -Ppublication clean deploy -DskipTests
Expand All @@ -67,4 +57,3 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}

20 changes: 18 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

jobs:
tests:
name: Run tests with spring boot version compability check
name: Run tests with spring boot version compatibility check
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -14,11 +14,27 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: |
cd db-scheduler-ui-frontend
npm install
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: run tests
- name: Run tests
run: mvn -B -Dspring-boot.version=${{ matrix.spring-boot }} clean test --file pom.xml
63 changes: 37 additions & 26 deletions db-scheduler-ui-frontend/src/components/common/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { PlayIcon, RepeatIcon } from 'src/assets/icons';
import colors from 'src/styles/colors';
import { RunAllAlert } from '../scheduled/RunAllAlert';
import { TaskDetailsRequestParams } from 'src/models/TaskRequestParams';
import { useParams } from 'react-router-dom';

interface HeaderBarProps {
params: TaskDetailsRequestParams;
Expand All @@ -47,6 +48,8 @@ interface HeaderBarProps {
history?: boolean;
setTaskNameExactMatch: (exactMatch: boolean) => void;
setTaskInstanceExactMatch: (exactMatch: boolean) => void;
taskNameExactMatch: boolean;
taskInstanceExactMatch: boolean;
}

export const HeaderBar: React.FC<HeaderBarProps> = ({
Expand All @@ -58,8 +61,12 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
history,
setTaskNameExactMatch,
setTaskInstanceExactMatch,
taskNameExactMatch,
taskInstanceExactMatch,
params,
}) => {
const { taskName: urlTaskName } = useParams<{ taskName?: string }>();
const isDetailsView = !!urlTaskName;
const [isOpen, setIsOpen] = React.useState('');
const { taskName, taskId: taskInstance, filter: currentFilter } = params;

Expand All @@ -77,7 +84,7 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
<Text ml={1} fontSize={'3xl'} fontWeight={'semibold'}>
{title}
</Text>
{taskName && (
{taskName && isDetailsView && (
<>
<Button
leftIcon={<PlayIcon />}
Expand Down Expand Up @@ -118,32 +125,35 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
)}
</Box>
<HStack>
<VStack align="start">
<Input
placeholder={'Search for task name'}
defaultValue={taskName}
onChange={(e) => setSearchTermTaskName(e.currentTarget.value)}
bgColor={colors.primary['100']}
w={'20vmax'}
mt={7}
ml={1}
/>
<Checkbox
ml={1}
onChange={(e) => setTaskNameExactMatch(e.target.checked)}
sx={{
'.chakra-checkbox__control': {
bg: colors.primary['100'],
_checked: {
bg: colors.primary['500'],
borderColor: colors.primary['500'],
{!isDetailsView && (
<VStack align="start">
<Input
placeholder={'Search for task name'}
defaultValue={taskName}
onChange={(e) => setSearchTermTaskName(e.currentTarget.value)}
bgColor={colors.primary['100']}
w={'20vmax'}
mt={7}
ml={1}
/>
<Checkbox
ml={1}
isChecked={taskNameExactMatch}
onChange={(e) => setTaskNameExactMatch(e.target.checked)}
sx={{
'.chakra-checkbox__control': {
bg: colors.primary['100'],
_checked: {
bg: colors.primary['500'],
borderColor: colors.primary['500'],
},
},
},
}}
>
Exact match
</Checkbox>
</VStack>
}}
>
Exact match
</Checkbox>
</VStack>
)}
<VStack align="start" spacing={2}>
<Input
placeholder={'Search for task id'}
Expand All @@ -158,6 +168,7 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
/>
<Checkbox
ml={1}
isChecked={taskInstanceExactMatch}
onChange={(e) => setTaskInstanceExactMatch(e.target.checked)}
sx={{
'.chakra-checkbox__control': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AccordionPanel, Box, VStack } from '@chakra-ui/react';
import { AccordionPanel, Box, Divider, Text, VStack } from '@chakra-ui/react';
import colors from 'src/styles/colors';
import { LogDataRow } from 'src/components/history/LogDataRow';
interface LogAccordionItemProps {
Expand All @@ -24,17 +24,32 @@ export const LogAccordionItem: React.FC<LogAccordionItemProps> = ({
taskData,
}) => {
return (
<AccordionPanel overflowX="auto">
<AccordionPanel overflowX="auto" p={0}>
<Box display={'flex'} justifyContent={'space-between'}></Box>
<VStack
align="start"
spacing={2}
bgColor={colors.primary['100']}
p={2}
p={0}
w={'100%'}
borderRadius={4}
>
<pre>{stackTrace}</pre>
<Text
ml={'16px'}
textDecoration={'underline'}
color={colors.primary['500']}
>
Stacktrace
</Text>
<pre style={{ marginLeft: '16px', marginTop: '8px' }}>{stackTrace}</pre>
<Divider color={colors.primary['300']} />
<Text
ml={'16px'}
textDecoration={'underline'}
color={colors.primary['500']}
>
Taskdata
</Text>
<LogDataRow taskData={taskData} />
</VStack>
</AccordionPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const LogDataRow: React.FC<{ taskData: object | null }> = ({
taskData,
}) => {
return (
<>
<Box ml={'16px'}>
{taskData !== null && (
<Box display={'flex'} flexDirection={'column'}>
<JsonViewer data={taskData} />
</Box>
)}
</>
</Box>
);
};
6 changes: 5 additions & 1 deletion db-scheduler-ui-frontend/src/components/history/LogList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export const LogList: React.FC = () => {
if (taskName || taskInstance) {
setSearchTermTaskName(taskName || '');
setSearchTermTaskInstance(taskInstance || '');
setTaskInstanceExactMatch(true);
setTaskNameExactMatch(true);
}
}, [

Check warning on line 73 in db-scheduler-ui-frontend/src/components/history/LogList.tsx

View workflow job for this annotation

GitHub Actions / Run tests with spring boot version compatibility check (2.7.15)

React Hook useEffect has missing dependencies: 'setTaskInstanceExactMatch' and 'setTaskNameExactMatch'. Either include them or remove the dependency array

Check warning on line 73 in db-scheduler-ui-frontend/src/components/history/LogList.tsx

View workflow job for this annotation

GitHub Actions / Run tests with spring boot version compatibility check (3.0.6)

React Hook useEffect has missing dependencies: 'setTaskInstanceExactMatch' and 'setTaskNameExactMatch'. Either include them or remove the dependency array

Check warning on line 73 in db-scheduler-ui-frontend/src/components/history/LogList.tsx

View workflow job for this annotation

GitHub Actions / Run tests with spring boot version compatibility check (3.1.3)

React Hook useEffect has missing dependencies: 'setTaskInstanceExactMatch' and 'setTaskNameExactMatch'. Either include them or remove the dependency array

Check warning on line 73 in db-scheduler-ui-frontend/src/components/history/LogList.tsx

View workflow job for this annotation

GitHub Actions / Build frontend and all packages

React Hook useEffect has missing dependencies: 'setTaskInstanceExactMatch' and 'setTaskNameExactMatch'. Either include them or remove the dependency array
setSearchTermTaskInstance,
Expand All @@ -78,7 +80,7 @@ export const LogList: React.FC = () => {
return (
<Box>
<HeaderBar
title={'History' + (taskName ? ' for ' + taskName : '')}
title={'History'}
params={{
filter: currentFilter,
asc: sortAsc,
Expand All @@ -97,6 +99,8 @@ export const LogList: React.FC = () => {
refetch={refetch}
setTaskNameExactMatch={setTaskNameExactMatch}
setTaskInstanceExactMatch={setTaskInstanceExactMatch}
taskNameExactMatch={taskNameExactMatch}
taskInstanceExactMatch={taskInstanceExactMatch}
history
/>
<Box mb={7}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const TaskList: React.FC = () => {
setSearchTermTaskInstance={setSearchTermTaskInstance}
setTaskNameExactMatch={setTaskNameExactMatch}
setTaskInstanceExactMatch={setTaskInstanceExactMatch}
taskNameExactMatch={taskNameExactMatch}
taskInstanceExactMatch={taskInstanceExactMatch}
refetch={refetch}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ public GetTasksResponse getAllTasks(TaskRequestParams params) {
tasks =
QueryUtils.searchByTaskInstance(
tasks, params.getSearchTermTaskInstance(), params.isTaskInstanceExactMatch());
tasks =
QueryUtils.sortTasks(
QueryUtils.filterTasks(tasks, params.getFilter()), params.getSorting(), params.isAsc());
if (!showData) {
tasks.forEach(e -> e.setTaskData(List.of()));
}
tasks = TaskMapper.groupTasks(tasks);
tasks =
QueryUtils.sortTasks(
QueryUtils.filterTasks(tasks, params.getFilter()), params.getSorting(), params.isAsc());
List<TaskModel> pagedTasks =
QueryUtils.paginate(tasks, params.getPageNumber(), params.getSize());
return new GetTasksResponse(tasks.size(), pagedTasks, params.getSize());
Expand Down
Loading

0 comments on commit d700e31

Please sign in to comment.