Build flake-lock-report Rust plugin for PR flake.lock changes #81
Labels
No labels
plugin/bun2nix
plugin/cargo-build
plugin/cargo-clippy
plugin/cargo-nextest
plugin/cargo-publish
plugin/cargo-verify
plugin/command-suite
plugin/flake-checker
plugin/flake-lock-report
plugin/forgejo-file-sync
plugin/forgejo-opencode-review
plugin/forgejo-pr-merge
plugin/forgejo-release
plugin/new
plugin/nix-build
plugin/nixidy-cli
plugin/nixidy-switch
plugin/nix-unit
plugin/ntfy
plugin/oci-build-push
plugin/oci-copy
plugin/openapi-to-rust
plugin/path-filter
plugin/renovate-config-check
plugin/woodpecker-lint
type
feature
type
task
automerge
bug
dependencies
duplicate
help wanted
invalid
lang
rust
migrations
opencode
question
security
type
documentation
type
enhancement
type
maintenance
type
refactor
vulnerability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
Personal/woodpecker-plugins#81
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Create a Rust Woodpecker plugin,
flake-lock-report, that runs on pull requests and publishes one idempotent PR comment describing changes toflake.lock. It reports only direct root inputs, prefers upstream release notes when inputs are tagged, and falls back to changelog/compare links with capped commit summaries.Context
The workspace already has Rust plugins built with
woodpecker-plugins-core,mkRustPlugin, and Forgejo API helpers (plugins/forgejo-opencode-review,plugins/forgejo-release).my-clientsexposesrepo_get_raw_file,repo_compare_diff,repo_list_releases, andrepo_get_release_by_tag, so the base lockfile and Forgejo-hosted upstreams can be read without a full clone or agitbinary.PR pipelines often update
flake.lockthrough Renovate or manual input bumps. Reviewers need the input-level delta and upstream context without reading the raw lock diff. The plugin is standalone and can be placed before or after anixidy-switchstep; it has no code dependency on Nixidy.No existing issue covers this. #63 proposes PR-description updates in
forgejo-opencode-reviewand is a different feature.Scope
plugins/flake-lock-reportwith adefault.nixusingmkRustPlugin.root.inputs, includingfollowspaths; ignore transitive nodes.flake.lockvia Forgejorepo_get_raw_fileat the PR base ref; read the head lockfile from the workspace.0.1.0.Design
Lockfile flow
resolve_ci_vars.repo_get_raw_file; read the head lockfile from the workspace orhead_lock_path.lock_pathsentry, parse both files and diff.Direct inputs
root.inputsentries map names to node keys orfollowsarrays.include_indirect(defaultfalse) may list them compactly without network access.type = "indirect"nodes are not fetched.Change detection
updatedwhenlocked.revdiffers, plusnarHash/originalchanges.added/removedwhen a direct input exists on only one side.path,tarball,indirect) by comparinglocked/originalfields.Upstream enrichment order
original.refandlocked.ref(refs/tags/...or bare tags; rejectrefs/heads/*and commit SHAs)./repos/{owner}/{repo}/releases/tags/{tag}./projects/{id}/releases/{tag}.repo_get_release_by_tag.(old, new]by semver when both tags parse; otherwise show available releases.repo_compare_diff.revCountwhen available to avoid huge ranges.Comment behaviour
<!-- flake-lock-report -->.dry_runrenders to stdout without posting.Safety and failure handling
github_tokenis sent only to GitHub.flake.lockat base skips quietly; other base-fetch errors fail with an actionable message.Settings
forgejo_urlPLUGIN_FORGEJO_URLCI_FORGEJO_URLforgejo_tokenPLUGIN_FORGEJO_TOKENCI_FORGEJO_TOKENgithub_tokenPLUGIN_GITHUB_TOKENlock_pathsPLUGIN_LOCK_PATHSflake.lockbase_refPLUGIN_BASE_REFmax_commitsPLUGIN_MAX_COMMITS10max_comment_bytesPLUGIN_MAX_COMMENT_BYTES60000prefer_releasesPLUGIN_PREFER_RELEASEStruemax_releasesPLUGIN_MAX_RELEASES10max_release_excerpt_linesPLUGIN_MAX_RELEASE_EXCERPT_LINES15include_indirectPLUGIN_INCLUDE_INDIRECTfalseinclude_changelogPLUGIN_INCLUDE_CHANGELOGtruedry_runPLUGIN_DRY_RUNfalsebase_lock_path/head_lock_pathPLUGIN_*allowed_hostsPLUGIN_ALLOWED_HOSTSAcceptance criteria
plugins/flake-lock-reportis a Rust workspace member and builds viamkRustPluginas both.#flake-lock-reportand.#flake-lock-report-image.flake.lockinput, the plugin posts or updates one marker comment with input name, source, old/new rev, and compare/release/changelog links.include_indirectonly affects display.nixidy-switch.cargo test -p flake-lock-report,cargo clippy -p flake-lock-report -- -D warnings,just lint, andnix build .#flake-lock-reportpass.Out of scope
forgejo-opencode-review.nixidy-switchplugin implementation.Dependencies
forgejo-opencode-review; this plugin posts a dedicated comment and does not depend on it.my-clientsForgejo endpoints already used byforgejo-releaseandforgejo-opencode-review.Phases
0.1.0.