Skip to content

Commit

Permalink
cleanup: fix java linting errors (#131)
Browse files Browse the repository at this point in the history
* improvement: add mysql support for the inventory service (#89)

* fix: remove incorrect delimiter in skaffold

* ci: add skaffold build step

* fix: namespace error in cloudbuild

* fix: the cloudbuild config for gcloud

* fix: the pr number prefix

* cleanup: use kubectl image

* cleanup: format cloudbuild file

* fix: pr prefix

* fix: change underscore to hyphen

* cleanup: update kubectl image in skaffold builder

* fix: kubectl command

* cleanup: add correct node version tag

* cleanup: update namepsace yaml creation

* cleanup: update the skaffold image usage

* cleanup: split the gcloud command

* cleanup: fix extra quotes

* fix: split the cloudbuild step commands

* cleanup: move gcloud and skaffold into a file

* cleanup: split the exec command

* fix: add skaffold build and deploy steps

* cleanup: add timeout to build

* cleanup: remove unused image

* cleanup: remove unused file

* process: add options related t custom sa

* cleanup: write logs to bucket

* test: trigger ci

* test: trigger ci

* cleanup: remove unnecessary skaffold steps

* cleanup:migrate to new project

* cleanup:migrate to new project

* test: check builds

* test: check builds

* test: check builds

* ci: add cleanup step

* ci: fix merge commits

* ci: add steps to deploy main to staging

* test: check builds

* ci: split the deploy steps

* test: check builds

* test: check builds

* test: check builds

* ci: remove the maven clean

* ci: fix repo name

* ci: fix repo name

* ci: comment the artifact maven plugin

* ci: add mvn clean step before skaffold

* ci: run the maven wrapper

* ci run the mvnw first

* ci: remove mvnw

* ci: remove mvnw

* ci: make mvnw executable

* ci: add mvnw back

* ci: add mvnw to the merge to pr step

* doc: minor fix (#87)

* doc: test pr (#88)

* doc: minor fix

* test: check builds

* test: check builds

* fix: remove maven clean

* fix: remove maven clean

* ci: remove initial mvn install

* test: check builds

* cleanup: change master to main

* improvement: add db access layer to the inventory service

* improvement: complete mysql to inventory service

* ci: add license header

* fix: skip datasource loading with payments and apiserver

* fix: explude JDBC in tests

* cleanup: remove the exclusion rule in test

* fix: NPE

* test: check builds

* test: exclude hibernate

* add: spring profiles and h2 db

* improvement: add mysql manifest

* improvement: split skaffold with profiles

* doc: add readme

* fix: update the skaffold commands

* lint: remove unnecessary extra line

* cleanup: add region tags

* cleanup: add profiles for db

* config: fix skaffold ot point to correct repo for mysql

* config: move build to the dev profile

* fix: skaffold error with 3p images

* ci: add inmemory profile to the pr cloudbuild yaml

* ci: add deployment type suffix to tag

* cleanup: fix region tags

* ci: update cleanup and staging ci yamls

* ci: increase timeout

* doc: add details for inmemory profile

* improvement: add mysql payments (#90)

* fix: remove incorrect delimiter in skaffold

* ci: add skaffold build step

* fix: namespace error in cloudbuild

* fix: the cloudbuild config for gcloud

* fix: the pr number prefix

* cleanup: use kubectl image

* cleanup: format cloudbuild file

* fix: pr prefix

* fix: change underscore to hyphen

* cleanup: update kubectl image in skaffold builder

* fix: kubectl command

* cleanup: add correct node version tag

* cleanup: update namepsace yaml creation

* cleanup: update the skaffold image usage

* cleanup: split the gcloud command

* cleanup: fix extra quotes

* fix: split the cloudbuild step commands

* cleanup: move gcloud and skaffold into a file

* cleanup: split the exec command

* fix: add skaffold build and deploy steps

* cleanup: add timeout to build

* cleanup: remove unused image

* cleanup: remove unused file

* process: add options related t custom sa

* cleanup: write logs to bucket

* test: trigger ci

* test: trigger ci

* cleanup: remove unnecessary skaffold steps

* cleanup:migrate to new project

* cleanup:migrate to new project

* test: check builds

* test: check builds

* test: check builds

* ci: add cleanup step

* ci: fix merge commits

* ci: add steps to deploy main to staging

* test: check builds

* ci: split the deploy steps

* test: check builds

* test: check builds

* test: check builds

* ci: remove the maven clean

* ci: fix repo name

* ci: fix repo name

* ci: comment the artifact maven plugin

* ci: add mvn clean step before skaffold

* ci: run the maven wrapper

* ci run the mvnw first

* ci: remove mvnw

* ci: remove mvnw

* ci: make mvnw executable

* ci: add mvnw back

* ci: add mvnw to the merge to pr step

* doc: minor fix (#87)

* doc: test pr (#88)

* doc: minor fix

* test: check builds

* test: check builds

* fix: remove maven clean

* fix: remove maven clean

* ci: remove initial mvn install

* test: check builds

* cleanup: change master to main

* improvement: add db access layer to the inventory service

* improvement: complete mysql to inventory service

* ci: add license header

* improvement: add mysql to payments

* improvement: add db stuff to payments service

* lint: add header

* fix: skip datasource loading with payments and apiserver

* fix: explude JDBC in tests

* cleanup: remove the exclusion rule in test

* fix: NPE

* test: check builds

* test: exclude hibernate

* add: spring profiles and h2 db

* improvement: add mysql manifest

* improvement: split skaffold with profiles

* doc: add readme

* fix: update the skaffold commands

* lint: remove unnecessary extra line

* cleanup: add region tags

* cleanup: point to new project ci

* cleanup: remove command activation in skaffold

* ci: fix the skaffold profile definintion

* skaffold: add snapshot tag until first release

* doc: add comment with the link to the builder

* cleanup: add profiles for db

* config: fix skaffold ot point to correct repo for mysql

* config: move build to the dev profile

* fix: skaffold error with 3p images

* ci: add inmemory profile to the pr cloudbuild yaml

* ci: add deployment type suffix to tag

* cleanup: fix region tags

* ci: update cleanup and staging ci yamls

* ci: increase timeout

* ci: add encrypted token

* fix: cloudbuild yaml for gh token

* fix: remove linebreak

* fix: remove linebreak

* test: check builds

* ci: format

* fix: gh command

* cleanup: update app.properties for payments

* fix: quotation issue in jsonpath

* ci: split Ip fetching to a script

* ci: update the image for the github ci

* cleanup: remove the inmemory payment impl

* ci: fix the comment step in the build

* ci: fix the substitution variable rrors

* cleanup: remove unused class

* cleanup: remove ref to deleted class

* ci: add markdown syntax for URL

* fix: invalid import statement

* fix: removed fields during merge

* cldeanup: remove extra space

* test: check builds

* ci: update the gh comment

* test: check builds

* fix: error with the incorrect annotation

* cleanup: remove unnecessary annotations

* fix: mysql warning (#110)

* doc: restructure

* doc: fix region tag

* doc: fix region tags

* cleanup: update the skaffold file

* cleanup: add project suffix to the pom

* cleanup: fix path error in cloudbuild yaml

* fix: update the cloudbuild yamls

* cleanup: add the mvnwrapper

* lint: add correct license year

* fix: update the header

* fix: clpoudbuil yaml

* ci: add dir for deploy step

* ci: revert cloudbuild changes

* cleanup: maintain point-of-sale-app folder as is in main

* header: fix year

* cleanup: remove and add

* fix: header check error

* test: find directory

* test: find directory

* test: find directory

* cleanup: move maven wrapper to the root

* cleanup: add relativePath to parent pom

* cleanup: update the push to main yaml

* fix: the path issue in the apiserver pom

* doc: restructure directories and add quickstart (#115)

* doc: restructure

* doc: fix region tag

* doc: fix region tags

* cleanup: update the skaffold file

* cleanup: add project suffix to the pom

* cleanup: fix path error in cloudbuild yaml

* fix: update the cloudbuild yamls

* cleanup: add the mvnwrapper

* lint: add correct license year

* fix: update the header

* fix: clpoudbuil yaml

* ci: add dir for deploy step

* ci: revert cloudbuild changes

* test: find directory

* test: find directory

* test: find directory

* cleanup: move maven wrapper to the root

* cleanup: add relativePath to parent pom

* cleanup: update the push to main yaml

* fix: the path issue in the apiserver pom

* release: add initial releaser code

* release: fix str error

* cleanup: get xml parser working

* cleanuP: fix pom linting

* cleanup: add extra linebreak

* fix: merge conflict

* cleanup: linting in ui pom

* improvement: add logic to update package.json

* lint: reformat the pom

* lint: remove extra space

* chore(release): 0.1.0-SNAPSHOT

* Revert "chore(release): 0.1.0-SNAPSHOT"

This reverts commit 8f3fae2.

* chore(release): 0.1.0-SNAPSHOT

* Revert "chore(release): 0.1.0-SNAPSHOT"

This reverts commit fdb238f.

* cleanup: add changlog packagejson

* fix: add code to update release pkg json

* fix: indent on pkf json

* fix: indent on pkf json

* process: add release trigger

* fix: escape env subs

* chore: add branch name

* chore: add pip install step

* chore: add git branch

* chore: add remote

* test: show remote

* test: show remote

* test: show remote

* test: show remote

* test: show remote

* test: show remote

* release: update version before release

* Revert "release: update version before release"

This reverts commit 00e36d9.

* cleanup: remove username from git

* test: show remote

* test: set branch

* test: set branch

* test: set branch

* test: set branch

* test: set branch

* test: set branch

* release: update version before release

* Revert "release: update version before release"

This reverts commit db838c5.

* test: set branch

* release: update version before release

* cleanup: add clarifying comment

* Revert "release: update version before release"

This reverts commit c6590f6.

* chore: set github email secret

* release: update version before release

* Revert "release: update version before release"

This reverts commit f2649c4.

* release: update version before release

* chore: add publish yaml

* Revert "release: update version before release"

This reverts commit ff14e7f.

* release: update version before release

* Revert "release: update version before release"

This reverts commit 110a1bc.

* chore: add build step for deploying images

* chore: add python step to publish yaml

* chore: update releaser to print version

* chore: rearrange code

* release: update version before release

* chore: fix version error

* Revert "release: update version before release"

This reverts commit 550eb9c.

* release: update version before release

* Revert "release: update version before release"

This reverts commit 65bd83f.

* chore: fix substution variable

* release: update version before release

* Revert "release: update version before release"

This reverts commit 3fe4f54.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit ec7b888.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit abbdbd4.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit ececb4d.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit 4208bd6.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit 9642318.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit 9aebc49.

* chore: fix the version and deps

* release: update version before release

* Revert "release: update version before release"

This reverts commit 0039752.

* cleanup: rearrange yamls

* improv: add yaml update logic

* chore: add logic to update all yamls

* chore: add new lines

* chore: reorder the updates

* release: update version before release

* chore: updated release script

* chore: uncomment the file edit

* chore: rearrange the prints

* chore: add new argument

* chore: update the releaser to take patch as the next release version

* chore: add logic to set SNAPSHOT version

* chore: fix incorrect variable bug

* chore: fix releaser release versioning

* chore: update release yaml files

* chore: complete the release yamls

* chore: save merge conflict resolution

* chore: set root pom to SNAPSHOT

* chore: fix bash error

* release: update version before release

* chore: update commit msg checks

* chore: add formatting

* Revert "release: update version before release"

This reverts commit 7d5aad9.

* release: update version before release

* chore: fix versions

* chore: fix commit message

* release: update version before release

* chore: fix formatting

* Revert "release: update version before release"

This reverts commit 20f362a.

* chore: add email token to build file

* release: update version before release

* Revert "release: update version before release"

This reverts commit ee086cc.

* chore add deploy script

* chore: fix branch error

* release: update version before release

* release: update version before release

* release: update version before release

* Revert "release: update version before release"

This reverts commit 4473cb5.

* chore: fix version.txt error

* chore: fix deploy ci

* chore: update print message

* chore: enhance comment message

* chore(release): 0.1.0

* chore(release): 0.1.1

* chore: fix comment msg

* chore: remove mvn install

* chore: reorganize the deploy yaml

* cleanup: revert changes inside the point-of-sale-app folder to match main (#116)

* doc: restructure

* doc: fix region tag

* doc: fix region tags

* cleanup: update the skaffold file

* cleanup: add project suffix to the pom

* cleanup: fix path error in cloudbuild yaml

* fix: update the cloudbuild yamls

* cleanup: add the mvnwrapper

* lint: add correct license year

* fix: update the header

* fix: clpoudbuil yaml

* ci: add dir for deploy step

* ci: revert cloudbuild changes

* cleanup: maintain point-of-sale-app folder as is in main

* header: fix year

* cleanup: remove and add

* fix: header check error

* test: find directory

* test: find directory

* test: find directory

* cleanup: move maven wrapper to the root

* cleanup: add relativePath to parent pom

* cleanup: update the push to main yaml

* chore: add gh release step

* chore: rename common service fiel names

* chore: update the skaffold file to have services

* chore: fix region tag

* chore: force

* chore: fix bash err

* release: update version before release

* release: bump version to next snapshot

* chore: update release messafe

* Revert "release: bump version to next snapshot"

This reverts commit 7f54c9a.

* Revert "release: update version before release"

This reverts commit e57bfdf.

* chore: add readme for release

* doc: improve release doc

* doc: add more release steps

* doc: add more release steps

* doc: add more release steps

* doc: add more release steps

* doc: add more release steps

* doc: add more release steps

* doc: add more release steps

* chore: remove branch ref

* chore: update the README

* chore: rename relese yaml

* doc: add release link to the main README

* doc: update doc size

* doc: add note to click to enlarge

* doc: add contrib doc

* doc: note about Googler release

* doc: fix hyperlonk

* doc: add inital steps

* doc: add inital guide

* doc: add section for skaffold run

* doc: add section

* doc: add section

* doc: add section

* doc: add section

* doc: add section

* doc: add ui build setup

* doc: fix hyperlinks

* doc: add indentation

* doc: add linebreaks

* doc: add local dev instrcution to main readme

* cleanup: remove release please

* cleanup: remove the old folders

* doc: add docstring for the releaser

* doc: add references to this application

* fix: java lint errors

* fix: revert pom changes

* cleanup: add the coveo plugin for formatting

* cleanup: add maven verify step

* fix: change the cloudbuilder

* fix: use installed mvn
  • Loading branch information
Shabirmean committed May 12, 2022
1 parent ad18938 commit f36cca4
Show file tree
Hide file tree
Showing 31 changed files with 274 additions and 218 deletions.
24 changes: 19 additions & 5 deletions .github/cloudbuild/pos-pr-open-to-main.yaml
Expand Up @@ -18,9 +18,9 @@
###########################################################

steps:
###########################################################
# npm install to ensure ui dependencies have no errors
###########################################################
###########################################################
# npm install to ensure ui dependencies have no errors
###########################################################
- id: 'npm-install'
name: 'node:16.14.0'
dir: 'src/ui'
Expand All @@ -29,11 +29,25 @@ steps:
# indicates that the step need not wait for any other step
waitFor: [ '-' ]

###########################################################
# Verify that Java code has no errors
###########################################################
- id: 'maven-verify-java'
name: 'gcr.io/cloud-builders/mvn'
entrypoint: bash
args:
- -c
- |
# This will only check and report errors. Can fix them by using [./mvnw com.coveo:fmt-maven-plugin:format]
mvn clean verify -DskipTests
# indicates that the step need not wait for any other step
waitFor: [ '-' ]

###########################################################
# create namespace yaml for the PR
###########################################################
- id: 'create-namespace.yaml'
name: ubuntu
name: 'ubuntu'
entrypoint: bash
args:
- -c
Expand Down Expand Up @@ -75,7 +89,7 @@ steps:
# create the skaffold deploy script
###########################################################
- id: 'create-skaffold-exec-script'
name: ubuntu
name: 'ubuntu'
entrypoint: bash
args:
- -c
Expand Down
5 changes: 5 additions & 0 deletions .mvn/jvm.config
@@ -0,0 +1,5 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
30 changes: 28 additions & 2 deletions pom.xml
Expand Up @@ -45,6 +45,8 @@
<maven-checkstyle.plugin.version>3.1.2</maven-checkstyle.plugin.version>
<maven-surefire.plugin.version>2.22.2</maven-surefire.plugin.version>
<jacoco-maven.plugin.version>0.8.7</jacoco-maven.plugin.version>
<coveo-fmt-maven-plugin.version>2.13</coveo-fmt-maven-plugin.version>
<googlejavaformat.version>1.15.0</googlejavaformat.version>
<artifactregistry-maven-wagon.extension.version>2.1.5
</artifactregistry-maven-wagon.extension.version>
</properties>
Expand Down Expand Up @@ -109,12 +111,12 @@
<dependency>
<groupId>com.google.abm-edge</groupId>
<artifactId>ui</artifactId>
<version>${pom.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.abm-edge</groupId>
<artifactId>service-sdk</artifactId>
<version>${pom.version}</version>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -161,6 +163,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${coveo-fmt-maven-plugin.version}</version>
<configuration>
<style>google</style>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>${googlejavaformat.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<!-- <phase>validate</phase> -->
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<extensions>
Expand Down
5 changes: 5 additions & 0 deletions src/api-server/pom.xml
Expand Up @@ -126,6 +126,11 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<!--Coveo plugin is used to validate for code formatting. It uses 'google-java-format'-->
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -19,32 +19,27 @@
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
* The main entry point into the api-server of the point-of-sale application stack. This class
* serves the key requirement of starting the Springboot service and the embedded web server along
* wih to start accepting requests
*
* <p>The api-server service APIs are the only publicly-accessible APIs in stack. All requests to the
* other services essentially pass-through this service. The static files from the UI consume the
* api-server APIs to load items and process payment
* <p>The api-server service APIs are the only publicly-accessible APIs in stack. All requests to
* the other services essentially pass-through this service. The static files from the UI consume
* the api-server APIs to load items and process payment
*/
@SpringBootApplication
public class ApiServerApplication {
private static final Logger LOGGER =
LogManager.getLogger(ApiServerApplication.class);
private static final Logger LOGGER = LogManager.getLogger(ApiServerApplication.class);

public static void main(String[] args) {
SpringApplication.run(ApiServerApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(ApiServerApplication.class, args);
}

/** A utility method to print out a log message when the Springboot application terminates */
@PreDestroy
public void destroy() {
LOGGER.info("Api-Server is shutting down");
}
/** A utility method to print out a log message when the Springboot application terminates */
@PreDestroy
public void destroy() {
LOGGER.info("Api-Server is shutting down");
}
}

0 comments on commit f36cca4

Please sign in to comment.