claudie icon indicating copy to clipboard operation
claudie copied to clipboard

Added logic to proceed in pipeline when trying to re-run jobs without commit

Open m-brando opened this issue 2 months ago • 1 comments

Added logic to allow the pipeline to proceed when re-running jobs without requiring a new commit.

This improves testing speed. If the pipeline failed for a reason unrelated to the code (before the edit-kustomization job) - you had to push an empty commit to restart pipeline. That would re-run the entire pipeline from the beginning, even if most jobs had already passed. Example: https://github.com/berops/claudie/actions/runs/18340633694/attempts/2

If you do not commit new message and re-run pipeline manualy pipeline will fail. Here is example of this: https://github.com/berops/claudie/actions/runs/18340633694/job/52285267386#step:8:20

Adding the if statement in the step Commit new kustomization.yaml to feature branch can save over 30 minutes during testing.

Summary by CodeRabbit

  • Chores
    • Refined CI pipeline to create commits only when actual changes are detected, preventing empty commits.
    • Improves pipeline stability, reduces redundant operations, and keeps repository history cleaner.
    • Streamlines automation logs and minimizes noise in version control and build output.
    • No impact on user-facing features or behavior.

m-brando avatar Oct 09 '25 10:10 m-brando

Walkthrough

CI workflow updated to conditionally commit and push changes to kustomization.yaml only when staged modifications exist, replacing unconditional git commit/push with a guarded check and informational message when no changes are present.

Changes

Cohort / File(s) Summary of Changes
CI guard for empty commits
.github/workflows/CI-pipeline.yml
Replaced unconditional git commit/git push with a conditional block that checks for staged changes; commits and pushes only when changes are detected, otherwise logs a no-op message.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GH as GitHub Actions (CI)
    participant Git as Git

    Dev->>GH: Push changes
    GH->>GH: Build and update kustomization.yaml
    GH->>Git: git add kustomization.yaml
    alt Changes staged
        GH->>Git: git commit -m "Auto-update kustomization.yaml"
        GH->>Git: git push
        note right of GH: Commit and push proceed
    else No staged changes
        GH->>GH: Echo "No changes to commit"
        note right of GH: Skip commit/push
    end

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped through pipelines, swift and sly,
No empty commits will clutter the sky.
If changes bloom, I push with cheer—
If not, I nibble, “All clear here.”
Carrot-shaped logs, tidy and bright—
CI’s garden pruned just right. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly describes the main change of the pull request, namely adding logic to allow the CI pipeline to proceed on re-runs without requiring a commit, and is fully related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch chore/ci-edit-kustomization

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73a7445a817d43969af02c11c24e0d6b9ffde3d9 and e6333095dcfc3fd8713b6bbd3d2f868abc61642a.

📒 Files selected for processing (1)
  • .github/workflows/CI-pipeline.yml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

coderabbitai[bot] avatar Oct 09 '25 10:10 coderabbitai[bot]