Skip to content

Commit

Permalink
Automated commit by sync script
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoabeltran16 committed Jul 26, 2024
1 parent 3436f53 commit d265955
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
55 changes: 55 additions & 0 deletions merge_features.sh
Original file line number Diff line number Diff line change
@@ -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."
15 changes: 13 additions & 2 deletions project-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down Expand Up @@ -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**
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ schedule
spacy
transformers
python-dotenv
openai
openai
flake8

0 comments on commit d265955

Please sign in to comment.