Skip to content
Merged
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
16 changes: 4 additions & 12 deletions .github/actions/package-delivery-pulp/deliver-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ for i in "${!FILES[@]}"; do
if [[ -n "${LEGACY_FRESH[$arch]+set}" ]]; then
continue
fi
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
sha=$(sha256sum "$FILE" | cut -d' ' -f1)
existing=$(lookup_deb_content "packages" "--data-urlencode sha256=$sha")
if [[ -z "$existing" ]]; then
Expand Down Expand Up @@ -312,9 +310,7 @@ UPLOAD_DIR=$(mktemp -d)
MAX_PARALLEL_UPLOADS=8
for i in "${!ORPHAN_FILES[@]}"; do
FILE=${ORPHAN_FILES[$i]}
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
# subshell-local: the inherited token can go stale between parent refreshes
refresh_pulp_token
Expand Down Expand Up @@ -343,9 +339,7 @@ for i in "${!ORPHAN_FILES[@]}"; do
ORPHAN_SHA256S+=("$(sha256sum "$FILE" | cut -d' ' -f1)")
done
for i in "${!ORPHAN_FILES[@]}"; do
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
resolve_task_content "$(cat "$UPLOAD_DIR/$i.task")" "packages" \
"--data-urlencode sha256=${ORPHAN_SHA256S[$i]}" > "$UPLOAD_DIR/$i.content"
Expand All @@ -368,9 +362,7 @@ done
# task); a failed create (already existing on a job re-run) falls back to a lookup
echo "[INFO] Associating ${#PACKAGE_HREFS[@]} package(s) with $SUITE/main"
for i in "${!PACKAGE_HREFS[@]}"; do
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
refresh_pulp_token
out=$(post_json "$PULP_URL/$PULP_DOMAIN/api/v3/content/deb/package_release_components/" \
Expand Down
8 changes: 2 additions & 6 deletions .github/actions/package-delivery-pulp/deliver-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ for ARCH in noarch x86_64; do
MAX_PARALLEL_UPLOADS=8
for i in "${!ARCH_FILES[@]}"; do
FILE=${ARCH_FILES[$i]}
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
# subshell-local: the inherited token can go stale between parent refreshes
refresh_pulp_token
Expand Down Expand Up @@ -208,9 +206,7 @@ for ARCH in noarch x86_64; do
# parallelized like the uploads: sequential took one task GET per package (~6 min at 675)
RESOLVE_DIR=$(mktemp -d)
for i in "${!TASK_HREFS[@]}"; do
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
resolve_uploaded_content "${TASK_HREFS[$i]}" "${SHA256S[$i]}" > "$RESOLVE_DIR/$i.content"
) &
Expand Down
14 changes: 8 additions & 6 deletions .github/actions/promote-to-stable-pulp/promote-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ ensure_legacy_suite_associations() {
return 1
fi
echo "[INFO] Mirroring $PACKAGES_COUNT package association(s) into $STABLE_LEGACY_REPOSITORY_NAME $STABLE_LEGACY_SUITE/main"
local units_file body_file sha href out code body prc n=0
local units_file body_file sha href out code body prc
units_file=$(mktemp)
while read -r sha; do
if ((n % 40 == 0)); then refresh_pulp_token; fi
n=$((n + 1))
refresh_pulp_token
href=$(lookup_deb_content "packages" "--data-urlencode sha256=$sha")
if [[ -z "$href" ]]; then
echo "::error::Cannot resolve the promoted package (sha256 $sha) for the $STABLE_LEGACY_SUITE mirror"
Expand Down Expand Up @@ -367,6 +366,11 @@ if ((${#BATCH_PACKAGES[@]} > 0)); then
fi
LEGACY_REF_AFTER=$(lookup_prcs "$LEGACY_REF_STABLE_HREF" | sort)
STABLE_RC_SET=$(comm -13 <(echo "$LEGACY_REF_BEFORE") <(echo "$LEGACY_REF_AFTER") | grep . || true)
# testing and stable share their domain: a suite name used by both is one
# shared release component, already associated before the legacy upload
if [[ -z "$STABLE_RC_SET" && $(echo "$LEGACY_REF_AFTER" | grep -c .) -eq 1 ]]; then
STABLE_RC_SET=$LEGACY_REF_AFTER
fi
if [[ $(echo "$STABLE_RC_SET" | grep -c .) -ne 1 ]]; then
refresh_pulp_token
STABLE_LATEST=$(pulp deb repository show --name "$STABLE_REPOSITORY_NAME" | jq -r '.latest_version_href')
Expand Down Expand Up @@ -422,9 +426,7 @@ if ((${#BATCH_PACKAGES[@]} > 0)); then
MAX_PARALLEL=8
PRC_DIR=$(mktemp -d)
for i in "${!PACKAGE_HREFS[@]}"; do
if ((i % 40 == 0)); then
refresh_pulp_token
fi
refresh_pulp_token
(
refresh_pulp_token
package_href="${PACKAGE_HREFS[$i]}"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/pulp/check-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for i in "${!E_FILENAME[@]}"; do
PRESENT_IDX[$i]=false
version_href=${VERSION_BY_REPO[${E_REPOSITORY[$i]}]}
[[ -n "$version_href" ]] || continue
((i % 40 == 0)) && refresh_pulp_token
refresh_pulp_token
url="$PULP_URL/$PULP_DOMAIN/api/v3/content/deb/packages/?$(
printf 'repository_version=%s&sha256=%s&fields=pulp_href&limit=1' \
"$(jq -rn --arg v "$version_href" '$v | @uri')" "${E_SHA256[$i]}"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/get-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ jobs:
// Filter tags matching format plugins-YYYYMMDD
for (const tag of tags) {
const match = tag.name.match(/^plugins-(\d{8})$/);
if (!match) {
continue;
}

const tagDate = parseInt(match[1], 10);

Expand Down
Loading