Skip to content

Commit

Permalink
versatile-data-kit: git pre-commit hooks config (#1625)
Browse files Browse the repository at this point in the history
Frontend config files were failing git pre-coming hooks due:
* too large 
* JSON format inspection
* PR title prefix

License insertion now covers TypeScript, JavaScript, (S)CSS, 
HTML, Y(A)ML file types in addition.
PR titles can be now associated with "frontend" component.
Modified the pre-commit and gitlint configurations accordingly.

Testing done: installed the hook locally, and verified all
frontend/data-pipelines changes from multiple stacked PRs 
were committed and auto-modified correctly
with the code header expected.

---------

Signed-off-by: ivakoleva <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ivakoleva and pre-commit-ci[bot] committed Feb 20, 2023
1 parent fb3412e commit f976b26
Show file tree
Hide file tree
Showing 53 changed files with 214 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Google Java Format

on:
Expand Down
2 changes: 1 addition & 1 deletion .gitlint
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ contrib=contrib-body-requires-signed-off-by
# commit-msg title must be matched to.
# Note that the regex can contradict with other rules if not used correctly
# (e.g. title-must-not-contain-word).
regex=(vdk-.*|versatile-data-kit|control-service|examples): .*
regex=(vdk-.*|versatile-data-kit|control-service|examples|frontend): .*
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ repos:
# exclude helm chart templates
exclude: ^projects/control-service/projects/helm_charts
- id: check-json
exclude: (^projects/frontend/data-pipelines/gui/tsconfig.json|^projects/frontend/data-pipelines/gui/package-lock.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/.eslintrc.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.lib.prod.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.spec.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.lib.json|^projects/frontend/data-pipelines/gui/projects/ui/.eslintrc.json|^projects/frontend/data-pipelines/gui/projects/ui/tsconfig.app.json|^projects/frontend/data-pipelines/gui/projects/ui/tsconfig.spec.json)
- id: check-ast
exclude: ^projects/vdk-core/tests/functional/run/jobs/syntax-error-job/1_step.py
- id: check-added-large-files
exclude: (^projects/frontend/data-pipelines/gui/tsconfig.json|^projects/frontend/data-pipelines/gui/package-lock.json|^projects/frontend/data-pipelines/gui/projects/ui/src/assets/css/clr-ui.min.css)
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-executables-have-shebangs
Expand Down Expand Up @@ -77,6 +79,44 @@ repos:
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.ts$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.js$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.html
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- <!--| ~| -->
- id: insert-license
files: (\.scss$|\.css$)
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: (\.yaml$|\.yml$)
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- id: insert-license
files: \.py$
args:
Expand Down
3 changes: 3 additions & 0 deletions projects/control-service/cicd/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

.control_service_retry:
retry_options:
max: 1
Expand Down
3 changes: 2 additions & 1 deletion projects/control-service/cicd/trino-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

image:
repository: trinodb/trino
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: pipelines-control-service
description: A Helm chart for Versatile Data Kit Control Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.datajobTemplate.enabled }}
apiVersion: v1
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.fluentd.enabled }}
apiVersion: logs.vdp.vmware.com/v1beta1
kind: FluentdConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.dataJob.fluentd.enabled }}
apiVersion: logs.vdp.vmware.com/v1beta1
kind: FluentdConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.ingress.enabled -}}
kind: Ingress
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.alerting.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if and .Values.rbac.create .Values.rbac.datajobsDeployment.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if and .Values.serviceAccount.create .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if and .Values.serviceAccount.create .Values.rbac.create .Values.rbac.datajobsDeployment.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

## Create a secret with JDBC credentials for embedded database (PostgreSQL or CockroachDB) only if externalSecretName is not supplied.
## If any of the fields are empty, we fall-back to defaults (f.e. local dev environment)
{{- if not .Values.database.externalSecretName }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

## Create a secret with Kerberos keytab for authentication if kerberos authentication flag is turned on.
## The keytab file contents are set from the values.yaml file and are intended to be populated by an env
## variable.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.deploymentDataJobBaseImage.password }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.deploymentBuilderImage.password }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if and (eq .Values.deploymentDockerRegistryType "generic") .Values.deploymentDockerRegistryUsernameReadOnly .Values.deploymentDockerRegistryPasswordReadOnly }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if (include "shouldCreatePipelinesControlServiceDockerRepoSecret" .) }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if (include "shouldCreateVdkSdkDockerRepoSecret" .) }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: Secret
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameter(s): imageRegistry
Expand Down
3 changes: 2 additions & 1 deletion projects/frontend/cicd/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

frontend_publish_test_image:
image: docker:19.03.15
Expand Down
2 changes: 2 additions & 0 deletions projects/frontend/shared-components/cicd/.gitlab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions projects/vdk-heartbeat/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

image: "python:3.9"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
extends: [
'eslint:recommended',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = require('@jupyterlab/testutils/lib/babel.config');
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');

const esModules = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

/**
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

import { URLExt } from '@jupyterlab/coreutils';

import { ServerConnection } from '@jupyterlab/services';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

import {
JupyterFrontEnd,
JupyterFrontEndPlugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

import { requestAPI } from './handler';
import { Dialog, showErrorMessage } from '@jupyterlab/apputils';
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

export function removeCreateJobDataFromSessionStorage(){
sessionStorage.removeItem('create-job-name');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/
/*
See the JupyterLab Developer Guide for useful CSS Patterns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

@import url('base.css');
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

import './base.css';
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

.jp-vdk-input-wrapper {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

/**
* Configuration for Playwright using default from @jupyterlab/galata
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2023 VMware, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

import { expect, test } from '@jupyterlab/galata';
import { assert } from 'console';

Expand Down
Loading

0 comments on commit f976b26

Please sign in to comment.