Skip to content

feat(packages): add package updaters#249

Merged
Bad3r merged 14 commits into
mainfrom
feat/package-updaters
May 17, 2026
Merged

feat(packages): add package updaters#249
Bad3r merged 14 commits into
mainfrom
feat/package-updaters

Conversation

@Bad3r
Copy link
Copy Markdown
Owner

@Bad3r Bad3r commented May 17, 2026

Summary

  • add Python updateScript passthroughs for azd, gitlawb, malimite, and opendirectorydownloader
  • port brave-origin from update.sh to update.py while keeping generated metadata ownership explicit
  • reshape package release metadata where needed so updaters can rewrite stable attrsets

Test plan

  • Not rerun during this publication pass. Validation and testing were completed before commit and push.

@Bad3r Bad3r added type(enhancement) Net-new capability or intentional improvement. priority(p3) Normal priority. area(packages) Package definitions, overrides, overlays, or package-source selection. area(automation) Use for scheduled jobs, sync jobs, or workflow-driven operational behavior; not for bot origin. labels May 17, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in ❄️ NixOS May 17, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 17, 2026

Claude finished @Bad3r's task in 6m 45s —— View job


No issues found.
• Branch: feat/package-updaters

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Python-based update scripts for several packages, including azd, brave-origin, gitlawb, malimite, and opendirectorydownloader, replacing older shell scripts or adding new automation. The corresponding Nix expressions are updated to link these scripts via passthru.updateScript. Feedback across all new update scripts highlights a maintainability issue where URL strings are hardcoded in rendering functions, duplicating the structure of existing URL templates; reviewers suggest deriving these strings directly from the templates to ensure consistency.

Comment thread packages/azd/update.py Outdated
Comment thread packages/brave-origin/update.py Outdated
Comment thread packages/gitlawb/update.py Outdated
Comment thread packages/malimite/update.py Outdated
Comment thread packages/opendirectorydownloader/update.py Outdated
Comment thread packages/brave-origin/update.py
Comment thread packages/brave-origin/update.py
Comment thread packages/brave-origin/update.py
Comment thread packages/azd/update.py
Comment thread packages/malimite/update.py
Bad3r added 5 commits May 17, 2026 21:01
Expose packages/azd/update.py through passthru.updateScript so azd can refresh
azure-dev-cli_<version> releases and the Linux asset hashes from GitHub.
The updater rewrites the downloads attrset for azd-linux-amd64.tar.gz and
azd-linux-arm64.tar.gz.

Validation: not run. User confirmed validation and testing were already
completed before this commit flow.
Replace the shell updater with packages/brave-origin/update.py so the generated
expression and passthru.updateScript use the same Python updater pattern as the
other package updaters. The updater keeps x86_64-linux as the required
brave-origin-nightly asset and rewrites available Linux and Darwin archives.

Validation: not run. User confirmed validation and testing were already
completed before this commit flow.
Expose packages/gitlawb/update.py through passthru.updateScript and make the
release archive metadata an updater-owned attrset. The updater follows the
v<version> Gitlawb release tags and rewrites the x86_64-linux musl archive hash.

Validation: not run. User confirmed validation and testing were already
completed before this commit flow.
Expose packages/malimite/update.py through passthru.updateScript and make the
Malimite archive name and JAR name derive from version. The updater follows the
numeric release tag, rewrites archives.linux, and refreshes the fetchzip hash.

Validation: not run. User confirmed validation and testing were already
completed before this commit flow.
Expose packages/opendirectorydownloader/update.py through passthru.updateScript
so the package can refresh v<version> release archives. The updater checks both
Linux self-contained ZIP assets and rewrites the downloads attrset hashes.

Validation: not run. User confirmed validation and testing were already
completed before this commit flow.
@Bad3r Bad3r force-pushed the feat/package-updaters branch from 9c4a348 to b696053 Compare May 17, 2026 18:10
Bad3r added 3 commits May 17, 2026 21:16
Generated Nix URLs now come from each updater URL template, so the prefetch path and rendered default.nix path cannot drift when an upstream download URL changes.

This also removes the unused azd required_assets version argument, which made call sites look version-sensitive even though ASSET_NAMES is static.

Validation: uv run python -m py_compile packages/azd/update.py packages/brave-origin/update.py packages/gitlawb/update.py packages/malimite/update.py packages/opendirectorydownloader/update.py

Validation: uv run python - <<PY render checks passed PY

Validation: nix fmt -- packages/azd/update.py packages/brave-origin/update.py packages/gitlawb/update.py packages/malimite/update.py packages/opendirectorydownloader/update.py
brave-origin now matches the other Python updaters in this PR. It skips archive hash prefetches when the packaged version already matches upstream, while --force keeps the explicit path for recomputing unchanged release assets.

Dry runs now print the unified diff that would be written to default.nix instead of a summary line, so review does not require mutating the file.

Validation: nix fmt -- packages/brave-origin/update.py

Validation: uv run python -m py_compile packages/brave-origin/update.py

Validation: uv run python - <<PY brave behavior checks passed PY
Fetchzip-style package updaters now use calculate_platform_hashes with unpack=True, so Malimite and OpenDirectoryDownloader share the same parallel prefetch path as the other platform updaters.

The helper forwards unpack to calculate_url_hash, preserving the existing default for archive fetches while adding the explicit unpacked mode needed by fetchzip sources.

Validation: nix fmt -- scripts/updater/platforms.py packages/malimite/update.py packages/opendirectorydownloader/update.py

Validation: uv run python -m py_compile scripts/updater/platforms.py packages/malimite/update.py packages/opendirectorydownloader/update.py

Validation: PYTHONPATH=scripts uv run python - <<PY platform unpack checks passed PY

Validation: rg -n "calculate_fetchzip|calculate_url_hash" packages/malimite/update.py packages/opendirectorydownloader/update.py scripts/updater/platforms.py
@Bad3r
Copy link
Copy Markdown
Owner Author

Bad3r commented May 17, 2026

Addressed the review feedback locally in three commits.

Approved and implemented:

  • Rendered Nix download URLs now derive from each updater URL template instead of duplicating hardcoded URL structure. The azd updater also no longer passes an unused version argument through the static asset helper.
  • brave-origin now matches the other Python updaters: --force is available, unchanged versions short-circuit before archive hash prefetches, and --dry-run prints a unified diff.
  • Malimite and OpenDirectoryDownloader now use the shared calculate_platform_hashes(..., unpack=True) path for unpacked fetchzip hashes instead of local serial loops.

Rejected: none.

Reliability impact: the accepted changes keep prefetch and render paths tied to the same templates, avoid unnecessary network and Nix prefetch work on unchanged brave-origin releases, preserve an explicit force path for upstream asset re-uploads, and centralize unpacked hash calculation in the shared updater helper.

Validation performed:

  • nix fmt -- packages/azd/update.py packages/brave-origin/update.py packages/gitlawb/update.py packages/malimite/update.py packages/opendirectorydownloader/update.py
  • uv run python -m py_compile packages/azd/update.py packages/brave-origin/update.py packages/gitlawb/update.py packages/malimite/update.py packages/opendirectorydownloader/update.py
  • uv run python - <<PY render checks passed PY
  • nix fmt -- packages/brave-origin/update.py
  • uv run python -m py_compile packages/brave-origin/update.py
  • uv run python - <<PY brave behavior checks passed PY
  • nix fmt -- scripts/updater/platforms.py packages/malimite/update.py packages/opendirectorydownloader/update.py
  • uv run python -m py_compile scripts/updater/platforms.py packages/malimite/update.py packages/opendirectorydownloader/update.py
  • PYTHONPATH=scripts uv run python - <<PY platform unpack checks passed PY
  • rg -n "calculate_fetchzip|calculate_url_hash" packages/malimite/update.py packages/opendirectorydownloader/update.py scripts/updater/platforms.py

The packaged 3.5.0.6 archive set should only expose the linux-x64
self-contained zip. Removing downloads.aarch64-linux keeps meta.platforms
derived from the remaining archive and makes non-x86 hosts fail through the
existing unsupported-system lookup.

Validation:
- nix-instantiate --parse packages/opendirectorydownloader/default.nix
- git diff --cached --check -- packages/opendirectorydownloader/default.nix
- nix eval --accept-flake-config --json \
  .#nixosConfigurations.system76.pkgs.opendirectorydownloader.meta.platforms
- aarch64-linux src eval failed with "opendirectorydownloader: unsupported
  system aarch64-linux"
Comment thread packages/opendirectorydownloader/update.py
Bad3r added 4 commits May 17, 2026 22:18
azd moves to 1.25.1 and brave-origin moves to 1.92.67 with refreshed
source hashes. tweakcc moves to upstream commit 7a72cb14d253, dated
unstable-2026-05-16.

Piebald-AI/tweakcc now ships a pnpm-workspace.yaml without a packages
entry, which makes fetchPnpmDeps fail with "packages field missing or
empty". Removing that stale workspace file in postPatch lets the root
lockfile importer drive dependency hash generation again.

Validation:
- nix-instantiate --parse packages/azd/default.nix packages/brave-origin/default.nix packages/brave-origin/make-brave.nix packages/tweakcc/package.nix
- jq empty packages/tweakcc/hashes.json
- uv run python -m py_compile packages/brave-origin/update.py
- git diff --check
Comment thread packages/azd/update.py Outdated
The automated review flagged that check_assets still accepted version after
required_assets stopped using it. Dropping the parameter keeps both call sites
honest and removes the dead argument from release validation.

Validation:
- nix fmt -- packages/azd/update.py
- uv run python -m py_compile packages/azd/update.py
- rg -n "check_assets\(|def check_assets|required_assets\(" packages/azd/update.py
@Bad3r

This comment has been minimized.

@Bad3r
Copy link
Copy Markdown
Owner Author

Bad3r commented May 17, 2026

Addressed the new automated review finding in commit e547c3d.

Approved and implemented:

  • Removed the stale version parameter from packages/azd/update.py check_assets and updated both call sites that passed it.

Rejected: none.

Reliability impact: release asset validation now has a single accurate function contract, so future updater changes do not carry misleading dead arguments through the release-selection path.

Validation performed:

  • nix fmt -- packages/azd/update.py
  • uv run python -m py_compile packages/azd/update.py
  • rg -n "check_assets(|def check_assets|required_assets(" packages/azd/update.py

@Bad3r Bad3r merged commit b1ec6ef into main May 17, 2026
1 check passed
@Bad3r Bad3r deleted the feat/package-updaters branch May 17, 2026 21:18
@github-project-automation github-project-automation Bot moved this from Backlog to Done in ❄️ NixOS May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area(automation) Use for scheduled jobs, sync jobs, or workflow-driven operational behavior; not for bot origin. area(packages) Package definitions, overrides, overlays, or package-source selection. priority(p3) Normal priority. type(enhancement) Net-new capability or intentional improvement.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant