davsclaus commented on code in PR #29428:
URL: https://github.com/apache/camel/pull/29428#discussion_r4511988034
##########
docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc:
##########
@@ -127,6 +127,53 @@ one (for example after a `--version LTS` install that
resolved to 4.22.2), `came
with a "pinned to version LTS" message. Re-run the installer with `--version
LTS` (or `--version 4.22`)
to update instead.
+== Nightly development builds
+
+Apache publishes a nightly build of the Camel CLI to the Apache snapshot
repository, for main and for the
+maintenance branches. It lets you try the latest development code, or a fix
before its patch release, without
+building Camel yourself.
+
+IMPORTANT: A nightly build is a development build for testing, not an Apache
release. Do not use it in production.
+
+[source,bash]
+----
+camel self-update --version SNAPSHOT # the newest nightly build of
main
+camel self-update --version 4.22.3-SNAPSHOT # the newest nightly build of a
maintenance branch
Review Comment:
Fixed in 33edc54e72fe, with both of your suggestions:
- The docs now have a "Nightly builds of a maintenance branch" section. It
says the Camel CLI of a maintenance branch cannot update its nightly builds
(4.22.x refuses the pin, 4.18.x has no `self-update`), and that re-running the
installer with the same `--version` updates them. The `self-update` footer says
the same.
- After installing the nightly builds of a snapshot version other than
main's, `camel self-update --version X.Y.Z-SNAPSHOT` prints a note with the
installer command. `install.sh --version X.Y.Z-SNAPSHOT` prints one too: it
reads the root metadata, best effort, and suppresses its note when
`self-update` runs it, so the note shows only once.
We can't change launchers that are already released, so I didn't make
`self-update` refuse a maintenance snapshot. Tests:
`SelfUpdateIntegrationTest.maintenanceBranchNightlyPointsAtTheInstaller` and
`WebsiteInstallTest.maintenanceBranchNightlySaysToReRunTheInstaller`. The
second one also checks that main's snapshot gets no note.
_Claude Code on behalf of davsclaus_
##########
dsl/camel-jbang/camel-launcher/src/main/java/org/apache/camel/dsl/jbang/launcher/selfupdate/SelfUpdateCommand.java:
##########
@@ -86,23 +93,42 @@ public Integer doCall() throws Exception {
// only within its selector, so an explicit --version, which could
leave it, is refused as well.
Optional<String> pinned = InstallDetector.pinnedVersion();
Pin pin = pinned.map(Pin::parse).orElse(null);
- if (pin != null && !pin.tracksAlias()) {
+ if (pin != null && !pin.tracksAlias() && !pin.followsNightlies()) {
printer().printErr("this install is pinned to version " +
pinned.get() + " - remove "
+ InstallDetector.pinnedVersionFile() + " to
resume tracking new releases");
return 1;
}
- if (pin != null && version != null) {
+ if (pin != null && pin.tracksAlias() && version != null) {
// Removing the pin file would make the install track the latest
release, which is not what asking for
// one version means, so point at the installer, which replaces
the selector pin with an exact one.
printer().printErr(selectorPinRefusal(pin, version));
return 1;
}
ManifestFetcher fetcher = fetcherOverride != null ? fetcherOverride :
ManifestFetcher.fromEnvironment();
+ if (version != null && Nightly.isNightly(version)) {
+ return updateToNightly(fetcher, info, Nightly.normalize(version),
true);
+ }
+ if (version == null && pin != null && pin.followsNightlies()) {
Review Comment:
Fixed in 33edc54e72fe. On an `X.Y.Z-SNAPSHOT` pin, `camel self-update` now
reads the root metadata and checks whether `X.Y.Z.properties` is published:
- **Still listed, but X.Y.Z released:** after the usual line, it prints
`Note: 9.9.0 has been released, so 9.9.0-SNAPSHOT gets no more nightly builds -
camel self-update --version 9.9.0 installs the release, --version SNAPSHOT
follows the nightly builds of main (9.10.0-SNAPSHOT), and --version LTS
installs the newest LTS release`. When a higher maintenance snapshot is
published, the note names it too (`--version 9.9.1-SNAPSHOT`). `--check` prints
the same note.
- **No longer listed:** it refuses with `there are no nightly builds of
9.9.0-SNAPSHOT any more (9.9.0 has been released) - camel self-update --version
9.9.0 installs the release, ...`, not the bare 404. The pin stays as it is.
Tests: `releasedSnapshotVersionNamesTheRelease` and
`removedSnapshotVersionNamesTheWaysOut` in `SelfUpdateIntegrationTest`, plus
`waysOut` unit tests in `SelfUpdateCommandTest`.
_Claude Code on behalf of davsclaus_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]