Skip to content

Allow redirecting to unreleased androidx builds - #3283

Draft
Ivan Matkov (MatkovIvan) wants to merge 1 commit into
jb-mainfrom
ivan.matkov/snapshot-redirects
Draft

Allow redirecting to unreleased androidx builds#3283
Ivan Matkov (MatkovIvan) wants to merge 1 commit into
jb-mainfrom
ivan.matkov/snapshot-redirects

Conversation

@MatkovIvan

Copy link
Copy Markdown

CMP-10349 Allow merging non-release commits into jb-main

Release Notes

N/A

A library state could only be merged into jb-main after Google published
it to Google Maven, because that is the first moment the redirect target
of an artifact redirection becomes resolvable. Google publishes every
build cut to androidx.dev about a week earlier, but pointing the fork at
it by hand needs an unfiltered repository: one build's repository answers
for every androidx coordinate, and since library groups are released from
different commits while sharing the version string X.Y.Z-SNAPSHOT, a
group pinned to one build silently resolves from another.

Record the build instead. redirectversions.toml gains an optional
[[snapshots]] array keyed by androidx.dev build id, listing the group
prefixes whose [versions] entry is a -SNAPSHOT. RedirectVersionsService
parses and validates it: every listed group exists in [versions] and is a
-SNAPSHOT, every -SNAPSHOT is listed exactly once, and the repository
flavour is known. Each entry becomes one maven repository filtered on
group prefix AND exact version, so overlapping prefixes and two groups on
two builds stay separated, and a released version is never accepted by a
snapshot repository.

The repositories are declared from settings-fork.gradle, the single site
that configures project repositories, via a new fork-only script rather
than repos.gradle: that file is shared byte-identically with AOSP and
also configures buildscript classpaths, which never resolve redirect
coordinates. The script carries its own tomlj classpath because a
settings buildscript classpath is not visible to the script plugins
applied from it.

jbVerifyDependencyVersions ranks a -SNAPSHOT below every publishable
version, which would fail the Dev and personal Snapshot pipelines as hard
as Release and defeat the purpose. Exempt a dependency only when the
project version carries semver build metadata -- which a public release
version never does -- and the dependency matches a registered snapshot
prefix at its exact recorded version.

Deliberately left out: automating the flip back to released versions, and
any relaxation of the release gate. A snapshot-backed state must not
reach a public release, and androidx.dev per-build repositories are not
kept forever.

printAndroidxSnapshots feeds the same registry to the Gradle plugin build
of compose-multiplatform, so a dev build that redirects to snapshots
stays consumable outside this repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant