Skip to content

fix: don't run a action operation after creation - #10374

Merged
olblak merged 3 commits into
updatecli:mainfrom
olblak:fix/don
Sep 10, 2026
Merged

olblak merged 3 commits into
updatecli:mainfrom
olblak:fix/don

Conversation

@olblak

@olblak olblak commented Sep 9, 2026

Copy link
Copy Markdown
Member

Don't clean an open action just after creating it

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.
  • I have tested this pull request manually with a custom Updatecli build and it works as expected.

Tradeoff

Potential improvement

Summary by CodeRabbit

  • Bug Fixes
    • Prevented SCM pushes and working-branch cleanup for targets that fail or produce inconclusive results.
    • Preserved branches and repositories linked to unsuccessful targets, preventing unintended changes.
    • Prevented actions published during the current execution from being cleaned up immediately afterward.
    • Improved cleanup behavior in dry-run mode and when action handlers are unavailable.

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added actions core All things related to Updatecli core engine labels Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 57fcbe0d-d5e2-432b-a0fd-128ed260d3a5

📥 Commits

Reviewing files that changed from the base of the PR and between e9b00cd and bd36519.

📒 Files selected for processing (5)
  • pkg/core/engine/scm.go
  • pkg/core/engine/scm_test.go
  • pkg/core/pipeline/action/main.go
  • pkg/core/pipeline/actions.go
  • pkg/core/pipeline/actions_test.go

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

SCM publishing and working-branch cleanup now skip targets without conclusive results. Pipeline actions record current-run publication state, and cleanup excludes those actions and dry-run executions.

Changes

Publish and cleanup safeguards

Layer / File(s) Summary
SCM result gating
pkg/core/engine/scm.go, pkg/core/engine/scm_test.go
The engine identifies SCM branches linked to missing or non-conclusive target results. Publishing and working-branch cleanup skip those branches. Tests verify push and cleanup invocation counts.
Action publication state
pkg/core/pipeline/action/main.go, pkg/core/pipeline/actions.go, pkg/core/pipeline/actions_test.go
Action.Published records current-run publication. Cleanup skips published actions, nil handlers, and dry-run executions. Tests cover previous-run actions, current-run actions, and dry-run mode.

Priority: ⬇️ Low

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

Sequence Diagram(s)

sequenceDiagram
  participant Pipeline
  participant Action
  participant ActionHandler
  Pipeline->>Action: create or update action
  Pipeline->>Action: set Published=true
  Pipeline->>ActionHandler: clean unpublished action
  Pipeline-->>ActionHandler: skip published action or dry-run cleanup
Loading

Merge Risk: ⚪ Minimal · up to 01440

This change prevents actions created in the current run from being cleaned up and avoids SCM side effects for inconclusive targets. The guarded behaviors are covered by focused tests, with no remaining merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: preventing an action operation from running immediately after action creation. The wording contains a minor grammatical error but remains understandable an…
Description check ✅ Passed The description explains the fix, includes the required test section and command, and retains the template headings. It does not provide an issue reference or details for the tradeoff and potential im…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@olblak
olblak enabled auto-merge (squash) September 10, 2026 10:36
@olblak
olblak merged commit da1c3a3 into updatecli:main Sep 10, 2026
9 of 11 checks passed
@olblak olblak added the bug Something isn't working label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions bug Something isn't working core All things related to Updatecli core engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant