feat(ctf): refactor OpenCTFByFileExtension for usage of discovery outside of opening CTFs#964
Merged
jakobmoellerdev merged 1 commit intoSep 30, 2025
Conversation
… and error handling ### What this does / why we need it: - Refactored `OpenCTFByFileExtension` to separate format discovery (`DiscoverCTFFormatFromPath`) from CTF opening logic, enhancing code readability and maintainability. - Introduced better error handling when the CTF cannot be opened, returning a more descriptive error message. - Simplified extension handling, ensuring edge cases like `.tar.gz` are correctly handled. ### Implications: - Removes redundant code duplication by isolating format discovery into its own function. - Users now benefit from clearer error messages when opening a CTF fails. Signed-off-by: Fabian Burth <fabian.burth@sap.com>
jakobmoellerdev
approved these changes
Sep 30, 2025
OpenCTFByFileExtension for improved readability and error handlingOpenCTFByFileExtension for usage of discovery outside of opening CTFs
matthiasbruns
pushed a commit
that referenced
this pull request
Oct 7, 2025
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it This PR fixes is supposed to fix the race conditions occuring when multiple ctf instances operate on the same ctf archive. The actual fix is provided in #964 and #963. Here, a the archive instance and its lock are shared between multiple ctf repositories operating on the archive. #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Contributes to open-component-model/ocm-project#564 --------- Signed-off-by: Fabian Burth <fabian.burth@sap.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does / why we need it:
OpenCTFByFileExtensionto separate format discovery (DiscoverCTFFormatFromPath) from CTF opening logic, enhancing code readability and maintainability.Which issue(s) this PR fixes
Contributes to open-component-model/ocm-project#564