Update Code Q integrations (#276)
* Update Code Q integrations * Code Q improvements (#277)
This commit is contained in:
parent
3cab34dca7
commit
c908ae6967
11 changed files with 37 additions and 71 deletions
10
.github/workflows/backend.yml
vendored
10
.github/workflows/backend.yml
vendored
|
@ -1,12 +1,8 @@
|
|||
name: backend
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "master"
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
- "!master"
|
||||
paths-ignore:
|
||||
- 'kafka-ui-react-app/**'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -33,4 +29,4 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
||||
|
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
|
@ -28,7 +28,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'java', 'javascript' ]
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
|
51
.github/workflows/frontend.yaml
vendored
51
.github/workflows/frontend.yaml
vendored
|
@ -1,29 +1,24 @@
|
|||
name: frontend
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "master"
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
- "!master"
|
||||
paths:
|
||||
- './kafka-ui-contract/**'
|
||||
- './kafka-ui-react-app/**'
|
||||
jobs:
|
||||
npm-test:
|
||||
needs: [mvn-contract-build]
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: dev
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "14"
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: generated-sources
|
||||
path: kafka-ui-react-app/src/generated-sources
|
||||
- name: Cache node dependency
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
|
@ -35,6 +30,10 @@ jobs:
|
|||
run: |
|
||||
cd kafka-ui-react-app/
|
||||
npm install
|
||||
- name: Generate sources
|
||||
run: |
|
||||
cd kafka-ui-react-app/
|
||||
npm run gen:sources
|
||||
- name: Linter
|
||||
run: |
|
||||
cd kafka-ui-react-app/
|
||||
|
@ -43,28 +42,10 @@ jobs:
|
|||
run: |
|
||||
cd kafka-ui-react-app/
|
||||
npm run test
|
||||
|
||||
mvn-contract-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v1
|
||||
- name: SonarCloud Scan
|
||||
uses: workshur/sonarcloud-github-action@improved_basedir
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-contract-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-contract-
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.13
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.13
|
||||
- name: Build with Maven
|
||||
run: |
|
||||
cd kafka-ui-contract
|
||||
mvn clean package
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: generated-sources
|
||||
path: kafka-ui-contract/target/generated-sources/frontend
|
||||
projectBaseDir: ./kafka-ui-react-app
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}
|
||||
|
|
4
kafka-ui-react-app/sonar-project.properties
Normal file
4
kafka-ui-react-app/sonar-project.properties
Normal file
|
@ -0,0 +1,4 @@
|
|||
sonar.projectKey=provectus_kafka-ui_frontend
|
||||
sonar.organization=provectus
|
||||
|
||||
sonar.sources=./src
|
|
@ -33,7 +33,7 @@ const LatestVersionItem: React.FC<LatestVersionProps> = ({
|
|||
</div>
|
||||
<div className="tile is-parent">
|
||||
<div className="tile is-child box py-1">
|
||||
<JSONViewer data={JSON.parse(schema as string)} />
|
||||
<JSONViewer data={JSON.parse(schema)} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,7 @@ const SchemaVersion: React.FC<SchemaVersionProps> = ({
|
|||
<td>{version}</td>
|
||||
<td>{id}</td>
|
||||
<td className="py-0">
|
||||
<JSONViewer data={JSON.parse(schema as string)} />
|
||||
<JSONViewer data={JSON.parse(schema)} />
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
|
|
|
@ -57,15 +57,14 @@ const List: React.FC<ListProps> = ({
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{schemas.length > 0 ? (
|
||||
schemas.map((subject) => (
|
||||
<ListItem key={subject.id} subject={subject} />
|
||||
))
|
||||
) : (
|
||||
{schemas.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={10}>No schemas found</td>
|
||||
</tr>
|
||||
)}
|
||||
{schemas.map((subject) => (
|
||||
<ListItem key={subject.id} subject={subject} />
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@ export interface NewProps {
|
|||
createSchema: (
|
||||
clusterName: ClusterName,
|
||||
newSchemaSubject: NewSchemaSubject
|
||||
) => void;
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
const New: React.FC<NewProps> = ({ createSchema }) => {
|
||||
|
|
|
@ -85,15 +85,14 @@ const List: React.FC<Props> = ({
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{items.length > 0 ? (
|
||||
items.map((topic) => (
|
||||
<ListItem key={topic.name} topic={topic} />
|
||||
))
|
||||
) : (
|
||||
{items.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={10}>No topics found</td>
|
||||
</tr>
|
||||
)}
|
||||
{items.map((topic) => (
|
||||
<ListItem key={topic.name} topic={topic} />
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<Pagination totalPages={totalPages} />
|
||||
|
|
|
@ -7,11 +7,10 @@ import {
|
|||
TopicFormDataRaw,
|
||||
} from 'redux/interfaces';
|
||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||
import { createTopic } from 'redux/actions';
|
||||
import { createTopic, createTopicAction } from 'redux/actions';
|
||||
import { getTopicCreated } from 'redux/reducers/topics/selectors';
|
||||
import { clusterTopicPath } from 'lib/paths';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import * as actions from 'redux/actions';
|
||||
import New from './New';
|
||||
|
||||
interface RouteProps {
|
||||
|
@ -42,7 +41,7 @@ const mapDispatchToProps = (
|
|||
redirectToTopicPath: (clusterName: ClusterName, topicName: TopicName) => {
|
||||
history.push(clusterTopicPath(clusterName, topicName));
|
||||
},
|
||||
resetUploadedState: () => dispatch(actions.createTopicAction.failure()),
|
||||
resetUploadedState: () => dispatch(createTopicAction.failure()),
|
||||
});
|
||||
|
||||
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(New));
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
sonar.projectKey=provectus_kafka-ui
|
||||
sonar.organization=provectus
|
||||
|
||||
# This is the name and version displayed in the SonarCloud UI.
|
||||
#sonar.projectName=kafka-ui
|
||||
#sonar.projectVersion=1.0
|
||||
|
||||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
||||
#sonar.sources=.
|
||||
|
||||
# Encoding of the source code. Default is default system encoding
|
||||
#sonar.sourceEncoding=UTF-8
|
Loading…
Add table
Reference in a new issue