Skip to content

feat: robust dependabot auto-approval with release age check#189

Merged
marcusburghardt merged 2 commits intocomplytime:mainfrom
marcusburghardt:006-robust-dependabot-approval
Apr 13, 2026
Merged

feat: robust dependabot auto-approval with release age check#189
marcusburghardt merged 2 commits intocomplytime:mainfrom
marcusburghardt:006-robust-dependabot-approval

Conversation

@marcusburghardt
Copy link
Copy Markdown
Contributor

Summary

Replace the fragile dependency-usage-based auto-approval gate with robust criteria: non-major version bump, 24h+ release age, no vulnerabilities, and CI passing. Simplify the dependency information extraction by using dependabot commit metadata as the primary source with diff parsing as supplementary enrichment. Keep dependency usage as informational context in PR comments.

Key changes:

  • Rewrite the 112-line extraction step with a ~30-line metadata-first approach (commit metadata → diff enrichment → title fallback)
  • Add ecosystem-specific release age check (GitHub Actions, Go proxy, PyPI)
  • Replace UPDATES_COUNT > 10 approval gate with release_age_hours >= MIN_RELEASE_AGE_HOURS && risk != high && review == success
  • Extract 24h threshold to workflow-level env: MIN_RELEASE_AGE_HOURS constant
  • Enrich PR comments with release age, auto-approval rationale, and informational usage data
  • Add header comment block to ci_dependencies.yml
  • Remove set -e, nested while loops, and temp file I/O from extraction step

Related Issues

Review Hints

  • The two workflow files to focus on are .github/workflows/reusable_dependabot_reviewer.yml (extraction, risk classification, release age) and .github/workflows/ci_dependencies.yml (approval criteria, PR comment).

  • Review the commits in sequence: the first commit (feat:) contains all workflow changes; the second commit (fix:) contains the spec renumbering (005→006), specification analysis fixes, and documentation alignment.

  • The specs/006-robust-dependabot-approval/ directory contains the full specification artifacts (spec, plan, tasks, research, data model, quickstart, manual test checklist). These are documentation-only and do not affect runtime behavior.

  • Run make lint to verify YAML linting passes. Run make sync-dry-run to confirm ci_dependencies.yml is in the sync list.

  • The MIN_RELEASE_AGE_HOURS constant (currently 24) is defined once at workflow level and referenced in both the approval condition and the PR comment auto-approval display.

Replace fragile dependency-usage-based auto-approval gate with robust
criteria: non-major version bump, 24h+ release age, no vulnerabilities,
and CI passing. Simplify dependency extraction by using dependabot commit
metadata as primary source with diff parsing as supplementary enrichment.

Key changes:
- Remove set -e, nested while loops, and temp file I/O from extraction
- Add commit metadata parsing (dependency-name, version, update-type)
- Add release age check via ecosystem-specific APIs (GitHub, Go proxy, PyPI)
- Update auto-approval condition: risk + review + release_age >= 24h
- Keep dependency usage as informational context in PR comments
- Fix Go submodule and Python subpath ecosystem detection
- Improve usage search timeout handling with 30s timeout and longer backoff
- Add structured rationale table to PR comments

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Renumber feature branch and spec directory from 005 to 006. Fix all
issues identified by specification analysis: extract 24h threshold to
workflow-level env constant (Principle I), add header comment block to
ci_dependencies.yml (constitution requirement), fix contradictory
multi-dependency handling claims in spec, correct line count summary in
plan, clarify release_age_hours phasing in tasks, standardize
terminology, add CI dependency chain verification task, and create
structured manual test checklist for acceptance scenarios.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt force-pushed the 006-robust-dependabot-approval branch from 430f3b6 to ee561af Compare April 13, 2026 08:46
Copy link
Copy Markdown
Member

@hbraswelrh hbraswelrh left a comment

Choose a reason for hiding this comment

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

LGTM. Manual + Agent Assisted Review. Great work!

Results from Local Review with Agent:

Runtime changes are minimal and focused — only 2 workflow
files actually change behavior

  • Safer approval criteria — the old UPDATES_COUNT > 10 gate was
    gameable and noisy; the new multi-criteria check (non-major +
    24h age + clean review) is more meaningful
  • Extraction simplification is a clear win — replaces fragile
    diff parsing with dependabot's own commit metadata, which is
    the canonical source
  • Safe defaults — unknown release age (-1) blocks auto-approval
    rather than allowing it
  • Bulk of the +1041 lines is spec documentation — no runtime
    impact

The only nit I'd note is date -d is GNU-only (won't work on
macOS), but since this exclusively runs on GitHub runners
(Ubuntu), that's a non-issue.

@marcusburghardt marcusburghardt merged commit 9253a9e into complytime:main Apr 13, 2026
13 checks passed
@marcusburghardt marcusburghardt deleted the 006-robust-dependabot-approval branch April 13, 2026 09:25
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