Name the vote-passed versions explicitly; never take them positionally (#822)

`vote-passed <old_version>` published the version resolved from the tag and
deleted the version passed as the argument. Two versions that do opposite things,
and only one of them positional - the deleted one. Reading `vote-passed 9.7.0` as
"release 9.7.0" is the natural interpretation, and it would have promoted 9.7.0
into dist/release and then immediately svn rm'd it.

Take them by name, or ask for them:

    vote-passed --release 9.7.0 --old_version 9.6.0
    vote-passed --release 9.7.0 --no-cleanup
    vote-passed                              # asks for both

Anything not named is prompted for, each prompt saying what will happen to that
version. Positional arguments are now an error pointing at the named form, so
existing muscle memory fails loudly rather than quietly meaning something else.
Equal versions are refused and the release version must already be tagged.
RELEASE_VERSION and OLD_VERSION still work, with the flags winning over them.

Versions are validated by one anchored regex, shared with cleanup. A glob such as
[0-9]*.[0-9]*.[0-9]* accepts "9.7.0/", which is textually different from "9.7.0"
and so slips past the equality guard, yet SVN canonicalises the trailing slash -
cleanup would have deleted the release promote had just published. Anchoring also
rejects whitespace, v-prefixes, traversal and command characters before any of it
reaches an svn path.

The defaults behind the prompts were wrong too. The release version came from the
highest version tag, but releases are not monotonic: a 9.6.1 patch cut from the
9.6.0 line after 9.7.0 has shipped is newer in time but lower in version, so the
suggestion would have been the already-released 9.7.0. Order by tag creation date
instead - maven-release-plugin writes annotated tags, so that timestamp belongs to
the tag and survives fetches. The old version now comes from dist/release, the
only place that knows what this release actually replaces, with the version being
released filtered out so re-running after a partial failure cannot offer to delete
it.

Both detectors are genuinely best effort. Under `set -euo pipefail` a failed
svn ls, or a grep matching nothing - which is exactly the state after a partial
failure, when only the new release remains - aborted the release instead of
yielding no suggestion, leaving the "could not read dist/release" branch
unreachable. They now return success with empty output.

Testing the flags uncovered a bug that predates them and reached every command.
error() wrote to stdout, and resolve_version is always called as
`version=$(resolve_version ...)`, so its message was captured into the variable
instead of shown: releasing an untagged version aborted, correctly, but printed
nothing about why. info/warn/error now write to stderr. The email templates use
plain echo, so they stay on stdout and remain pipeable.
2 files changed
tree: cfda12b9c1a95e72ff6d85c99272672cc4c89e45
  1. .claude/
  2. .github/
  3. .mvn/
  4. apm-application-toolkit/
  5. apm-checkstyle/
  6. apm-commons/
  7. apm-protocol/
  8. apm-sniffer/
  9. changes/
  10. dist-material/
  11. docs/
  12. test/
  13. tools/
  14. .asf.yaml
  15. .dlc.json
  16. .dockerignore
  17. .gitignore
  18. .gitmodules
  19. .licenserc.yaml
  20. CHANGES.md
  21. CLAUDE.md
  22. codeStyle.xml
  23. CONTRIBUTING.md
  24. Dockerfile
  25. HEADER
  26. LICENSE
  27. lombok.config
  28. Makefile
  29. mvnw
  30. mvnw.cmd
  31. NOTICE
  32. pom.xml
  33. README.md
README.md

Apache SkyWalking Java Agent

GitHub stars Twitter Follow

Maven Central CI

SkyWalking-Java: The Java Agent for Apache SkyWalking, which provides the native tracing/metrics/logging abilities for Java projects.

SkyWalking: an APM(application performance monitor) system, especially designed for microservices, cloud native and container-based (Docker and Kubernetes) architectures.

Documentation

Downloads

Please head to the releases page to download a release of Apache SkyWalking.

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please follow the REPORTING GUIDELINES to report unacceptable behavior.

Live Demo

Find the demo and screenshots on our website.

Contact Us

  • Mail list: dev@skywalking.apache.org. Mail to dev-subscribe@skywalking.apache.org, follow the reply to subscribe the mail list.
  • Send Request to join SkyWalking slack mail to the mail list(dev@skywalking.apache.org), we will invite you in.
  • For Chinese speaker, send [CN] Request to join SkyWalking slack mail to the mail list(dev@skywalking.apache.org), we will invite you in.
  • Twitter, ASFSkyWalking
  • bilibili B站 视频

License

Apache 2.0 License.