Skip to content

[#2696] Bumped git-artifact to 1.7.0 and add an option for stale deployment branch cleanup.#2827

Merged
AlexSkrypnyk merged 2 commits into
mainfrom
feature/2696-artifact-cleanup
Jul 23, 2026
Merged

[#2696] Bumped git-artifact to 1.7.0 and add an option for stale deployment branch cleanup.#2827
AlexSkrypnyk merged 2 commits into
mainfrom
feature/2696-artifact-cleanup

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Jul 22, 2026

Copy link
Copy Markdown
Member

Closes #2696

Summary

Bumps git-artifact from 1.4.0 to 1.7.0 in vortex-deploy-artifact and wires its new stale-branch cleanup so remote deployment branches left behind by deleted or merged source branches can be pruned automatically after a successful artifact push. Cleanup is controlled by two new environment variables, VORTEX_DEPLOY_ARTIFACT_CLEANUP_PATTERN and VORTEX_DEPLOY_ARTIFACT_CLEANUP_AGE, and stays disabled by default until a pattern is set.

Changes

  • .vortex/tooling/src/vortex-deploy-artifact: bumped the default git-artifact version and SHA256 checksum to 1.7.0, added VORTEX_DEPLOY_ARTIFACT_CLEANUP_PATTERN (comma-separated globs or a single regex literal; a non-empty value enables cleanup) and VORTEX_DEPLOY_ARTIFACT_CLEANUP_AGE (default 7), and built the git-artifact invocation into an artifact_args array so --cleanup-stale, --cleanup-pattern, and --cleanup-age are only appended when a pattern is set.
  • .vortex/tooling/tests/unit/deploy-artifact.bats: updated the two hardcoded git-artifact download version strings to 1.7.0, added an isolated scenario asserting all three cleanup flags stay absent when the cleanup variables are unset, and added a new scenario asserting the flags are passed correctly for a comma-separated multi-pattern value.
  • .vortex/docs/content/tools/git-artifact.mdx: bumped the documented default version to 1.7.0 and added a "Stale branch cleanup" section documenting both variables, with glob (feature/*,bugfix/*) and regex pattern examples.

Screenshots

N/A - this change affects deploy-time Bash tooling, BATS tests, and docs, with no rendered UI.

Before / After

┌──────────────────────────────────────────────────────┐
│ BEFORE - git-artifact 1.4.0                          │
│                                                      │
│ Every deploy pushes to a same-named branch in the    │
│ destination repo. Branches for deleted or merged     │
│ source branches are never removed - they pile up     │
│ in the destination repo indefinitely.                │
└──────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────┐
│ AFTER - git-artifact 1.7.0                           │
│                                                      │
│ VORTEX_DEPLOY_ARTIFACT_CLEANUP_PATTERN opts in to    │
│ pruning: branches matching the pattern and older     │
│ than VORTEX_DEPLOY_ARTIFACT_CLEANUP_AGE days         │
│ (default 7) are deleted after each successful push.  │
│ The just-pushed branch and the remote default        │
│ branch are always protected. Empty pattern (the      │
│ default) keeps 1.4.0 behaviour unchanged.            │
└──────────────────────────────────────────────────────┘

Summary by CodeRabbit

  • New Features

    • Added optional stale-branch cleanup after successful artifact deployments.
    • Cleanup can be configured using branch patterns and an age threshold.
    • Recently pushed branches and the destination’s default branch are protected from deletion.
    • Cleanup failures do not invalidate an otherwise successful deployment.
  • Improvements

    • Updated the default git-artifact release to version 1.7.0.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The deployment script now uses git-artifact 1.7.0 and supports optional stale remote branch cleanup through new environment variables. Tests cover default flag omission and configured flag propagation, while documentation describes the settings and cleanup guarantees.

Changes

Git artifact stale branch cleanup

Layer / File(s) Summary
Cleanup configuration and invocation
.vortex/tooling/src/vortex-deploy-artifact
Updates the git-artifact version and checksum, adds cleanup configuration variables, and conditionally passes cleanup arguments.
Cleanup validation and documentation
.vortex/tooling/tests/unit/deploy-artifact.bats, .vortex/docs/content/tools/git-artifact.mdx
Updates version fixtures, verifies cleanup flags are omitted by default or included when configured, and documents stale branch cleanup.cription

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant vortex-deploy-artifact
  participant git-artifact
  participant RemoteGit
  vortex-deploy-artifact->>git-artifact: Invoke artifact push
  git-artifact->>RemoteGit: Push destination branch
  vortex-deploy-artifact->>git-artifact: Pass cleanup flags when pattern is configured
  git-artifact->>RemoteGit: Remove eligible stale branches
Loading

Poem

A rabbit hops where branches grow,
With tidy flags in neat array rows.
Push one branch, then prune the old,
Keep the defaults safe to hold.
“Version seven!” the rabbit sings,
As cleanup nibbles dangling strings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the version bump and new stale-branch cleanup option.
Linked Issues check ✅ Passed The PR implements the requested auto-cleanup capability for git-artifact and updates tests/docs accordingly.
Out of Scope Changes check ✅ Passed The changes stay focused on upgrading git-artifact and wiring in its stale-branch cleanup feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/2696-artifact-cleanup

Comment @coderabbitai help to get the list of available commands.

@AlexSkrypnyk AlexSkrypnyk added the A3 Board worker 3 label Jul 22, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.41.0 milestone Jul 22, 2026
@AlexSkrypnyk

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.55% (204/207)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.55% (204/207)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@github-actions

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6a6088b92715ec68e8d1fa1f--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Jul 22, 2026
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.35%. Comparing base (2792344) to head (d32f645).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2827      +/-   ##
==========================================
- Coverage   86.78%   86.35%   -0.44%     
==========================================
  Files          98       91       -7     
  Lines        4783     4624     -159     
  Branches       47        3      -44     
==========================================
- Hits         4151     3993     -158     
+ Misses        632      631       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk changed the title [#2696] Bumped git-artifact to 1.7.0 and enabled stale deployment branch cleanup. [#2696] Bumped git-artifact to 1.7.0 and add an option for stale deployment branch cleanup. Jul 23, 2026
@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.vortex/docs/content/tools/git-artifact.mdx:
- Around line 59-62: Update the user-facing sentence in the git-artifact
documentation to replace “a same-named branch” with idiomatic wording such as “a
branch with the same name,” while preserving the existing meaning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0254a158-ff43-42b9-8eab-019a7da9f97f

📥 Commits

Reviewing files that changed from the base of the PR and between 2792344 and d32f645.

📒 Files selected for processing (3)
  • .vortex/docs/content/tools/git-artifact.mdx
  • .vortex/tooling/src/vortex-deploy-artifact
  • .vortex/tooling/tests/unit/deploy-artifact.bats

Comment on lines +59 to +62
Each source branch is deployed to a same-named branch in the destination
repository, so over time the destination accumulates branches for source
branches that no longer exist. **Vortex** can prune these stale branches after
each successful push.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use idiomatic wording.

“a same-named branch” is ungrammatical in user-facing documentation.

Proposed fix
-Each source branch is deployed to a same-named branch in the destination
+Each source branch is deployed to a correspondingly named branch in the destination
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Each source branch is deployed to a same-named branch in the destination
repository, so over time the destination accumulates branches for source
branches that no longer exist. **Vortex** can prune these stale branches after
each successful push.
Each source branch is deployed to a correspondingly named branch in the destination
repository, so over time the destination accumulates branches for source
branches that no longer exist. **Vortex** can prune these stale branches after
each successful push.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vortex/docs/content/tools/git-artifact.mdx around lines 59 - 62, Update the
user-facing sentence in the git-artifact documentation to replace “a same-named
branch” with idiomatic wording such as “a branch with the same name,” while
preserving the existing meaning.

@AlexSkrypnyk
AlexSkrypnyk merged commit 0140556 into main Jul 23, 2026
34 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/2696-artifact-cleanup branch July 23, 2026 00:27
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3 Board worker 3 Needs review Pull request needs a review from assigned developers

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Enable branches auto-cleanup for git artifact

1 participant