Ensure Module Order Matches the Sequence Constructed by BuildModules() #127
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.
Description
This PR modifies the
GetModules
function to ensure that the execution order of modules aligns with the sequence constructed by the developer usingBuildModules()
, rather than relying on the order in theconfig.yml
file. In certain cases, the execution order of specific modules is critical. For example, in theCallisto
project, themessage_type
module must execute before themessages
module to prevent database insertion failures due to the foreign key relationship that messages has with message_type.If the order is not ensured correctly, errors such as the following may occur:
Changes Made
Updated the GetModules function to check and return modules in the specified order based on the provided names.
Added validation to log errors for any required but unregistered modules.
Please review these changes to ensure they meet the project's requirements and best practices.
Checklist
Files changed
in the Github PR explorer.