Skip to content

Commit 2913f1b

Browse files
authored
{CI} Ignore downloadUrl when comparing index.json entries and always run service_name check (#9358)
- Add entry_equals_ignore_url to detect modified index.json entries while ignoring downloadUrl differences (avoids treating URL-only changes as metadata changes). - Replace direct entry inequality with URL-agnostic comparison to build correct modified_entries list. - Remove special-case skip for 'deploy-to-azure' so service_name.check runs for all external extensions.
1 parent 872defb commit 2913f1b

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

scripts/ci/azdev_linter_style.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,27 @@ def azdev_on_external_extension(index_json, azdev_type):
179179
with open(index_json, 'r') as fd:
180180
current_extensions = json.loads(fd.read()).get("extensions")
181181

182+
def entry_equals_ignore_url(entry1, entry2):
183+
"""Compare two entries ignoring downloadUrl field"""
184+
entry1_copy = entry1.copy()
185+
entry2_copy = entry2.copy()
186+
entry1_copy.pop('downloadUrl', None)
187+
entry2_copy.pop('downloadUrl', None)
188+
return entry1_copy == entry2_copy
189+
182190
for name in current_extensions:
183-
modified_entries = [entry for entry in current_extensions[name] if entry not in public_extensions.get(name, [])]
191+
public_entries = public_extensions.get(name, [])
192+
193+
# Find modified entries by comparing without downloadUrl
194+
modified_entries = []
195+
for entry in current_extensions[name]:
196+
is_modified = True
197+
for public_entry in public_entries:
198+
if entry_equals_ignore_url(entry, public_entry):
199+
is_modified = False
200+
break
201+
if is_modified:
202+
modified_entries.append(entry)
184203

185204
if not modified_entries:
186205
continue
@@ -205,8 +224,7 @@ def azdev_on_external_extension(index_json, azdev_type):
205224
# azdev_extension.style()
206225

207226
logger.info('Checking service name for external extensions: %s', name)
208-
if name != 'deploy-to-azure':
209-
service_name.check()
227+
service_name.check()
210228

211229
az_extension.remove()
212230

0 commit comments

Comments
 (0)