Skip to content

Versioning poc#1

Merged
airportyh merged 8 commits into
mainfrom
th-versions-poc
May 5, 2023
Merged

Versioning poc#1
airportyh merged 8 commits into
mainfrom
th-versions-poc

Conversation

@airportyh
Copy link
Copy Markdown
Collaborator

@airportyh airportyh commented May 4, 2023

Why?

We need to implement a versioning scheme that'll work in the short term and in the long term.
See https://replit.com/@util/Design-docs#goval/nixmodules_versions.md for more context.

Changes

  1. docs
  2. added lock_modules.py script for generating the module registry and pinning module versions
  3. added id and community-version fields to module definition
  4. moved module definition list to pkgs/modules/default.nix
  5. moved modules to subdir pkgs/modules
  6. added pruneVersion utility to get first 2 numbers of a semver, used to get the community version for modules
  7. added prybar. Depends on Added overlay prybar#108

@airportyh airportyh requested a review from ryantm May 4, 2023 21:50
Comment thread README.md
{
"modules": {
"nodejs-18.12-m1.1": {
"commit": "4ec006c0eb247320e77c0abbf46b6f9e33370f81",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to have to disallow rebase merging. Otherwise, the commits we save in the the lockfile might not end up in the registry. Another solution would be to generate the registry automatically in CI on the main branch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes rebase merging different from normal merging? In either case, it's up to the developer merging the conflict to keep both changes in the lock file. Right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It changes the git commit SHAs when it rewrites the history.

Comment thread flake.nix Outdated
Comment thread pkgs/default.nix Outdated
let
mkModule = path: pkgs.callPackage ./moduleit/entrypoint.nix {
configPath = path;
modules = import ./modules {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is importing modules in a second place in addition to the top level outputs.modules. I'd prefer to pass self into the pkgs evaluation and get the modules from self.modules

Comment thread pkgs/moduleit/entrypoint.nix Outdated
let
parts = pkgs.lib.strings.splitString "." version;
major = builtins.elemAt parts 0;
minor = builtins.elemAt parts 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/NixOS/nixpkgs/blob/master/lib/versions.nix there are already major and minor functions you could use here.

pruneVersion = lib.majorMinor

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I thought there might be.

Comment thread pkgs/modules/go/default.nix Outdated
@airportyh airportyh merged commit 030528a into main May 5, 2023
luketchang added a commit that referenced this pull request May 7, 2026
The current derivation builds upstream databricks/cli v0.286.0 from
source via buildGoModule. This commit:

  - Points src at the Replit fork (replit/databricks-cli) at tag
    v0.299.0-replit.1, which is upstream v0.299.0 plus our
    'sync: add --concurrency and --retry-timeout flags' patch (#1).
    pid2's deploy path needs that flag.

  - Replaces the 13-entry checkFlags skip list with doCheck = false.
    Bumping from v0.286.0 to v0.299.0 surfaced a new test that hangs in
    the sandbox (TestClearWorkspaceClient blocks on workspace client DNS
    resolution and times out at 10 minutes). Rather than play whack-a-
    mole with new offenders on every rebase, we skip the whole check
    phase and trust upstream CI -- same pattern pkgs/modules/python/uv
    and the docker stack already use in this repo.

  - Updates meta.homepage and meta.changelog to point at the fork.

Test plan
  nix build .#'"databricks-cli"' succeeds.
  databricks --version reports 'Databricks CLI v0.299.0-replit.1'.
  databricks sync --help shows --concurrency and --retry-timeout flags.
  nix fmt --check passes.

Slack thread:
https://replit.slack.com/archives/C0A2Z9042FR/p1778082184841149
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.

2 participants