Skip to content

Commit 56dcc45

Browse files
svc-osmo-cielookpotts-nvidiaxutongNVfernandol-nvidiavvnpn-nv
authored
Sync main into feature/PROJ-147-operator-redesign (#260)
* Update the wording re: creating feature branches (#204) * Add a link back to OSMO from the brev launchable (#205) * Improve styling for badges in the brev launchable readme (#207) * Fix osmo config pool update payload in backend installation docs (#210) * Fix osmo config pool update payload in practical guide (#213) * #147 - backend operator redesign doc (#149) * backend operator redesign doc * 195 - Bump quick-start version due to updated dependencies (#217) * Perform Client Side Data Auth Check In the Event of Environment Based Auth (#177) * Data/Dataset Auth Check CLIs * Remove auth check from data service * Use auth check CLIs in ctrl * Add exit code to docs * Fix build issues * Fix lint * Ctrl to use user config when validating data auth * Use the correct CLI argument type * Fix lint * Use profile when looking up data credential from config * Update quick start installation to always install latest version (#218) * Add workflow to label external issues and pull requests (#222) * Add workflow to label external issues and pull requests * pin to allowed action version * add reopened event * allow flexible squid proxy replicas (#241) * allow flexible squid proxy replicas * fix * Efficient Workflow Cleanup through Using Async Operations for Log Migration (#167) * Improving Performance for Uploading Workflow Artifacts in Worker Jobs * Cleanup * Add progress writing after upload * Add dependency in Bazel BUILD * Add type to mypy requirements * Update mypy requirements * Add to mypy_cli BUILD * Fix lint * Comment * Use constant to define semaphor and storage client executor count * #244 - Use last login url if url is not specified (#245) * Use last login url if url is not specified * print message * Cannot select any text inside modals or slideouts (#248) * Video html element not changin when selecting different video files in the UI for OSMO dataset (#249) * sync-feature-branches: fix no conflict case, allow single branch to be synced (#252) * Fix sync-feature-branches with no merge conflicts * Allow a single branch to be specified for sync-feature-branches * Perform operations as OSMO CI Bot * Add external label when the PR is created * extract issue number * add test cases (#247) --------- Co-authored-by: Ethan Look-Potts <[email protected]> Co-authored-by: xutongNV <[email protected]> Co-authored-by: Fernando L <[email protected]> Co-authored-by: Vivian Pan <[email protected]> Co-authored-by: ethany-nv <[email protected]> Co-authored-by: RyaliNvidia <[email protected]> Co-authored-by: patclarknvidia <[email protected]>
1 parent 68cc124 commit 56dcc45

File tree

4 files changed

+1181
-37
lines changed

4 files changed

+1181
-37
lines changed
Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -18,6 +18,12 @@ name: Sync Feature Branches
1818

1919
on:
2020
workflow_dispatch:
21+
inputs:
22+
branch:
23+
description: 'Specific feature branch to sync (e.g., feature/PROJ-123-my-feature). Leave empty to sync all feature branches.'
24+
required: false
25+
type: string
26+
default: ''
2127
schedule:
2228
# Run every Monday at 9am PT (5pm UTC)
2329
- cron: '0 17 * * 1'
@@ -36,115 +42,128 @@ jobs:
3642

3743
- name: Configure Git
3844
run: |
39-
git config user.name "github-actions[bot]"
40-
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git config user.name "OSMO CI Bot"
46+
git config user.email "255188861+svc-osmo-ci@users.noreply.github.com"
4147
4248
- name: Find and sync feature branches
4349
env:
44-
GH_TOKEN: ${{ github.token }}
50+
GH_TOKEN: ${{ secrets.SVC_OSMO_CI_TOKEN }}
51+
INPUT_BRANCH: ${{ inputs.branch }}
4552
run: |
4653
set -e
47-
48-
echo "🔍 Finding feature branches..."
49-
50-
# Get all remote feature branches
51-
feature_branches=$(git branch -r | grep 'origin/feature/' | sed 's|origin/||' | grep -v HEAD || true)
52-
53-
if [ -z "$feature_branches" ]; then
54-
echo "ℹ️ No feature branches found matching pattern 'feature/*'"
55-
exit 0
54+
55+
if [ -n "$INPUT_BRANCH" ]; then
56+
echo "🔍 Syncing specific branch: $INPUT_BRANCH"
57+
# Validate the branch exists
58+
if ! git ls-remote --exit-code --heads origin "$INPUT_BRANCH" > /dev/null 2>&1; then
59+
echo "❌ Error: Branch '$INPUT_BRANCH' does not exist on remote"
60+
exit 1
61+
fi
62+
feature_branches="$INPUT_BRANCH"
63+
else
64+
echo "🔍 Finding feature branches..."
65+
66+
# Get all remote feature branches
67+
feature_branches=$(git branch -r | grep 'origin/feature/' | sed 's|origin/||' | grep -v HEAD || true)
68+
69+
if [ -z "$feature_branches" ]; then
70+
echo "ℹ️ No feature branches found matching pattern 'feature/*'"
71+
exit 0
72+
fi
5673
fi
57-
74+
5875
echo "Found feature branches:"
5976
echo "$feature_branches"
6077
echo ""
61-
78+
6279
# Process each feature branch
6380
for branch in $feature_branches; do
6481
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
6582
echo "📋 Processing branch: $branch"
66-
83+
6784
# Check if main has commits not in the feature branch
6885
git fetch origin main
6986
git fetch origin "$branch"
70-
87+
7188
commits_behind=$(git rev-list --count origin/$branch..origin/main)
72-
89+
7390
if [ "$commits_behind" -eq 0 ]; then
7491
echo "✅ Branch $branch is already up to date with main"
7592
continue
7693
fi
77-
94+
7895
echo "📊 Branch $branch is $commits_behind commit(s) behind main"
79-
96+
8097
# Extract issue number from branch name (format: feature/PROJ-NNN-short-slug)
8198
# If no PROJ-NNN pattern is found, use "Issue - None"
82-
issue_number=$(echo "$branch" | grep -oE 'PROJ-[0-9]+' || echo "")
99+
issue_number=$(echo "$branch" | grep -oE 'PROJ-[0-9]+' | grep -oE '[0-9]+' || echo "")
83100
if [ -z "$issue_number" ]; then
84101
issue_ref="Issue - None"
85102
else
86103
issue_ref="Issue #$issue_number"
87104
fi
88-
105+
89106
# Create a temporary branch for the merge
90107
temp_branch="sync/$branch/$(date +%Y%m%d-%H%M)"
91-
108+
92109
echo "🌿 Creating temporary branch: $temp_branch"
93110
git checkout -b "$temp_branch" "origin/$branch"
94-
111+
95112
# Attempt to merge main
96113
echo "🔀 Merging main into $temp_branch..."
97114
if git merge origin/main --no-commit --no-ff; then
98115
echo "✅ Merge successful (no conflicts)"
116+
git commit -m "Merge main into $branch"
99117
else
100118
echo "⚠️ Merge has conflicts - will create PR for manual resolution"
101119
git add -A
102120
git commit -m "Merge main into $branch"
103121
fi
104-
122+
105123
# Push the temporary branch
106124
echo "⬆️ Pushing $temp_branch to remote..."
107125
git push origin "$temp_branch"
108-
126+
109127
# Create PR
110128
echo "📝 Creating pull request..."
111-
129+
112130
gh pr create \
113131
--base "$branch" \
114132
--head "$temp_branch" \
115133
--title "Sync main into $branch" \
134+
--label "external" \
116135
--body "$(cat <<EOF
117136
## Description
118-
137+
119138
This automated PR merges the latest changes from \`main\` into \`$branch\`.
120-
139+
121140
**What to do:**
122141
Review the changes and merge this PR to keep your feature branch up to date with main. If there are merge conflicts, resolve them before merging.
123-
142+
124143
**Branch Info:**
125144
- **Target**: \`$branch\`
126145
- **Source**: \`main\`
127146
- **Commits behind**: $commits_behind
128-
147+
129148
$issue_ref
130-
149+
131150
## Checklist
132151
- [ ] I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/OSMO/blob/main/CONTRIBUTING.md).
133152
- [ ] New or existing tests cover these changes.
134153
- [ ] The documentation is up to date with these changes.
135-
154+
136155
---
137156
*This PR was automatically created by the [Sync Feature Branches workflow](.github/workflows/sync-feature-branches.yaml) as part of the [Projects Process](../projects/README.md#stage-in-development).*
138157
EOF
139158
)"
140-
159+
141160
echo "✅ Created PR to sync main into $branch"
142-
161+
143162
# Switch back to main for next iteration
144163
git checkout main
145-
164+
146165
done
147-
166+
148167
echo ""
149168
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
150169
echo "✨ Sync process complete!"

src/operator/tests/BUILD

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,19 @@ py_test(
2929
"//src/operator:backend_listener_lib"
3030
]
3131
)
32+
33+
py_test(
34+
name = "test_pod_status_calculator",
35+
srcs = [
36+
"test_pod_status_calculator.py"
37+
],
38+
data = [
39+
"test_calculate_pod_status_cases.json",
40+
],
41+
deps = [
42+
requirement("pydantic"),
43+
requirement("kubernetes"),
44+
"//src/operator:backend_listener_lib",
45+
"//src/utils/job",
46+
],
47+
)

0 commit comments

Comments
 (0)