-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/migration tool #624
Merged
Merged
Feat/migration tool #624
Conversation
This file contains 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
This commit introduces a new migration script that helps in migrating colang (.co) files and config (.yaml/.yml) files from older versions to the latest version. The script supports migration from "1.0" and"2.0-alpha" versions to the latest version. The script also validates the migrated files to ensure they arecorrect.
The conversion functions convert_colang_2alpha_syntax and convert_colang_1_syntax have been refactored to accept a list of lines instead of a file path
Transforms the colang 1 syntax to colang 2 Add _rails.co file if the rails are defined in config.yml Validates the translation using Colang 2.x parser Fix indentation of globalize and avoid more than once migration
To make action names compatible with colang 2.x ActionName convention
It is already fixed in another PR
Allows use of name from action decorator after execute instead of function name
…or' default value to True and remove 'add_main'
This commit marks the test as skipped. This test is currently not working as expected and needs to be reviewed and fixed.
This commit refactors the variable names in the migration script for better readability. The variable 'stripped_line' has been renamed to 'line'. The changes also include the addition of new syntax conversions like 'bot ...' to 'match UtteranceBotActionFinished()' and 'user ...' to 'match UtteranceUserActionFinished()'.
the regex used to extract the action name after "await" or "execute" has been updated. Now it correctly identifies the action name as the part before the first parenthesis.
Add globalize
This commit changes the behavior of the migration script. Instead of removing the rails flows from the configuration file, it now comments them out. This allows for easier rollback and preserves the original file structure. The rails flows are written to a separate file named _rails.co for reference. This approach is used as yaml.dump in PyYAML distorts the formating and key ordering.
fix(utils): add re patterns
Pouyanpi
force-pushed
the
feat/migration-tool
branch
from
July 11, 2024 14:06
4f451c0
to
d97c6a8
Compare
This commit updates the syntax for regex and loop_id in the migration.py file. The regex syntax is updated to include parentheses around the regex pattern. The loop_id syntax is updated to include quotes around the loop_id. Update the corresponding tests add tests
This commit introduces several enhancements to the migration script. 1. It adds a new function '_set_colang_version' which sets the 'colang_version' in the given raw_config. If 'colang_version' already exists, it replaces it. If it doesn't exist, it inserts it at the first line. 2. It modifies the '_process_config_files' function to call the new '_set_colang_version' function, setting the colang version to 2.x. 3. It changes the '_comment_rails_flows_in_config' function to comment out the 'rails:' line if 'rails' is empty in the raw_config. 4. It modifies the '_process_co_files' function to call '_add_main_co_file'. 5. It changes the '_add_main_co_file' function to append 'llm' to the libraries and add the main flow. 6. It changes the '_rails_co_file_path' from '_rails.co' to 'rails.co'.
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.
This PR facilitates the migration from both Colang 1.0 and Colang 2.0-alpha to Colang 2.x. It introduces a migration script with the following key features and fixes: