Skip to content

Commit

Permalink
Merge pull request #276 from catenax-ng/feature/update-commit-message…
Browse files Browse the repository at this point in the history
…-pattern

Megre from catena-x
  • Loading branch information
ds-jhartmann authored Nov 14, 2023
2 parents b0627f2 + 1b81996 commit d9ae84e
Show file tree
Hide file tree
Showing 39 changed files with 1,029 additions and 207 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/changelog-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Check if CHANGELOG file was modified in PR"

on:
pull_request:
branches: main
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.config/**'
- '.github/**'
- 'docs/**'
- 'local/**'

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
pull-requests: write

name: changelog-check
steps:
- uses: actions/checkout@v4

- name: Check if CHANGELOG file was changed
id: changelog-changed
uses: tj-actions/changed-files@v40

Check warning on line 26 in .github/workflows/changelog-changes.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
with:
files: |
CHANGELOG.md
- name: Echo result if CHANGELOG file was changed
if: steps.changelog-changed.outputs.any_changed == 'true'
run: |
for file in ${{ steps.changelog-changed.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Find previous comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: CHANGELOG file was not updated! Make sure to include important changes.

- name: Create or update comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/create-or-update-comment@v3

Check warning on line 49 in .github/workflows/changelog-changes.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
CHANGELOG file was not updated! Make sure to include important changes.
edit-mode: replace
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- IRS can now check the readiness of external services. Use the new ``management.health.dependencies.enabled`` config entry to determine if external dependencies health checks should be checked (false by default).
- The map of external services healthcheck endpoints can be configured with ``management.health.dependencies.urls`` property, eg. ``service_name: http://service_name_host/health``

## [4.0.1] - 2023-11-10
### Changed
- Added state `STARTED` as acceptable state to complete the EDC transfer process to be compatible with EDC 0.5.1
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ cp local/development/commit-msg .git/hooks/commit-msg && chmod 500 .git/hooks/co

For further information please see https://github.com/hazcod/semantic-commit-hook

## Code formatting
Please use the following code formatter: https://github.com/eclipse-tractusx/item-relationship-service/tree/main/.idea/codeStyles

## Contact

Expand Down
10 changes: 10 additions & 0 deletions charts/irs-helm/templates/configmap-spring-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ data:
operator: {{ .operator | quote }}
rightOperand: {{ .rightOperand | quote }}
{{- end }}
connectorEndpointService:
cacheTTL: {{ .Values.edc.connectorEndpointService.cacheTTL | int64 }}
ess:
localBpn: {{ tpl (.Values.bpn | default "") . | quote }}
localEdcEndpoint: {{ tpl (.Values.edc.provider.host | default "") . | quote }}
Expand All @@ -129,6 +131,14 @@ data:
{{- if .Values.ess.mockRecursiveEdcAsset }}
mockRecursiveEdcAsset: {{ tpl (.Values.ess.mockRecursiveEdcAsset) . | quote }}
{{- end }}
{{- if .Values.management.health.dependencies.enabled }}
management:
health:
dependencies:
enabled: {{ tpl (.Values.management.health.dependencies.enabled | default "false") . | quote }}
urls:
{{- tpl (toYaml .Values.management.health.dependencies.urls) . | nindent 10 }}
{{- end }}
{{- end }}
apiAllowedBpn: {{ tpl (.Values.bpn | default "") . | quote }}
Expand Down
9 changes: 8 additions & 1 deletion charts/irs-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ bpn: # BPN for this IRS instance; only users with this BPN are allowed to acces
ingress:
enabled: false

management:
health:
dependencies:
enabled: false # Flag to determine if external service healthcheck endpoints should be checked
urls: {} # Map of services with corresponding healthcheck endpoint url's, example service_name: http://service_name_host.com/health

digitalTwinRegistry:
type: decentral # The type of DTR. This can be either "central" or "decentral". If "decentral", descriptorEndpoint, shellLookupEndpoint and oAuthClientId is not required.
url: # "https://<digital-twin-registry-url>"
Expand Down Expand Up @@ -196,7 +202,8 @@ edc:
- leftOperand: "Membership"
operator: "eq"
rightOperand: "active"

connectorEndpointService:
cacheTTL: 86400000
discovery:
oAuthClientId: portal # ID of the OAuth2 client registration to use, see config spring.security.oauth2.client

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
= Scenario 1: Register an Ess-Investigation-Order

This section describes what happens when user creates an ess order.

== Register an Ess-Investigation-Order

[plantuml,target=submodel-processing,format=svg]
....
include::../../../../uml-diagrams/runtime-view/use-case-ess-top-down/3_ess_top_down_sequence-RegisterEssInvestigationOrder.puml[]
....

|===
| Step | Actor | Action | Details

| [000]
| Client
| Sends a POST request to `/ess/bpn/investigation/orders`
| Includes JSON payload with parameters like "bomLifecycle," "batchSize," "callbackUrl," "incidentBPNSs," "keys," and "timeout."

| [001]
| IRS
| Initiates initial order processing
| Begins asynchronous processing of ESS process for "incidentBPNSs" and tuples of "globalAssetId" and "BPN."

| [002]
| IRS
| Registers callback
| Establishes a callback mechanism with the provided callback URL.

| [003]
| Client
| Receives 201 success response
| Indicates successful registration of the order.

| [004]
| Client
| Sends a GET request to `/irs/orders/{orderId}`
| Requests information for a specific orderId.

| [005]
| IRS
| Processes GET request
| Initiates processing of the requested orderId.

| [006]
| IRS
| Sends a 200 response with order payload
| Returns the details of the processed order.

| [007]
| Client
| Optionally initiates batch completion
| Completes the batch processing if required.

| [008]
| Client
| Sends a POST request to `/irs/orders/{orderId}/batches/'{batchId}'`
| Initiates batch processing for a specific orderId and batchId.

| [009]
| IRS
| Sends BatchShell with jobs
| Returns details of the batch with associated jobs.

|===

Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
= Scenario 1: Register an Ess-Investigation-Job

This section describes what happens when user creates an ess job.

== Register an Ess-Investigation Job

[plantuml,target=submodel-processing,format=svg]
....
include::../../../../uml-diagrams/runtime-view/use-case-ess-top-down/4_ess_top_down_sequence_RegisterEssInvestigationJob.puml[]
....

|===
| Step | Actor | Action | Details

| [000]
| Requestor
| Sends a POST request to `/ess/bpn/investigations`
| Includes JSON payload with parameters such as "bomLifecycle," "callbackUrl," "incidentBpns," and "key" containing "bpn" and "globalAssetId."

| [001]
| IRS
| Registers an IRS ess incident job
| Initiates the registration of an IRS ess incident job based on the received request.

| [002]
| IRS, DiscoveryFinder, EDCDiscoveryService, EDC, dDTR
| Look up shells for the given globalAssetId
| Conducts a lookup and retrieves AAS (Asset Administration Shell) for the specified globalAssetId.

| [003]
| IRS -> SubmodelServer
| Sends a GET request for SingleLevelBomAsPlanned
| Initiates a request to the SubmodelServer for the SingleLevelBomAsPlanned.

| [004]
| SubmodelServer -> IRS
| Receives SingleLevelBomAsPlanned
| Sends back the SingleLevelBomAsPlanned data to the IRS.

| [005]
| IRS
| Extracts childCXIds from SingleLevelBomAsPlanned
| Processes and extracts childCXIds from the received SingleLevelBomAsPlanned.

| [006]
| Loop (for each childCXId)
| IRS, DiscoveryFinder, EDCDiscoveryService
| Get EDC endpoint for Tier1, Retrieves the EDC endpoint for Tier1 based on the childCXId.

| [007]
| IRS, EDCTier1, dDTRTier1
| Look up shells for the given globalAssetId
| Conducts a lookup and retrieves AAS for the specified globalAssetId in Tier1.

| [008]
| IRS -> SubmodelServer
| Sends a request to get PartAsPlanned
| Initiates a request to the SubmodelServer to get PartAsPlanned.

| [009]
| SubmodelServer <- IRS
| Receives PartAsPlanned
| Gets PartAsPlanned data from the SubmodelServer.

| [010]
| IRS
| Validity Check on PartAsPlanned validityPeriod
| Checks the validity period of PartAsPlanned.

| [011]
| IRS -> SubmodelServer
| Sends a GET request for PartSiteInformationAsPlanned
| Requests PartSiteInformationAsPlanned from the SubmodelServer.

| [012]
| IRS -> IRS
| Extracts catenaXsiteId from PartSiteInformationAsPlanned
| Processes and extracts catenaXsiteId from PartSiteInformationAsPlanned.

| [013]
| IRS
| Matches "incidentBpns" and catenaXsiteId
| Checks for a match between "incidentBpns" and catenaXsiteId.

| [014]
| IRS
| Detects the supplyChainImpacted on the first tier level
| Identifies the supply chain impacted on the first tier level and provides information.

| [015]
| Requestor <- IRS
| Responds part-chain infected
| Receives the response indicating the part-chain infection.

| [016]
| IRS
| Continues the loop
| Continues the loop for the remaining childCXIds.

| [017]
| Loop (end)
| IRS
| Loop completion
| Completes the loop for all childCXIds.

|===
Loading

0 comments on commit d9ae84e

Please sign in to comment.