Skip to content

Commit e0be649

Browse files
authored
Merge branch 'develop' into topic/RDKEMW_TBD
2 parents c108b9a + 40302b7 commit e0be649

File tree

3 files changed

+119
-6
lines changed

3 files changed

+119
-6
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: PR Description Validation
2+
3+
on:
4+
pull_request:
5+
branches: [develop]
6+
types: [opened, edited, synchronize]
7+
8+
jobs:
9+
validate-pr-description:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Validate PR Description
16+
env:
17+
PR_TITLE: ${{ github.event.pull_request.title }}
18+
PR_BODY: ${{ github.event.pull_request.body }}
19+
run: |
20+
# Define valid ticket IDs
21+
VALID_TICKET_IDS=("RDKEMW" "RDKEVD" "IMMUI" "RDK")
22+
23+
# Function to validate ticket format and ID
24+
validate_ticket() {
25+
local text="$1"
26+
local field_name="$2"
27+
28+
echo "Validating $field_name: $text"
29+
30+
# Check if text matches the pattern <TICKETID>-<ticketno.> : <desc>
31+
if [[ ! "$text" =~ ^[A-Z0-9]+-[0-9]+[[:space:]]*:[[:space:]]*.+ ]]; then
32+
echo "ERROR: $field_name format is invalid."
33+
echo "Expected format: <TICKETID>-<ticketno.> : <description>"
34+
echo "Example: RDKEMW-123 : Fix playbook issue"
35+
echo ""
36+
echo "Valid ticket IDs are:"
37+
printf "%s\n" "${VALID_TICKET_IDS[@]}"
38+
return 1
39+
fi
40+
41+
# Extract ticket ID from the text
42+
local ticket_prefix=$(echo "$text" | sed -n 's/^\([A-Z0-9]\+\)-[0-9]\+[[:space:]]*:.*$/\1/p')
43+
44+
if [ -z "$ticket_prefix" ]; then
45+
echo "ERROR: Could not extract ticket ID from $field_name."
46+
echo "Expected format: <TICKETID>-<ticketno.> : <description>"
47+
echo ""
48+
echo "Valid ticket IDs are:"
49+
printf "%s\n" "${VALID_TICKET_IDS[@]}"
50+
return 1
51+
fi
52+
53+
# Check if extracted ticket ID is in the valid list
54+
local valid=false
55+
for valid_id in "${VALID_TICKET_IDS[@]}"; do
56+
if [ "$ticket_prefix" = "$valid_id" ]; then
57+
valid=true
58+
break
59+
fi
60+
done
61+
62+
if [ "$valid" = false ]; then
63+
echo "ERROR: Invalid ticket ID '$ticket_prefix' in $field_name"
64+
echo ""
65+
echo "Valid ticket IDs are:"
66+
printf "%s\n" "${VALID_TICKET_IDS[@]}"
67+
echo ""
68+
echo "Your $field_name should start with one of the above ticket IDs followed by a number."
69+
echo "Example: RDKEMW-123 : Fix playbook issue"
70+
return 1
71+
fi
72+
73+
echo "$field_name validation passed! Ticket ID: $ticket_prefix"
74+
return 0
75+
}
76+
77+
# Track validation results
78+
TITLE_VALID=true
79+
DESCRIPTION_VALID=true
80+
81+
# Validate PR Title
82+
echo "=== Validating PR Title ==="
83+
if ! validate_ticket "$PR_TITLE" "PR title"; then
84+
TITLE_VALID=false
85+
fi
86+
87+
echo ""
88+
echo "=== Validating PR Description ==="
89+
# Validate PR Description
90+
if [ -n "$PR_BODY" ]; then
91+
if ! validate_ticket "$PR_BODY" "PR description"; then
92+
DESCRIPTION_VALID=false
93+
fi
94+
else
95+
echo "ERROR: PR description is empty."
96+
echo "Both PR title and description must contain valid ticket IDs."
97+
DESCRIPTION_VALID=false
98+
fi
99+
100+
echo ""
101+
echo "=== Validation Summary ==="
102+
echo "PR Title: $([ "$TITLE_VALID" = true ] && echo "PASSED" || echo " FAILED")"
103+
echo "PR Description: $([ "$DESCRIPTION_VALID" = true ] && echo "PASSED" || echo "FAILED")"
104+
105+
# Exit with error if either validation failed
106+
if [ "$TITLE_VALID" = false ] || [ "$DESCRIPTION_VALID" = false ]; then
107+
echo ""
108+
echo "VALIDATION FAILED: Both PR title and description must contain valid ticket IDs from the approved list: ${VALID_TICKET_IDS[@]}"
109+
exit 1
110+
fi
111+
112+
echo ""
113+
echo "ALL VALIDATIONS PASSED! Both PR title and description contain valid ticket IDs."

conf/include/generic-pkgrev.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ PV:pn-systimemgrinetrface = "1.3.0"
186186
PR:pn-systimemgrinetrface = "r0"
187187
PACKAGE_ARCH:pn-systimemgrinetrface = "${MIDDLEWARE_ARCH}"
188188

189-
PV:pn-ctrlm-main = "1.1.2"
189+
PV:pn-ctrlm-main = "1.1.4"
190190
PR:pn-ctrlm-main = "r0"
191191
PACKAGE_ARCH:pn-ctrlm-main = "${MIDDLEWARE_ARCH}"
192192

193-
PV:pn-xr-voice-sdk = "1.0.5"
193+
PV:pn-xr-voice-sdk = "1.0.6"
194194
PR:pn-xr-voice-sdk = "r0"
195195
PACKAGE_ARCH:pn-xr-voice-sdk = "${MIDDLEWARE_ARCH}"
196196

@@ -304,7 +304,7 @@ PV:pn-packagemanager = "4.4.1"
304304
PR:pn-packagemanager = "r0"
305305
PACKAGE_ARCH:pn-packagemanager = "${MIDDLEWARE_ARCH}"
306306

307-
PV:pn-thunderstartupservices = "1.0.22"
307+
PV:pn-thunderstartupservices = "1.0.23"
308308
PR:pn-thunderstartupservices = "r0"
309309
PACKAGE_ARCH:pn-thunderstartupservices = "${MIDDLEWARE_ARCH}"
310310

conf/include/generic-srcrev.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
SRCREV_rdk-apparmor-profiles = "0e9b3f4d100c23a99427891f6dcb417e77fe7b00"
22
SRCREV_rdk-libunpriv = "547d202d421ed83bd60b677b5d057cad3b7ae8ad"
33
SRCREV:pn-rdkat = "e52ebe05b6703dff7ca700fd286d84c0c72c41ea"
4-
SRCREV:pn-ctrlm-main = "512407a852d5aae9a5340a30264585532b4a91da"
4+
SRCREV:pn-ctrlm-main = "46ccf07027ef234181ae24917a8a1cf6b6802df1"
55
SRCREV:pn-ctrlm-headers = "${SRCREV:pn-ctrlm-main}"
6-
SRCREV:pn-xr-voice-sdk = "b628e1ac2b8b149e87de650ca87d6b78969521c4"
6+
SRCREV:pn-xr-voice-sdk = "5eda37f9e95767fcbe2893a52e3b6b1fafd0135c"
77
SRCREV:pn-xr-voice-sdk-headers = "${SRCREV:pn-xr-voice-sdk}"
88
SRCREV_hdmicec = "b407684e91a936a07fadf4ef393505a5d06db890"
99
SRCREV:pn-rmfosal = "ea4f0df1edd73cc2d45d453ad445cb2536799684"
@@ -47,7 +47,7 @@ SRCREV_systemtimemgrfactory="f327d55479d559bfb94803d2e6d60501ab32f9f2"
4747
SRCREV_starboard = "d23e2da63e840f04a1bfa5cf1f2a1e7b0c261102"
4848
SRCREV_systemtimemgr = "f327d55479d559bfb94803d2e6d60501ab32f9f2"
4949
SRCREV:pn-rdkshell = "a0a88b812d39ee57b15b48f00488c4d9ba737f14"
50-
SRCREV:pn-thunderstartupservices = "ff48b86afb638d614ed4b225db2c6aae88cbf09c"
50+
SRCREV:pn-thunderstartupservices = "d73e668dbbdb08054bdd40d99d2ee2a1b9613cef"
5151
SRCREV:pn-rialto-gstreamer = "dc9ac557005b504ba3a55fb0e8d6f822d9a8e809"
5252
SRCREV:pn-rialto = "44518bccc30f00102157b6b212983e05872b1de2"
5353
SRCREV:pn-rialto-ocdm = "c6dfab8221518787a8267269aa7ce4b5f1ba3fcb"

0 commit comments

Comments
 (0)