Skip to content

Commit

Permalink
Lint new changes from develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
florianrusch-zf committed Mar 28, 2023
1 parent 84d58ee commit 36b25f3
Show file tree
Hide file tree
Showing 29 changed files with 195 additions and 165 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Changed

- Support unauthenticated access to the ObservabilityAPI (#126)

### Fixed
Expand All @@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
corresponding [documentation](/docs/migration/Version_0.1.x_0.3.x.md).

### Added

- Add contract id to data source http call (#732)
- Support also support releases in ci pipeline
- Introduce typed object for oauth2 provisioning
Expand All @@ -40,6 +42,7 @@ corresponding [documentation](/docs/migration/Version_0.1.x_0.3.x.md).
- Feature: Sftp Provisioner and Client (#554)

### Changed

- Support horizontal edc scaling in cp adapter extension (#678)
- Use upstream jackson version (#741)
- Replace provision-oauth2 with data-plane-http-oauth2
Expand All @@ -61,12 +64,14 @@ corresponding [documentation](/docs/migration/Version_0.1.x_0.3.x.md).
- update description of supporting infrastructure deployment (#616)

### Fixed

- bugfix: Fix slow AES encryption (#746)
- Fix typo in tractusx-connector values.yaml comment
- Fix not working docu link in README.md
- Fix typo in control-plane adapter README

### Dependency updates

- Bump EDC to 20220220 (#767)
- Bump alpine (#749)
- Bump alpine (#750)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a found vulnerability here: <https://www.eclipse.org/security/>
Please report a found vulnerability here: <https://www.eclipse.org/security/>
4 changes: 2 additions & 2 deletions charts/edc-controlplane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ EDC Control-Plane - The Eclipse DataSpaceConnector administration layer with res
## TL;DR

```shell
$ helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
$ helm install my-release tractusx-edc/edc-controlplane --version 0.3.0
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/edc-controlplane --version 0.3.0
```

## Values
Expand Down
4 changes: 2 additions & 2 deletions charts/edc-controlplane/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
## TL;DR

```shell
$ helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
$ helm install my-release tractusx-edc/edc-controlplane --version {{ .Version }}
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/edc-controlplane --version {{ .Version }}
```

{{ template "chart.maintainersSection" . }}
Expand Down
4 changes: 2 additions & 2 deletions charts/edc-dataplane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ EDC Data-Plane - The Eclipse DataSpaceConnector data layer with responsibility o
## TL;DR

```shell
$ helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
$ helm install my-release tractusx-edc/edc-dataplane --version 0.3.0
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/edc-dataplane --version 0.3.0
```

## Values
Expand Down
4 changes: 2 additions & 2 deletions charts/edc-dataplane/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
## TL;DR

```shell
$ helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
$ helm install my-release tractusx-edc/edc-dataplane --version {{ .Version }}
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/edc-dataplane --version {{ .Version }}
```

{{ template "chart.maintainersSection" . }}
Expand Down
5 changes: 3 additions & 2 deletions charts/tractusx-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
A Helm chart for Tractus-X Eclipse Data Space Connector

## TL;DR

```shell
$ helm repo add catenax-ng-product-edc https://catenax-ng.github.io/product-edc
$ helm install tractusx-connector catenax-ng-product-edc/tractusx-connector --version 0.3.0
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/tractusx-connector --version 0.3.0
```

## Values
Expand Down
5 changes: 3 additions & 2 deletions charts/tractusx-connector/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
{{ template "chart.homepageLine" . }}

## TL;DR

```shell
$ helm repo add catenax-ng-product-edc https://catenax-ng.github.io/product-edc
$ helm install tractusx-connector catenax-ng-product-edc/tractusx-connector --version {{ .Version }}
helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev
helm install my-release tractusx-edc/tractusx-connector --version {{ .Version }}
```

{{ template "chart.maintainersSection" . }}
Expand Down
4 changes: 2 additions & 2 deletions docs/development/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
### 1. Setup Eclipse Dash License Tool locally

For instructions on how to download the Eclipse Dash Tool executable, refer to the
project's [GitHub page](https://github.com/eclipse/dash-licenses#get-it).
project's [GitHub page](https://github.com/eclipse/dash-licenses#get-it).

### 2. Generate DEPENDENCIES file

Expand All @@ -27,7 +27,7 @@ First, the dependencies of this module are calculated with gradle and passed to
gradle allDependencies | grep -Poh "(?<=\s)[\w.-]+:[\w.-]+:[^:\s]+" | sort | uniq | java -jar /path/org.eclipse.dash.licenses-0.0.1-SNAPSHOT.jar - -summary DEPENDENCIES
```

_Note: on some machines (e.g. macOS) [the ack tool](https://beyondgrep.com/install/) should be used instead of `grep`._
_Note: on some machines (e.g. macOS) [the ack tool](https://beyondgrep.com/install/) should be used instead of `grep`._

### 3. Resolve restricted Dependencies

Expand Down
32 changes: 23 additions & 9 deletions docs/development/Run-business-tests-local.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# Run and debug Business-Tests local within IDE
**Prerequisites:**

Prerequisites:

- You need a local kubernetes cluster to install the services (Docker Desktop is recommended).
- You need kubectl and helm command line tools installed.

### 1. Build all modules with maven and produce docker images
## 1. Build all modules with maven and produce docker images

```shell
./gradlew dockerize
```

### 2. Install the all-in-one supporting infrastructure environment (Daps, Vault, PostgreSql, Minio, Backend-Service)
## 2. Install the all-in-one supporting infrastructure environment (Daps, Vault, PostgreSql, Minio, Backend-Service)

```shel
helm install infrastructure edc-tests/src/main/resources/deployment/helm/supporting-infrastructure -n business-tests --create-namespace
```

To access the PostgreSql databases you could use following kubectl port forwardings:

```shell
kubectl port-forward plato-postgresql-0 -n business-tests 5555:5432
kubectl port-forward sokrates-postgresql-0 -n business-tests 6666:5432
```

Please use the same ports later for your environment variables.

### 3. Install Plato as provider EDC
## 3. Install Plato as provider EDC

```shell
helm install plato charts/tractusx-connector -n business-tests --create-namespace \
--set fullnameOverride=plato \
Expand Down Expand Up @@ -56,7 +62,8 @@ helm install plato charts/tractusx-connector -n business-tests --create-namespac
--wait-for-jobs --timeout=120s
```

### 4. Install Socrates as consumer EDC
## 4. Install Socrates as consumer EDC

```shell
helm install sokrates charts/tractusx-connector -n business-tests --create-namespace \
--set fullnameOverride=sokrates \
Expand Down Expand Up @@ -91,9 +98,11 @@ helm install sokrates charts/tractusx-connector -n business-tests --create-names
--wait-for-jobs --timeout=120s
```

### 5. Set environment variables and run configuration in IDE
## 5. Set environment variables and run configuration in IDE

You can create a run configuration in IntelliJ like bellow screenshot and copy/paste the whole set of environments variables if you use ";" after each line.
![](run-config.png)

![Example run config](run-config.png)

```shell
PLATO_BACKEND_SERVICE_BACKEND_API_URL=http://localhost:<PORT>;
Expand Down Expand Up @@ -122,18 +131,23 @@ EDC_AWS_ENDPOINT_OVERRIDE=http://localhost:32000

The services are using NodePort to expose the endpoints therefore the ports are not fix and needs to be determined after each deployment.
To determine the current ports you can use the following kubectl command:

```shell
kubectl get svc -n business-tests -o go-template='{{range .items}}{{ $save := . }}{{range.spec.ports}}{{if .nodePort}}{{$save.metadata.namespace}}{{"/"}}{{$save.metadata.name}}{{" - "}}{{.name}}{{": "}}{{.nodePort}}{{"("}}{{.port}}{{")"}}{{"\n"}}{{end}}{{end}}{{end}}'
```

This will return all NodePorts which are available in business-tests namespace where you can pick the ports to use in your environment variables.
Now you are able to run it in IDE either as normal "Run" mode or in "Debug" mode where you can debug the business-tests by setting debugging points.

### 6. Update your components
## 6. Update your components

Once everything is installed you just need to update your services when you have a new image.

```shell
helm upgrade plato charts/tractusx-connector --recreate-pods
helm upgrade sokrates charts/tractusx-connector --recreate-pods
```

### 7. Tips
## 7. Tips

If you use the kubernetes within Docker Desktop you have direct access to the images which you have created with Docker Desktop they are using the same docker daemon. So you don't need to transfer it in your k8s cluster.
14 changes: 7 additions & 7 deletions docs/development/coding-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
- inheriting from an object that fulfills any of the above. In this case use derived builders as well.
2. Although serializability is not the reason we use the builder pattern, it is a strong indication that a builder
should be used.
2. Builders should be named just `Builder` and be static nested classes.
3. Create a `public static Builder newInstance(){...}` method to instantiate the builder
4. Builders have non-public constructors
5. Use single-field builders: a `Builder` instantiates the object it builds in its constructor, and sets the properties
3. Builders should be named just `Builder` and be static nested classes.
4. Create a `public static Builder newInstance(){...}` method to instantiate the builder
5. Builders have non-public constructors
6. Use single-field builders: a `Builder` instantiates the object it builds in its constructor, and sets the properties
in its builder methods. The `build()` method then only performs verification (optional) and returns the instance.
6. Use `private` constructors for the objects that the builder builds.
7. If there is a builder for an object, use it to deserialize an object, i.e. put Jackson annotations such
7. Use `private` constructors for the objects that the builder builds.
8. If there is a builder for an object, use it to deserialize an object, i.e. put Jackson annotations such
as `JsonCreator` and `@JsonBuilder` on builders.
8. Note that the motivation behind use of builders is not for immutability (although that may be good in certain
9. Note that the motivation behind use of builders is not for immutability (although that may be good in certain
circumstances). Rather, it is to make code less error-prone and
simpler given the lack of named arguments and optional parameters in Java.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from breaking changes, such as Java SPIs, APIs and changes in service contracts.

Up until now, the only way out was cherry-picking, which is extremely cumbersome and error-prone, and requires a
parallel build pipeline to publish the cherry-picked artifacts of EDC (and potentially others). With the approach
presented here, cherry-picking is still an option, but there are easier alternatives to it.
presented here, cherry-picking is still an option, but there are easier alternatives to it.

Every release version published by tractusx-edc must be reproducible at any time.

Expand All @@ -47,12 +47,12 @@ created on March 27th 2023, the most recent nightly would be `0.0.1-20230326`.
_Updating Gradle files or Maven POMs, creating branches and tags in Git should be automated through GitHub Actions as
part of the release process. For reference_:

- Modifying and committing files: https://github.com/orgs/community/discussions/26842#discussioncomment-3253612
- Creating branches: https://github.com/marketplace/actions/create-branch
- Modifying and committing files: <https://github.com/orgs/community/discussions/26842#discussioncomment-3253612>
- Creating branches: <https://github.com/marketplace/actions/create-branch>
- Creating tags using GitHub's
API: https://github.com/eclipse-edc/Connector/blob/b24a5cacbc9fcabdfd8020d779399b3e56856661/.github/workflows/release-edc.yml#L21 (
API: <https://github.com/eclipse-edc/Connector/blob/b24a5cacbc9fcabdfd8020d779399b3e56856661/.github/workflows/release-edc.yml#L21> (
example)
- Create GitHub Release: https://github.com/eclipse-edc/Connector/blob/b24a5cacbc9fcabdfd8020d779399b3e56856661/.github/workflows/release-edc.yml#L56 (example)
- Create GitHub Release: <https://github.com/eclipse-edc/Connector/blob/b24a5cacbc9fcabdfd8020d779399b3e56856661/.github/workflows/release-edc.yml#L56> (example)

Once a release is created, the EDC upstream version must not change anymore, unless there is good reason to do so, for
example, a defect, that needs to be fixed upstream. At that point a decision can also be made to employ a cherry-pick model, in case the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Henceforth, testing shall be done in accordance with the herein outlined rules a

## Rationale

Past experiences with product-edc's testing setup has shown that it is time- and resource-consuming, which also makes it unreliable at times.
Past experiences with product-edc's testing setup has shown that it is time- and resource-consuming, which also makes it unreliable at times.
Furthermore, a finer-grained test classification such as the one outlined in this document is currently neither present nor documented.

### Definitions and distinction
Expand Down Expand Up @@ -51,7 +51,7 @@ EDC provides a way to launch (multiple) embedded connector runtimes from within

External systems such as databases or identity providers should be setup "out-of-band" of the test, using a script or the CI pipeline's declarative syntax (e.g. GitHub Actions' `services` feature). If possible, we should employ external systems in a self-contained way, e.g. using docker containers, because that increases portability and decreases the potential for conflict, e.g. in always-on databases.

### DO:
### DO

- use integration tests sparingly and only when unit tests are not practical
- deploy the external system as service directly in the workflow or
Expand All @@ -63,7 +63,7 @@ External systems such as databases or identity providers should be setup "out-of
system does not get destroyed after the test.
- use the class annotations provided by EDC to categorize and configure test execution

### DO NOT:
### DO NOT

- try to cover everything with integration tests. It's typically a code smell if there are no corresponding unit tests
for an integration test.
Expand All @@ -78,7 +78,7 @@ External systems such as databases or identity providers should be setup "out-of
This section explains _at which point in time_ we should execute which test. This is intended to minimize the impact on overall test execution time on CI, while still maintaining sufficient coverage.

| Test type | When to run | Remarks |
| ---------------------- | ----------------------------------------------------------------------------------- | ------- |
|------------------------|-------------------------------------------------------------------------------------|---------|
| Unit test | when running tests locally, without any parameters, on every commit on every branch | |
| Integration test | on every commit on every branch | |
| System/End-To-End test | on pull request branches except when marked as `draft` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ parallelization resulting in faster and more responsive builds.

## Further consideration

Planned improvements regarding the testing procedure (PR https://github.com/catenax-ng/product-edc/pull/781) will also greatly benefit from the EDC build tools such
Planned improvements regarding the testing procedure (PR <https://github.com/catenax-ng/product-edc/pull/781>) will also greatly benefit from the EDC build tools such
as JUnit tags and conditional evaluation of the tagged tests. Much of EDC's testing framework is based on Gradle and can
be seamlessly integrated in product-edc.
16 changes: 9 additions & 7 deletions docs/development/postman/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@

The Postman app can be used to send and receive EDC messages.

### Install/Download Postman
please visit https://www.postman.com/downloads/
### Install/Download Postman

### Import Postman collection?
please visit https://learning.postman.com/docs/getting-started/importing-and-exporting-data/
please visit <https://www.postman.com/downloads/>

### Import Postman collection

please visit <https://learning.postman.com/docs/getting-started/importing-and-exporting-data/>

## Collection

The postman collection contains the most common API calls. Please note hat the
The postman collection contains the most common API calls. Please note that the

- Policy & Negotiation calls come in pairs for the different kinds of policies
- The 'Data' call only works when using the All-In-One Deployment of this repository
- the 'Data' call only works when using the All-In-One Deployment of this repository

![screenshot](./images/screenshot.png)

[postman-shield]: https://img.shields.io/badge/Postman-URL-orange
[postman-url]: https://www.postman.com
[postman-url]: https://www.postman.com
Loading

0 comments on commit 36b25f3

Please sign in to comment.