Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 15, 2025

PR 4/6

  • Enhancement

What does this PR do?

  • Modifies the mark upgrade step to wrap errors so that the errors are propagated correctly.
  • Adds relevant tests, asserts that errors get propagated up the call chain.

Why is it important?

Errors are not propagated up the call chain in some instances, this prevents checking for error types.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Disruptive User Impact

none

How to test this PR locally

Run the ugprade_test and step_unpack_test tests

Related issues


This is an automatic backport of pull request #9366 done by [Mergify](https://mergify.com).

* enhancement(5235): added markUpgradeFunc to abstract markUpgrade

* enhancement(5235): using markUpgradeFunc in Upgrade function

* enhancement(5235): wrapping writeFile errors in markUpgrade

enhancement(5235): added goerrors in step_mark

* enhancement(5235): using writeFile wrapper in markUpgrade

* enhancement(5235): added tests mark upgrade tests

enhancement(5235): updated step mark test to mock writeFile

* enhancement(5235): updated markUpgrade function so that it can be tested, jecting dependencies. updated relevant tests

* enhancement(5235): updated use of markUpgrade in rollback and rollback tests

* enhancement(5235): abstracted markupgrade from upgrader, added relevant types and updated the upgrader struct. added tests case for mark upgrade error handling in the upgrade function

* enhancement(5235): added abstractions for changesymlink and rollbackInstall in upgrader, updated error handling tests to use these abstractions

* enhancement(5235): added error handling test for changesymlink

(cherry picked from commit 2e4e777)
@mergify mergify bot requested a review from a team as a code owner September 15, 2025 15:30
@mergify mergify bot removed the request for review from a team September 15, 2025 15:30
@mergify mergify bot added the backport label Sep 15, 2025
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Sep 15, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elastic-sonarqube
Copy link

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @kaanyalti

@kaanyalti kaanyalti merged commit b57e0bd into 9.0 Sep 15, 2025
21 checks passed
@kaanyalti kaanyalti deleted the mergify/bp/9.0/pr-9366 branch September 15, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants