Skip to content

Commit

Permalink
build: switch project from formatter-maven-plugin to spotless-maven-p…
Browse files Browse the repository at this point in the history
…lugin (#287)

Signed-off-by: David Sondermann <[email protected]>
  • Loading branch information
Donnerbart authored Nov 19, 2024
1 parent 0bd1c46 commit b0a5838
Show file tree
Hide file tree
Showing 9 changed files with 887 additions and 814 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
cache: 'maven'
- name: Check code format
run: |
./mvnw ${MAVEN_ARGS} formatter:validate -Dconfigfile=$PWD/contributing/eclipse-google-style.xml --file pom.xml
./mvnw ${MAVEN_ARGS} impsort:check --file pom.xml
./mvnw ${MAVEN_ARGS} spotless:check --file pom.xml
- name: Run unit tests
run: ./mvnw ${MAVEN_ARGS} -B test --file pom.xml
spring-boot-e2e-tests:
Expand Down Expand Up @@ -92,4 +91,4 @@ jobs:
./mvnw clean install -DskipTests
cd samples/quarkus
./mvnw install -Dquarkus.container-image.build=true -DskipTests
./mvnw ${MAVEN_ARGS} test -Pend-to-end-tests
./mvnw ${MAVEN_ARGS} test -Pend-to-end-tests
98 changes: 98 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Contributing Guidelines

## How to contribute to kubernetes-webhooks-framework

We'd love to accept your patches! Since we **♥︎♥︎ LOVE ♥︎♥︎** Contributors and Contributions :-)

You can start contributing to this project by following the below guidelines:-

(We are assuming you know about git like resolving merge conflicts, squash, setting remote etc.)

### Getting Source Code

* Get the source code by doing a fork and then using the below command
```
git clone https://github.com/your_github_username/josdk-webhooks.git
```

* If you want to build/run the project, use command
```
mvn clean install
```

### Starting Development

Now you can start your contribution work.

#### * Finding the issue

There are lots of issues on kubernetes-webhooks-framework's [issue page](https://github.com/operator-framework/josdk-webhooks/issues). Please go through the issues and find a one which you want to fix/develop. If you want to implement something which is not there in the issues, please create a new issue. Please assign that new issue or already existing issue to yourself otherwise it may happen that someone else will fix the same issue.

#### Creating a new branch

Please create a new branch to start your development work. You can create the branch by any name but we will suggest you consider the naming convention like iss_issueNumber. Example - iss_989

```
git checkout -b iss_issueNumber
```

#### Create your PATCH

Do all your development or fixing work here.

#### Adding Unit and Regression Tests

After all your development/fixing work is done, do not forget to add `Unit Test` and `Regression Test` around that. It will be nice if you can add an example of the new feature you have added.

#### Check your work after running all Unit and Regression Tests

You should run all the unit tests by hitting the following command

```shell
mvn clean install
```

#### Commit your work

After all your work is done, you need to commit the changes.
```
git commit -am "Commit-Message"
```
Please add a very elaborative [commit message](https://www.conventionalcommits.org/en/v1.0.0/) for the work you have done. It will help the reviewer to understand the things quickly.

#### Rebase the PR

It may happen that during the development, someone else submitted another PATCH that is merged before yours. You need to rebase your branch with current upstream master.

#### Build the project

Before sending the PR, check whether everything is working fine. To build the project and run test
```shell
mvn clean install
```

#### Format the files that you touched

```shell
mvn spotless:apply
```

#### Push the changes to your fork

```shell
git push origin iss_issueNumber
```

#### Create a Pull Request

Please create a Pull Request from GitHub to kubernetes-webhooks-framework:main. Do not forget to provide very brief Title and elaborative description of PR. Please link the PR to issue by adding `Fix #issueNumber` at the end of the description.

### PR Review

Your PR will get reviewed soon from the maintainers of the project. If they suggest changes, do all the changes, commit the changes, rebase the branch, squash the commits and push the changes. If all will be fine, your PR will be merged.

That's it! Thank you for your contribution!

### Note

Contribution can be very small, that does not matter. We even love to receive a typo fix PR. Adding feature or fixing a bug is not the only way to contribute. You can send us PR for adding documentation, fixing typos or adding tests.
File renamed without changes.
76 changes: 36 additions & 40 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.javaoperatorsdk</groupId>
Expand All @@ -10,44 +8,8 @@
</parent>

<artifactId>kubernetes-webhooks-framework-core</artifactId>
<name>Kubernetes Webhooks Framework - Core</name>
<packaging>jar</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<!-- Used to generate the version / commit information -->
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>${git-commit-id-maven-plugin.version}</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/version.properties
</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
<includeOnlyProperty>git.branch</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
</plugins>
</build>

<name>Kubernetes Webhooks Framework - Core</name>

<dependencies>
<dependency>
Expand Down Expand Up @@ -105,4 +67,38 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<!-- Used to generate the version / commit information -->
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>${git-commit-id-maven-plugin.version}</version>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/version.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
<includeOnlyProperty>git.branch</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit b0a5838

Please sign in to comment.