Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/carto-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ features:
files:
- litellm/llms/azure/common_utils.py
verification:
- pattern: "re.sub.*chat/completions"
- pattern: "chat/completions|completions|embeddings|audio/speech"
file: litellm/llms/azure/common_utils.py

- name: "JSON Repair for Streaming Tool Calls"
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/carto-features-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CARTO Features Manifest Check

on:
push:
branches:
- 'upstream-sync/**'
pull_request:
branches:
- 'carto/main'

jobs:
verify-manifest:
name: Verify CARTO Features
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check manifest exists
id: check-manifest
run: |
if [ ! -f .github/carto-features.yml ]; then
echo "::notice::carto-features.yml not found - skipping verification"
echo "exists=false" >> $GITHUB_OUTPUT
else
echo "exists=true" >> $GITHUB_OUTPUT
fi

- name: Verify manifest patterns
if: steps.check-manifest.outputs.exists == 'true'
run: |
echo "::group::Verifying CARTO features manifest patterns"

python3 -c "
import yaml, subprocess, sys

with open('.github/carto-features.yml') as f:
data = yaml.safe_load(f)

total = 0
missing = []

for feat in data.get('features', []):
for v in feat.get('verification', []):
total += 1
r = subprocess.run(['grep', '-q', v['pattern'], v['file']], capture_output=True)
if r.returncode == 0:
print(f'✅ {feat[\"name\"]} - {v[\"pattern\"]} in {v[\"file\"]}')
else:
print(f'❌ {feat[\"name\"]} - {v[\"pattern\"]} in {v[\"file\"]}')
missing.append(f'{feat[\"name\"]}: {v[\"pattern\"]} in {v[\"file\"]}')

print(f'\n--- Results: {total - len(missing)}/{total} patterns verified ---')

if missing:
print(f'\n{len(missing)} MISSING pattern(s):')
for m in missing:
print(f' - {m}')
sys.exit(1)
else:
print('\nAll CARTO feature patterns verified.')
"

echo "::endgroup::"
12 changes: 12 additions & 0 deletions .github/workflows/carto-upstream-sync-ci-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,18 @@ jobs:

---

## CARTO FEATURES MANIFEST

Before making ANY changes, read the features manifest:
```bash
cat .github/carto-features.yml 2>/dev/null || echo "No manifest found"
```

These patterns MUST still exist after your fixes. If a fix would remove a
pattern, find an alternative approach that preserves the CARTO feature.

---

## STEP 0: FIX LOOP DETECTION (DO THIS FIRST!)

Check for fix loops before doing anything:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/carto-upstream-sync-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,41 @@ jobs:

---

## CARTO FEATURES MANIFEST (CRITICAL)

The features manifest lists EXACT patterns that MUST exist after resolution.
Read it and verify all patterns survive:

```bash
cat .github/carto-features.yml
```

After resolving ALL conflicts, verify each pattern:
```bash
python3 -c "
import yaml, subprocess, sys
with open('.github/carto-features.yml') as f:
data = yaml.safe_load(f)
missing = 0
for feat in data.get('features', []):
for v in feat.get('verification', []):
r = subprocess.run(['grep', '-q', v['pattern'], v['file']], capture_output=True)
status = 'OK' if r.returncode == 0 else 'MISSING'
print(f'{status}: {feat[\"name\"]} - {v[\"pattern\"]} in {v[\"file\"]}')
if r.returncode != 0:
missing += 1
if missing:
print(f'\nWARNING: {missing} pattern(s) missing!')
sys.exit(1)
else:
print('\nAll CARTO feature patterns verified.')
"
```

If ANY patterns are MISSING, restore them from carto/main or re-implement.

---

## SYNC-REQUIRED FILES (Always Accept Upstream TAG)

These files MUST match upstream regardless of CARTO history:
Expand Down Expand Up @@ -1113,6 +1148,41 @@ jobs:
echo "resolved=true" >> $GITHUB_OUTPUT
echo "::endgroup::"

- name: Verify CARTO features manifest
id: verify-manifest
if: steps.verify-resolution.outputs.resolved == 'true'
run: |
echo "::group::Verifying CARTO features manifest patterns"

if [ ! -f .github/carto-features.yml ]; then
echo "::notice::carto-features.yml not found - skipping manifest verification"
echo "::endgroup::"
exit 0
fi

python3 -c "
import yaml, subprocess
with open('.github/carto-features.yml') as f:
data = yaml.safe_load(f)
missing = []
for feat in data.get('features', []):
for v in feat.get('verification', []):
r = subprocess.run(['grep', '-q', v['pattern'], v['file']], capture_output=True)
if r.returncode == 0:
print(f'OK: {feat[\"name\"]} - {v[\"pattern\"]} in {v[\"file\"]}')
else:
print(f'MISSING: {feat[\"name\"]} - {v[\"pattern\"]} in {v[\"file\"]}')
missing.append(f'{feat[\"name\"]}: {v[\"pattern\"]} in {v[\"file\"]}')
if missing:
print(f'\n::warning::CARTO features manifest: {len(missing)} pattern(s) missing (Claude may have intentionally changed code):')
for m in missing:
print(f' - {m}')
else:
print('\nAll CARTO feature patterns verified.')
"

echo "::endgroup::"

- name: Complete merge commit (HARDCODED - creates merge with both parents)
id: complete-merge
if: steps.verify-resolution.outputs.resolved == 'true'
Expand Down
Loading