Skip to content

Package versions: compute them from git instead of bumping them in every PR #689

Open

Description

@robotosaith

Every PR that touches a package bumps its version file, and open PRs keep taking the same number. Two branches that write the same version line merge without a conflict, so the second one ships new contents under a published number unless someone catches it (review lessons L-12, L-404, L-426, L-477). Today that's fixed three ways: contributors add renumber commits (#542, #371), the maintainer pushes "main merged, and the version main hasn't taken" onto contributor branches (#640, #642), or a follow-up PR fixes the numbers after the merge (#683). It costs a check in every review and still slips through.

Proposal: nobody writes the last number. version keeps only the series (0.2), and a small helper, tools/pkg-version <package>, prints the full version at build time: the series plus the number of commits on main that touched packages/<package>. Main is never rewritten, so each number maps to exactly one tree. The PKGBUILDs read pkgver from the helper instead of cat version.

  • On main the nightly build gets 0.2.131; an untouched package keeps its number, so build-packages skips it as it does now.
  • A branch build gets 0.2.130.1.g<sha>: above main's current build, below its next one, so a phone with a test build upgrades cleanly.
  • tools/phone-install-package computes the version on the laptop and sends it along, since the phone gets no .git; a shallow clone or a copy without git refuses to build rather than guess.
  • tools/pkg-version --commit <package> <version> maps a version from a bug report back to its commit.
  • A deliberate jump (0.2 to 0.3) is still a one-line edit, and the first computed number per package starts from today's version, so nothing goes backwards.

What changes for contributors and reviews: PRs no longer touch version, and subjects drop the number (omamobile-shell: …). The 9 >= dependencies between our own packages can't name a number a PR doesn't know yet, so a new one becomes a provides feature name, as omamobile-notification-snapshot>=1 already does. CONTRIBUTING and the version lessons would change to match.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions