Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/verify-pact-contract/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
consumer_tags:
required: false

verify-contract:
runs:
using: "composite"
steps:
- name: Checkout code
Expand All @@ -22,6 +22,7 @@ verify-contract:
dotnet-version: '9.0.x'

- name: Verify consumer contract against provider
shell: bash
run: |
echo "Verifying pact..."
cd UserMicroservice.Tests
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/group-ms-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
- 'GroupMicroservice/**'
- 'GroupMicroservice.Tests/**'
- '.github/workflows/group-ms-workflow.yaml'
- '.github/actions/check-schema/**'
- '.github/actions/check-consumer-contract/**'
workflow_call:
secrets:
PACT_BROKER:
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/user-ms-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
- 'UserMicroservice/**'
- 'UserMicroservice.Tests/**'
- '.github/workflows/user-ms-workflow.yaml'
- '.github/actions/check-schema/**'
- '.github/actions/verify-pact-contract/**'
workflow_call:
secrets:
PACT_BROKER:
Expand All @@ -14,16 +17,11 @@ on:
PACT_BROKER_PASSWORD:
required: true
workflow_dispatch:

# inputs:
# consumer:
# required: true
# consumerVersion:
# required: true
# consumerVersionTags:
# required: false
# pactUrl:
# required: true
inputs:
group-ms-branch:
description: 'Branch name in Group Microservice'
required: true
default: 'main'

jobs:
check-openapi-schema:
Expand All @@ -43,10 +41,22 @@ jobs:
name: Verify consumer contract
needs: check-openapi-schema
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract Group MS branch from PR description
if: ${{ github.event_name == 'pull_request' }}
id: extract-branch
run: |
echo "PR_BODY=${{ github.event.pull_request.body }}" >> $GITHUB_ENV
GROUP_MS_BRANCH=$(echo "${{ github.event.pull_request.body }}" | grep -oP '(?<=GroupMS: )[^\s]+')
echo "group-ms-branch=${GROUP_MS_BRANCH:-main}" >> $GITHUB_ENV
echo "The branch name in Group Microservice is: $GROUP_MS_BRANCH"

- name: Verify consumer contract
uses: ./.github/actions/verify-pact-contract
with:
pact_broker: ${{ secrets.PACT_BROKER }}
pact_broker_username: ${{ secrets.PACT_BROKER_USERNAME }}
pact_broker_password: ${{ secrets.PACT_BROKER_PASSWORD }}

consumer_tags: ${{ env.group-ms-branch || inputs.group-ms-branch }}
73 changes: 73 additions & 0 deletions Docs/check-schema-diagram.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" version="27.0.5">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1291" dy="835" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="XXpuAERPKzGZMFYxDFX5-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" target="WIyWlLk6GJQsqaUBKTNV-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="Check schema workflow triggered" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="38.75" y="40" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-7">
<mxGeometry relative="1" as="geometry">
<mxPoint x="98.75" y="170" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-7" value="Checkout head (working) branch&amp;nbsp;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="38.75" y="105" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-3" target="XXpuAERPKzGZMFYxDFX5-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-3" value="Checkout base branch (main)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="38.75" y="170" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-4" target="XXpuAERPKzGZMFYxDFX5-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-4" value="Set up .NET" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="38.75" y="235" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-7" target="XXpuAERPKzGZMFYxDFX5-21">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-7" value="Generate new OpenAPI schema (based on head branch!" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="38.75" y="300" width="120" height="70" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-9" target="XXpuAERPKzGZMFYxDFX5-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-16" value="No" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="XXpuAERPKzGZMFYxDFX5-15">
<mxGeometry x="-0.2248" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-9" target="XXpuAERPKzGZMFYxDFX5-18">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-20" value="Yes" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="XXpuAERPKzGZMFYxDFX5-19">
<mxGeometry x="-0.4392" y="-3" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-9" value="Found any&amp;nbsp;&lt;div&gt;uncomitted&amp;nbsp;&lt;/div&gt;&lt;div&gt;changes?&lt;/div&gt;" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="30" y="480" width="137.5" height="110" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-13" value="Exit succsessfully" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="218.75" y="515" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-18" value="Fail workflow run" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="38.75" y="640" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="XXpuAERPKzGZMFYxDFX5-21" target="XXpuAERPKzGZMFYxDFX5-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="XXpuAERPKzGZMFYxDFX5-21" value="Compare main schema and head schema" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="38.75" y="390" width="120" height="70" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading
Loading