Enhancement/5235 wrap errors when marking upgrade#9366
Conversation
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
cb86100 to
269f22c
Compare
df9dd27 to
3c97eb6
Compare
|
|
|
@blakerouse @michalpristas the pr is ready for review |
3a0efec to
689e85d
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
689e85d to
1d7ff97
Compare
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @kaanyalti |
…nt types and updated the upgrader struct. added tests case for mark upgrade error handling in the upgrade function
…nstall in upgrader, updated error handling tests to use these abstractions
1d7ff97 to
bbca4d9
Compare
|
blakerouse
left a comment
There was a problem hiding this comment.
Looks good.
Nice testing.
Thank you! |
|
@Mergifyio backport 8.18 8.19 9.0 9.1 |
✅ Backports have been createdDetails
|
* 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) # Conflicts: # internal/pkg/agent/application/upgrade/step_mark.go # internal/pkg/agent/application/upgrade/step_mark_test.go # internal/pkg/agent/application/upgrade/upgrade.go # internal/pkg/agent/application/upgrade/upgrade_test.go
* 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) # Conflicts: # internal/pkg/agent/application/upgrade/step_mark.go # internal/pkg/agent/application/upgrade/step_mark_test.go
* 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)
* 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)
* 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) Co-authored-by: Kaan Yalti <kaan.yalti@elastic.co>
* 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) Co-authored-by: Kaan Yalti <kaan.yalti@elastic.co>
…rade (#9966) * Enhancement/5235 wrap errors when marking upgrade (#9366) * 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) # Conflicts: # internal/pkg/agent/application/upgrade/step_mark.go # internal/pkg/agent/application/upgrade/step_mark_test.go * resolved conflicts * removed unnecessary tests * removed unused param --------- Co-authored-by: Kaan Yalti <kaan.yalti@elastic.co>
* upstream: (26 commits) fix: ensure EDOT subprocess shuts down gracefully on agent termination (#9886) [main][Automation] Update versions (#9976) Add Collector reference docs and automation (#9953) [beatreceivers] Integrate beatsauthextension (#9257) [main][Automation] Update versions (#9941) Update OTel components to v0.132.0/v1.38.0 (#9954) Enhancement/5235 wrap errors when marking upgrade (#9366) Mount Go build cache into crossbuild container (#9094) Liveness agent state (#9673) [main][Automation] Bump VM Image version to 1757725254 (#9942) Enhancement/5235 correctly wrap errors from copyActionDir and copyRunDirectory (#9349) [main][Automation] Update elastic/beats to afc53c0479ac (#9874) Add -coverpkg option when running unit test to calculate coverage across packages (#9913) Cache binaries downloaded for packaging locally (#9133) [main][Automation] Update versions (#9897) Disable flaky test TestBeatsReceiverLogs (#9891) Allow overriding AGENT_PACKAGE_VERSION and MANIFEST_URL when USE_PACKAGE_VERSION=true (#9864) add ingest-docs team as CODEOWNERS for release notes and docset.yml (#9865) fix: correct spelling of 'output' in various templates and monitoring code (#9827) k8s: Add comment around hostUsers for Universal Profiling deployments (#9847) ...
…rade (#9965) * Enhancement/5235 wrap errors when marking upgrade (#9366) * 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) # Conflicts: # internal/pkg/agent/application/upgrade/step_mark.go # internal/pkg/agent/application/upgrade/step_mark_test.go # internal/pkg/agent/application/upgrade/upgrade.go # internal/pkg/agent/application/upgrade/upgrade_test.go * resolve conflicts * removed unused tests * removed unused var --------- Co-authored-by: Kaan Yalti <kaan.yalti@elastic.co>
* 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




PR 4/6
What does this PR do?
Why is it important?
Errors are not propagated up the call chain in some instances, this prevents checking for error types.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testDisruptive User Impact
none
How to test this PR locally
Run the ugprade_test and step_unpack_test tests
Related issues