Skip to content

Commit a6af161

Browse files
committed
Merge remote-tracking branch 'origin/master' into mcculls/context-continuations
2 parents d7356c1 + d875e4f commit a6af161

15 files changed

Lines changed: 256 additions & 18 deletions

File tree

.github/scripts/dependency_age.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def validate_lockfiles(args: argparse.Namespace) -> int:
439439
elif published_at > cutoff:
440440
hours_remaining = int((published_at - cutoff).total_seconds() / 3600) + 1
441441
group_id, artifact_id, version = gav.split(":", 2)
442-
baseline_version = next((c[len(f"{group_id}:{artifact_id}:"):] for c in baseline_coords if c.startswith(f"{group_id}:{artifact_id}:")), None)
442+
baseline_version = highest_baseline_version(baseline_coords, group_id, artifact_id)
443443
eligible = find_eligible_version(
444444
group_id=group_id, artifact_id=artifact_id,
445445
too_new_version=version, baseline_version=baseline_version,
@@ -678,6 +678,15 @@ def fetch_available_versions(group_id: str, artifact_id: str, repo_urls: list[st
678678
return []
679679

680680

681+
# select the highest baseline version of group:artifact present in a lockfile.
682+
def highest_baseline_version(baseline_coords: set[str], group_id: str, artifact_id: str) -> str | None:
683+
prefix = f"{group_id}:{artifact_id}:"
684+
versions = [coord[len(prefix):] for coord in baseline_coords if coord.startswith(prefix)]
685+
if not versions:
686+
return None
687+
return max(versions, key=_version_sort_key)
688+
689+
681690
# for a too-new coordinate, walk backward through available versions to find the newest one
682691
# that meets the age cutoff and is newer than the baseline version
683692
def find_eligible_version(

.github/scripts/tests/test_dependency_age.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import argparse
2+
import contextlib
3+
import io
14
import json
25
import os
36
import re
@@ -6,7 +9,9 @@
69
import sys
710
import tempfile
811
import unittest
12+
from datetime import datetime, timezone
913
from pathlib import Path
14+
from unittest import mock
1015

1116
REPO_ROOT = Path(__file__).resolve().parents[3]
1217
SCRIPT = REPO_ROOT / ".github/scripts/dependency_age.py"
@@ -469,6 +474,24 @@ def test_summary_groups_outcomes_into_sections(self) -> None:
469474
self.assertIn("com.example:update-lib:4.0.0", updated_block)
470475
self.assertIn("updated to `3.9.0`", updated_block)
471476

477+
def test_highest_baseline_version_picks_newest_of_coexisting_pins(self) -> None:
478+
# A single lockfile can pin the same artifact at several versions (one per Gradle
479+
# configuration). The baseline should be the newest so that only versions higher than
480+
# the highest existing version are considered upgrades.
481+
baseline_coords = {
482+
"ch.qos.logback:logback-core:1.1.11",
483+
"ch.qos.logback:logback-core:1.2.13",
484+
"ch.qos.logback:logback-core:1.5.34",
485+
"com.example:unrelated:9.9.9",
486+
}
487+
self.assertEqual(
488+
dependency_age.highest_baseline_version(baseline_coords, "ch.qos.logback", "logback-core"),
489+
"1.5.34",
490+
)
491+
self.assertIsNone(
492+
dependency_age.highest_baseline_version(baseline_coords, "ch.qos.logback", "logback-classic")
493+
)
494+
472495
def test_summary_omits_empty_sections(self) -> None:
473496
# only too-new violations -> only the "reverted" section should appear
474497
summary = dependency_age.build_validation_summary(

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout "cloudfoundry" branch
13-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
13+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
1414
with:
1515
ref: cloudfoundry
1616
- name: Get release version

.github/workflows/analyze-changes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2020
with:
2121
submodules: 'recursive'
2222
- name: Cache Gradle dependencies
@@ -55,7 +55,7 @@ jobs:
5555

5656
steps:
5757
- name: Checkout repository
58-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
58+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
5959
with:
6060
submodules: 'recursive'
6161

.github/workflows/create-release-branch.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
echo "branch=release/${TAG%.0}.x" >> "$GITHUB_OUTPUT"
4444
4545
- name: Check out repo at tag
46-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
46+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
4747
with:
4848
ref: ${{ steps.determine-tag.outputs.tag }}
4949

@@ -82,7 +82,7 @@ jobs:
8282
policy: self.pin-system-tests.create-pr
8383

8484
- name: Check out repo at release branch
85-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
85+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
8686
with:
8787
ref: ${{ needs.create-release-branch.outputs.release-branch-name }}
8888

.github/workflows/run-system-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
group: APM Larger Runners
2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
27+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2828
with:
2929
submodules: 'recursive'
3030
fetch-depth: 0

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
policy: self.update-gradle-dependencies.create-pr
2222

2323
- name: Checkout repository
24-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2525
with:
2626
submodules: "recursive"
2727

28-
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
28+
- uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
2929
with:
3030
distribution: 'temurin'
3131
java-version: '21'

.github/workflows/update-jmxfetch-submodule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-jmxfetch-submodule.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
22+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2323

2424
- name: Update Submodule
2525
run: |

.github/workflows/update-smoke-test-latest-versions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
policy: self.update-smoke-test-latest-versions.create-pr
2222

2323
- name: Checkout repository
24-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2525

2626
- name: Define branch name
2727
id: define-branch

.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,11 @@ muzzle-dep-report:
788788
# Apache Maven Wrapper supports MVNW_REPOURL for repository-manager downloads:
789789
# https://maven.apache.org/tools/wrapper/#Using_a_Maven_Repository_Manager
790790
- export MVNW_REPOURL=${MAVEN_REPOSITORY_PROXY%/}
791+
# Route Gradle distribution download through MASS pull-through cache
792+
- |
793+
mass_read_host="${MASS_READ_URL#https://}"
794+
mass_read_host="${mass_read_host%/}"
795+
sed -i "/^distributionUrl=/ s|services.gradle.org|${mass_read_host}/internal/artifact/services.gradle.org|" gradle/wrapper/gradle-wrapper.properties
791796
- *normalize_node_index
792797
- *prepare_test_env
793798
# Disable CDS in forked JVMs to avoid SIGSEGVs on Linux arm64.
@@ -1110,6 +1115,7 @@ test_smoke_graalvm:
11101115
needs: *needs_build_tests_smoke
11111116
tags: [ "arch:amd64" ]
11121117
variables:
1118+
<<: *tier_l_variables
11131119
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test :dd-smoke-test:quarkus-native:test"
11141120
CACHE_TYPE: "smoke"
11151121
CI_NO_SPLIT: "true"
@@ -1122,6 +1128,7 @@ test_smoke_graalvm_arm64:
11221128
extends: .test_job_arm64
11231129
tags: [ "arch:arm64" ]
11241130
variables:
1131+
<<: *tier_l_variables
11251132
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test :dd-smoke-test:quarkus-native:test"
11261133
CACHE_TYPE: "smoke"
11271134
CI_NO_SPLIT: "true"

0 commit comments

Comments
 (0)