Skip to content

Commit 871e34c

Browse files
GuanzhouSongCopilot
andcommitted
Never fill gaps from releases newer than a pinned version
The site pins the mirrored release with the DOCUMENTDB_VERSION repository variable (currently v0.113-0). The additive fill walked every other published release regardless of age, so a pin to a release older than the v0.116-0 multi-package layout would have added a newer `documentdb` meta package on top of the pinned extension. Its `documentdb-N (>= 0.116.0)` dependency cannot be satisfied by `postgresql-N-documentdb 0.113-0`, so the published repository would have been unsatisfiable -- and the pin would have been quietly defeated. A pin means "serve this version", so only the pinned release and older ones may contribute. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8df9084a-ccaf-432c-b015-2ccd8893a9d8
1 parent 227f428 commit 871e34c

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎.github/scripts/download_packages.sh‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,18 @@ if not published:
113113
114114
requested = os.environ.get("DOCUMENTDB_VERSION", "latest")
115115
if requested != "latest":
116-
primary = next((r for r in published if r["tag_name"] == requested), None)
117-
if primary is None:
116+
# The API returns releases newest-first.
117+
index = next((i for i, r in enumerate(published)
118+
if r["tag_name"] == requested), None)
119+
if index is None:
118120
sys.exit(f"Error: Version {requested} not found in releases")
119-
rest = [r for r in published if r["tag_name"] != requested]
120-
ordered = [primary] + rest
121+
# A pin means "serve this version". Only the pinned release and OLDER ones
122+
# may contribute: pulling gap-fillers from NEWER releases would defeat the
123+
# pin, and worse, it would mix releases that depend on each other. Pinning
124+
# to a release that predates the multi-package layout would otherwise add a
125+
# newer `documentdb` meta package whose `documentdb-N (>= X)` dependency the
126+
# pinned extension cannot satisfy - an unsatisfiable repository.
127+
ordered = published[index:]
121128
else:
122129
ordered = published
123130

0 commit comments

Comments
 (0)