Skip to content

Commit 5ea57e3

Browse files
committed
feature: include changes to commit body
1 parent 9810bd3 commit 5ea57e3

File tree

8 files changed

+854
-313
lines changed

8 files changed

+854
-313
lines changed

.github/workflows/generate-messageflow-docs.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
path: temp-source
2121
token: ${{ secrets.INTEGRATION_PAT }}
2222

23-
- name: Configure Git as the bot
24-
run: |
25-
git config user.name "messageflow-ci-bot"
26-
git config user.email "messageflow-ci-bot@example.com"
27-
2823
- name: Copy asyncapi files to appropriate folder
2924
run: |
3025
mkdir -p source/${{ github.event.client_payload.source_repo }}
@@ -34,21 +29,46 @@ jobs:
3429
done
3530
rm -rf temp-source
3631
37-
- name: Generate docs
32+
- name: Generate docs and capture changelog
33+
id: generate-docs
3834
run: |
39-
docker run --rm \
35+
OUTPUT=$(docker run --rm \
4036
--user $(id -u):$(id -g) \
41-
-v ${{ github.workspace }}:/wrk \
37+
-v ${{ github.workspace }}:/work \
4238
ghcr.io/holydocs/messageflow:latest \
43-
gen-docs --dir wrk/source --output wrk/docs
39+
gen-docs --dir work/source --output work/docs 2>&1)
40+
41+
echo "$OUTPUT"
42+
43+
if echo "$OUTPUT" | grep -q "New Changes Detected:"; then
44+
CHANGELOG=$(echo "$OUTPUT" | sed -n '/New Changes Detected:/,$p' | sed '1d')
45+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
46+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
47+
echo "EOF" >> $GITHUB_OUTPUT
48+
else
49+
echo "changelog=" >> $GITHUB_OUTPUT
50+
fi
4451
4552
- name: Commit & push (if anything changed)
4653
env:
4754
PAT: ${{ secrets.INTEGRATION_PAT }}
55+
CHANGELOG: ${{ steps.generate-docs.outputs.changelog }}
4856
run: |
4957
if ! (git diff-index --quiet HEAD -- && [ -z "$(git ls-files --others --exclude-standard)" ]); then
58+
git config user.name "messageflow-ci-bot"
59+
git config user.email "messageflow-ci-bot@example.com"
5060
git add -A
51-
git commit -m "Sync: ${{ github.event.client_payload.source_repo }} @ ${{ github.event.client_payload.source_sha }}"
61+
62+
COMMIT_MSG="Sync: ${{ github.event.client_payload.source_repo }}@${{ github.event.client_payload.source_sha }}"
63+
64+
# Add changes details if available
65+
if [ -n "$CHANGELOG" ]; then
66+
printf "%s\n\n%s\n" "$COMMIT_MSG" "$CHANGELOG" > /tmp/commit_msg.txt
67+
else
68+
echo "$COMMIT_MSG" > /tmp/commit_msg.txt
69+
fi
70+
71+
git commit -F /tmp/commit_msg.txt
5272
git remote set-url origin "https://x-access-token:${PAT}@github.com/${GITHUB_REPOSITORY}"
5373
git push
5474
fi

docs/README.md

Lines changed: 135 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- [notification.analytics](#notificationanalytics)
1919
- [notification.preferences.get](#notificationpreferencesget)
2020
- [notification.preferences.update](#notificationpreferencesupdate)
21-
- [notification.user.{user_id}.push](#notificationuseruseridpush)
21+
- [notification.user.{user_id}.push](#notificationuseruser_idpush)
2222
- [user.analytics](#useranalytics)
2323
- [user.info.request](#userinforequest)
2424
- [user.info.update](#userinfoupdate)
@@ -126,7 +126,8 @@ Handles user data requests, profile updates, and user lifecycle events.
126126
"string"
127127
],
128128
"severity": "string[enum:low,medium,high,critical]",
129-
"title": "string"
129+
"title": "string",
130+
"updated_at": "string[date-time]"
130131
}
131132
```
132133

@@ -289,6 +290,7 @@ Handles user data requests, profile updates, and user lifecycle events.
289290
"rate_limit": "integer",
290291
"respect_quiet_hours": "boolean"
291292
},
293+
"status": "string",
292294
"target_audience": {
293295
"estimated_reach": "integer",
294296
"user_filters": {
@@ -422,7 +424,7 @@ Handles user data requests, profile updates, and user lifecycle events.
422424

423425
### notification.user.{user_id}.push
424426

425-
![notification.user.{user_id}.push Channel Services](diagrams/channel_notificationuseruseridpush.svg)
427+
![notification.user.{user_id}.push Channel Services](diagrams/channel_notificationuseruser_idpush.svg)
426428

427429
#### Messages
428430
**PushNotificationMessage**
@@ -507,6 +509,136 @@ Handles user data requests, profile updates, and user lifecycle events.
507509

508510
## Changelog
509511

512+
### 2025-08-09
513+
- **changed** message: Messages changed for operation 'send' on channel 'analytics.insights' in service 'Analytics Service'
514+
```json
515+
[]messageflow.Message{
516+
{
517+
Name: "AnalyticsInsightMessage",
518+
Payload: (
519+
"""
520+
... // 17 identical lines
521+
"string"
522+
],
523+
- "removed_at": "string[date-time]",
524+
"severity": "string[enum:low,medium,high,critical]",
525+
- "title": "string"
526+
+ "title": "string",
527+
+ "updated_at": "string[date-time]"
528+
}
529+
"""
530+
),
531+
},
532+
}
533+
534+
```
535+
- **changed** message: Messages changed for operation 'receive' on channel 'campaign.create' in service 'Campaign Service'
536+
```json
537+
[]messageflow.Message{
538+
{
539+
Name: "CampaignCreateMessage",
540+
Payload: (
541+
"""
542+
... // 48 identical lines
543+
"respect_quiet_hours": "boolean"
544+
},
545+
+ "status": "string",
546+
"target_audience": {
547+
"estimated_reach": "integer",
548+
... // 21 identical lines
549+
"""
550+
),
551+
},
552+
}
553+
554+
```
555+
556+
### 2025-08-09
557+
- **changed** message: Messages changed for operation 'send' on channel 'analytics.insights' in service 'Analytics Service'
558+
```json
559+
  []messageflow.Message{
560+
   {
561+
   Name: "AnalyticsInsightMessage",
562+
   Payload: (
563+
   """
564+
   ... // 17 identical lines
565+
   "string"
566+
   ],
567+
+  "removed_at": "string[date-time]",
568+
   "severity": "string[enum:low,medium,high,critical]",
569+
   "title": "string"
570+
   }
571+
   """
572+
   ),
573+
   },
574+
  }
575+
576+
```
577+
578+
### 2025-08-09
579+
- **changed** message: Messages changed for operation 'send' on channel 'analytics.insights' in service 'Analytics Service'
580+
```json
581+
  []messageflow.Message{
582+
   {
583+
   Name: "AnalyticsInsightMessage",
584+
   Payload: (
585+
   """
586+
   ... // 18 identical lines
587+
   ],
588+
   "severity": "string[enum:low,medium,high,critical]",
589+
-  "title": "string",
590+
-  "updadet_at": "string[date-time]"
591+
+  "title": "string"
592+
   }
593+
   """
594+
   ),
595+
   },
596+
  }
597+
598+
```
599+
600+
### 2025-08-09
601+
- **added** channel: 'receive' on channel 'analytics.report.request' was added to service 'Analytics Service'
602+
- **added** channel: 'receive' on channel 'campaign.analytics' was added to service 'Analytics Service'
603+
- **added** channel: 'receive' on channel 'notification.analytics' was added to service 'Analytics Service'
604+
- **added** channel: 'receive' on channel 'user.analytics' was added to service 'Analytics Service'
605+
- **added** channel: 'send' on channel 'analytics.alert' was added to service 'Analytics Service'
606+
- **added** channel: 'send' on channel 'analytics.insights' was added to service 'Analytics Service'
607+
- **added** channel: 'receive' on channel 'campaign.create' was added to service 'Campaign Service'
608+
- **added** channel: 'receive' on channel 'campaign.execute' was added to service 'Campaign Service'
609+
- **added** channel: 'send' on channel 'campaign.analytics' was added to service 'Campaign Service'
610+
- **added** channel: 'send' on channel 'notification.user.{user_id}.push' was added to service 'Campaign Service'
611+
- **added** channel: 'send' on channel 'user.info.request' was added to service 'Campaign Service'
612+
- **added** channel: 'receive' on channel 'notification.preferences.get' was added to service 'Notification Service'
613+
- **added** channel: 'receive' on channel 'notification.preferences.update' was added to service 'Notification Service'
614+
- **added** channel: 'receive' on channel 'notification.user.{user_id}.push' was added to service 'Notification Service'
615+
- **added** channel: 'send' on channel 'notification.analytics' was added to service 'Notification Service'
616+
- **added** channel: 'send' on channel 'user.info.request' was added to service 'Notification Service'
617+
- **added** channel: 'receive' on channel 'user.info.request' was added to service 'User Service'
618+
- **added** channel: 'send' on channel 'notification.preferences.update' was added to service 'User Service'
619+
- **added** channel: 'send' on channel 'user.analytics' was added to service 'User Service'
620+
- **added** channel: 'send' on channel 'user.info.update' was added to service 'User Service'
621+
- **removed** channel: 'receive' on channel 'analytics.report.request' was removed from service 'Analytics Service'
622+
- **removed** channel: 'receive' on channel 'campaign.analytics' was removed from service 'Analytics Service'
623+
- **removed** channel: 'receive' on channel 'notification.analytics' was removed from service 'Analytics Service'
624+
- **removed** channel: 'receive' on channel 'user.analytics' was removed from service 'Analytics Service'
625+
- **removed** channel: 'send' on channel 'analytics.alert' was removed from service 'Analytics Service'
626+
- **removed** channel: 'send' on channel 'analytics.insights' was removed from service 'Analytics Service'
627+
- **removed** channel: 'receive' on channel 'campaign.create' was removed from service 'Campaign Service'
628+
- **removed** channel: 'receive' on channel 'campaign.execute' was removed from service 'Campaign Service'
629+
- **removed** channel: 'send' on channel 'campaign.analytics' was removed from service 'Campaign Service'
630+
- **removed** channel: 'send' on channel 'notification.user.{user_id}.push' was removed from service 'Campaign Service'
631+
- **removed** channel: 'send' on channel 'user.info.request' was removed from service 'Campaign Service'
632+
- **removed** channel: 'receive' on channel 'notification.preferences.get' was removed from service 'Notification Service'
633+
- **removed** channel: 'receive' on channel 'notification.preferences.update' was removed from service 'Notification Service'
634+
- **removed** channel: 'receive' on channel 'notification.user.{user_id}.push' was removed from service 'Notification Service'
635+
- **removed** channel: 'send' on channel 'notification.analytics' was removed from service 'Notification Service'
636+
- **removed** channel: 'send' on channel 'user.info.request' was removed from service 'Notification Service'
637+
- **removed** channel: 'receive' on channel 'user.info.request' was removed from service 'User Service'
638+
- **removed** channel: 'send' on channel 'notification.preferences.update' was removed from service 'User Service'
639+
- **removed** channel: 'send' on channel 'user.analytics' was removed from service 'User Service'
640+
- **removed** channel: 'send' on channel 'user.info.update' was removed from service 'User Service'
641+
510642
### 2025-07-26
511643
- **removed** channel: 'send' on channel 'campaign.status' was removed from service 'Campaign Service'
512644

docs/diagrams/service_analytics-service.svg

Lines changed: 101 additions & 101 deletions
Loading

0 commit comments

Comments
 (0)