Skip to content

Refactor update-dependencies skill automation #1768

Open

Description

@josecelano

Goal

Automate the update-dependencies workflow so branch creation, update execution, classification, validation, and commit metadata generation are script-assisted and less error-prone for both humans and agents.

Background

The current update workflow in .github/skills/dev/maintenance/update-dependencies/SKILL.md is clear but mostly manual.

Current pain points:

  • Branch-first flow is documented but not enforced.
  • No-op updates (no Cargo.lock changes) are detected manually.
  • Update logs and commit body generation are manual.
  • Repeated command runs can drift from the prescribed sequence.

This issue focuses only on dependency-skill automation. Pre-commit performance/verbosity is tracked separately in docs/issues/drafts/refactor-pre-commit-checks-performance-and-verbosity.md.

Automation policy constraint:

  • We do not want to lock core dependency-maintenance workflow execution to GitHub-only services (for example Dependabot).
  • The update process must remain portable to different infrastructures and reusable with different AI providers.
  • GitHub ecosystem tooling is acceptable as optional integration, but not as a mandatory dependency for the workflow.

Scope

In Scope

Out of Scope

  • Refactoring pre-commit/pre-push hooks.
  • CI check-tier redesign.
  • Non-dependency workflow changes.

Deep Analysis Summary

Current workflow in .github/skills/dev/maintenance/update-dependencies/SKILL.md:

  • Branch creation is documented but not enforced.
  • cargo update output capture to /tmp/cargo-update.txt is documented, but downstream consumption is manual.
  • Trivial/no-op updates rely on user judgment.
  • Breaking-change triage is manual and repeated across runs.

Risk:

  • Agents/developers can deviate from required sequence.
  • Inconsistent branch naming and commit metadata across dependency update PRs.
  • Higher operational friction than necessary for a routine maintenance workflow.

Proposed Changes

Task 1: Add script entrypoints for dependency updates

  • Add a script directory under the skill path (example: .github/skills/dev/maintenance/update-dependencies/scripts/).
  • Apply placement decision per script:
    • keep under the skill when only used by that skill
    • place in contrib/dev-tools/ when useful as standalone dev tooling
  • Implement script entrypoints for:
    • branch preparation (prepare-branch.sh)
    • update execution (run-update.sh)
    • verification (verify-update.sh)
    • commit message/body generation (build-commit-message.sh)
  • Ensure scripts are idempotent and safe to rerun.

Task 2: Enforce branch-first workflow

  • Script fails early when current branch is develop and dependency update changes are already present.
  • Script creates timestamp branch for trivial updates (YYYYMMDD-update-dependencies) unless issue branch is explicitly provided.
  • Script prints deterministic next actions.

Task 3: Automate update classification and no-op exit

  • Use cargo update --dry-run plus lockfile diff checks to classify:
    • no changes
    • lockfile-only trivial update
    • update requiring code changes
  • On no-op, exit success with clear message.
  • Persist update logs to a deterministic path and print it.

Task 4: Automate verification sequence

  • Script wrapper executes required checks:
    • cargo machete
    • ./contrib/dev-tools/git/hooks/pre-commit.sh
  • Support output modes:
    • concise (default): step summary + log paths
    • verbose (opt-in): streaming mode

Task 5: Update skill documentation and examples

  • Refactor skill to script-first usage.
  • Keep manual fallback path for constrained environments.
  • Document recovery actions for common failure modes.

Implementation Plan

Status values: TODO, IN_PROGRESS, BLOCKED, DONE.

ID Status Task Notes / Expected Output
T1 TODO Design script interfaces Stable script inputs/outputs and invocation examples.
T2 TODO Implement scripts Script set created with idempotent behavior.
T3 TODO Integrate scripts into skill docs Script-first flow with manual fallback.
T4 TODO Validate quality gates linter all and relevant tests pass.

Progress Tracking

Workflow Checkpoints

  • Spec drafted in docs/issues/drafts/
  • Spec reviewed and approved by user/maintainer
  • GitHub issue created and issue number added to this spec
  • Implementation completed
  • Reviewer validated acceptance criteria and updated checkboxes
  • Committer verified spec progress is up to date before commit
  • Issue closed and spec moved from docs/issues/open/ to docs/issues/closed/

Progress Log

  • 2026-05-13 07:19 UTC - Copilot - Drafted initial combined proposal.
  • 2026-05-13 07:24 UTC - Copilot - Added script placement policy (skill-local vs reusable contrib/dev-tools).
  • 2026-05-13 07:33 UTC - Copilot - Split combined proposal into two drafts; this spec now focuses only on dependency skill automation.

Acceptance Criteria

  • AC1: Dependency update workflow supports script-based execution with branch-first enforcement and no-op detection.
  • AC2: Skill docs for dependency updates are updated to script-first with manual fallback.
  • AC3: Script-location policy is documented and applied consistently (skill-local vs contrib/dev-tools).
  • AC4: Required verification sequence is script-assisted and reproducible.
  • AC5: linter all exits with code 0 after changes.
  • AC6: Relevant tests pass for modified scripts/skill behavior.

Acceptance Verification

AC ID Status (TODO/DONE) Evidence
AC1 TODO Script run outputs for branch enforcement and no-op case
AC2 TODO Updated skill docs
AC3 TODO Script inventory and final placement map
AC4 TODO Verification script output/logs
AC5 TODO linter all output
AC6 TODO Test outputs

Risks and Trade-offs

  • Automation scripts add maintenance surface.
    • Mitigation: keep scripts small, composable, and with clear interfaces.
  • Over-enforcement can reduce flexibility in exceptional cases.
    • Mitigation: allow explicit override flags with clear warnings.

References

Activity

  1. self-assigned this
    on May 13, 2026
  2. added 3 commits that reference this issue on May 13, 2026
  3. added a commit that references this issue on Jul 20, 2026
  4. da2ce7 commented on Sep 24, 2026

    @da2ce7
    Contributor

    Dependabot activity against this issue's policy line: "We do not want to lock core dependency-maintenance workflow execution to GitHub-only services (for example Dependabot)". Measured from the pull-request capture of 2026-09-24T11:03Z and the tree at develop fa698c43.

    Configuration. .github/dependabot.yaml:3-21 configures daily github-actions and cargo updates, both targeting develop.

    Outcomes.

    Dependabot pull requests Count
    All time 476
    Merged 6 (last merge 2023-11-10)
    Closed without merge 468
    Open 2 (#2327, #2328)
    Opened April to 2026-09-24 82 (80 closed without merge, 2 open)

    None of the 378 pull requests merged from April to 2026-09-24 was opened by Dependabot. Five merged pull-request bodies carry the ## cargo update output heading of docs/templates/CARGO-DEPENDENCY-UPDATE-PR.md, the body the update-dependencies skill uses (docs/templates/README.md:22).

    Head branches. All 476 Dependabot pull requests come from torrust: branches in this repository. Root AGENTS.md:347 reads: "PRs targeting develop or main must come from a fork branch (<fork-owner>:<branch>), not a branch in torrust/torrust-tracker".

    The specification PR for #2190 (#2193) records two related items: two Dependabot pull requests stalled behind the Docker E2E failure, and an allowed-actions pin that blocks bumps of taiki-e/install-action.

    Questions:

    1. Is the daily Dependabot configuration still wanted, as a notification source or otherwise, given that 80 of its last 82 pull requests closed unmerged?
    2. Does the fork-branch rule at AGENTS.md:347 cover bot pull requests, or only contributors?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions