diff --git a/merge_features.sh b/merge_features.sh new file mode 100644 index 00000000..467c3404 --- /dev/null +++ b/merge_features.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Exit on any error +set -e +set -x # Enable debugging output + +# Set environment variables +export GITHUB_TOKEN=your_github_token +export GITHUB_REPO=github.com/diegoabeltran16/Medical-Interpreter-Bot.git + +# Configure Git credential helper to store credentials temporarily +git config --global credential.helper cache + +# Print environment variables for debugging +echo "GITHUB_REPO: ${GITHUB_REPO}" + +# Verify that environment variables are set +if [ -z "$GITHUB_REPO" ]; then + echo "Error: GITHUB_REPO is not set" + exit 1 +fi + +# Configure Git +git config --global user.email "diegobeltran1016@gmail.com" +git config --global user.name "Diego Alejandro Beltran" + +# Remove remotes if they exist (to ensure clean state) +git remote remove github || true + +# Add GitHub as a remote +git remote add github "https://${GITHUB_TOKEN}@${GITHUB_REPO}" +echo "GitHub remote added." + +# Fetch all branches from GitHub +echo "Fetching branches from GitHub..." +git fetch github || echo "Failed to fetch from GitHub. Check the repository URL and token permissions." + +# Checkout main branch +git checkout main + +# Merge feature branches into main +for branch in $(git branch -r | grep 'github/feature/' | sed 's/github\///'); do + echo "Merging ${branch} into main..." + git merge "$branch" --no-ff -m "Merge ${branch} into main" +done + +# Push the updated main branch to GitHub +echo "Pushing changes to GitHub..." +if git push github main; then + echo "Pushed changes to GitHub successfully." +else + echo "Failed to push changes to GitHub." +fi + +echo "Feature branches merged and pushed to GitHub successfully." diff --git a/project-details.md b/project-details.md index dd40127e..847996ad 100644 --- a/project-details.md +++ b/project-details.md @@ -470,6 +470,11 @@ def get_term(term): Develop the Medical Interpreter Bot project using a transformative approach inspired by the Yin-Yang concept, structuring the development in cycles of pre-co-requisite programming blocks, moving from the simplest to the most complex. Here’s a structured development plan divided into Alpha and Beta prototypes, each building upon the previous cycle. Structuring the development in cycles and using Git branches, you can ensure that each phase is developed and tested independently before being merged into the main branch. This approach minimizes redundancy, ensures continuous integration, and facilitates incremental improvements. Each cycle builds upon the previous one, resulting in a robust, scalable, and user-friendly Medical Interpreter Bot. +**Why Use Branches?** +- Isolation: Branches allow you to work on features or fixes in isolation from the main codebase. +- Collaboration: Multiple developers can work on different features simultaneously without interfering with each other. +- Experimentation: You can create experimental branches to try out new ideas without affecting the stable code. + **Cycle 1: Foundation and Basic Features | Alpha Prototype 1.1: Initial Setup and Basic Input** **Tasks** @@ -522,6 +527,8 @@ Structuring the development in cycles and using Git branches, you can ensure tha - User Input Analysis: The bot can analyze user inputs to identify new terms and update the database. - Basic Testing and Feedback: Initial unit tests for core functionalities and user feedback gathered to improve input handling. + + - **Cycle 2: Advanced Features and NLU Integration | Alpha Prototype 2.1: Advanced NLU and User Input Analysis** **Tasks** @@ -749,8 +756,9 @@ MEDICAL-INTERPRETER-BOT/ - sync_repos.sh: Use for full repository syncs. - sync_branch.sh: Use for syncing individual branches. -- sync_feature.sh: (Optional) Use for syncing all feature branches. -- sync_hotfix.sh: (Optional) Use for syncing all hotfix branches. +- sync_feature.sh: Use for syncing all feature branches. +- sync_hotfix.sh: Use for syncing all hotfix branches. +- merge_features.sh: Use for merging features in main The provided scripts incorporate good practices, including error handling, debugging output, and clear messaging. @@ -802,6 +810,9 @@ sync_hotfix.sh ``` +./merge_features.sh + + **Advantages of Using Separate Scripts** - Modularity: Each script handles a specific task, making the code easier to understand and maintain. - Reusability: You can reuse the sync_branch.sh script independently if you need to sync a specific branch manually. diff --git a/requirements.txt b/requirements.txt index 5deb3211..6752472a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ schedule spacy transformers python-dotenv -openai \ No newline at end of file +openai +flake8 \ No newline at end of file