Resolve merge conflict for tag 0.306.2.0#33
Merged
Merged
Conversation
This reverts commit b94391e.
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/80e58b5e-9e81-4a1b-b5f5-3d95f4af708d Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
This reverts commit 7678e23. Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
This reverts commit 33f0d31. Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Comment on lines
+11
to
+61
| if: github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Fetch all branches and tags | ||
| token: ${{ secrets.EVCC_PAT }} | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
|
|
||
| - name: Get merged branch name | ||
| id: get-branch | ||
| run: echo "BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Validate branch name | ||
| id: validate-branch | ||
| run: | | ||
| # Extract the tag name from the branch name | ||
| TAG_NAME=$(echo "${{ env.BRANCH }}" | sed 's/tag-//') | ||
|
|
||
| # Check if the tag name matches the expected pattern | ||
| if [[ ! "$TAG_NAME" =~ ^0\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "Branch name does not match the expected pattern. Skipping tag creation." | ||
| exit 1 | ||
| else | ||
| echo "Valid branch name: $TAG_NAME Saving for next step" | ||
| echo "BRANCH=$TAG_NAME" >> $GITHUB_OUTPUT | ||
| fi | ||
| continue-on-error: true | ||
|
|
||
| - name: Tag the merged branch | ||
| if: success() && steps.validate-branch.outcome == 'success' | ||
| run: | | ||
| # Checkout the branch that was merged | ||
| git checkout "${{ env.BRANCH }}" | ||
|
|
||
| # Create the new tag | ||
| NEW_TAG="${{ steps.validate-branch.outputs.BRANCH }}.0" | ||
|
|
||
| # Tag the branch | ||
| git tag "${NEW_TAG}" | ||
|
|
||
| # Push the tag to the repository | ||
| git push origin "${NEW_TAG}" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Comment on lines
+11
to
+98
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Fetch all branches and tags | ||
| token: ${{ secrets.EVCC_PAT }} | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
|
|
||
| - name: Add public repo as remote | ||
| run: | | ||
| git remote add public https://github.com/evcc-io/evcc.git | ||
|
|
||
| - name: Fetch tags from the public repo | ||
| run: | | ||
| git fetch public --tags | ||
|
|
||
| - name: Get all tags from the public repo | ||
| id: get-public-tags | ||
| run: | | ||
| git tag -l | grep -E '^0\.[0-9]+\.[0-9]+$' > public_tags.txt | ||
| echo "Public tags:" | ||
| cat public_tags.txt | ||
|
|
||
| - name: Get existing tags in the repo | ||
| id: get-existing-tags | ||
| run: | | ||
| git tag -l | grep -E '^0\.[0-9]+\.[0-9]+\.0$' > existing_tags.txt | ||
| echo "Existing tags:" | ||
| cat existing_tags.txt | ||
|
|
||
| - name: Sync missing tags | ||
| run: | | ||
| # Define the starting tag | ||
| START_TAG="0.130.7" | ||
|
|
||
| # Convert version to numeric format for comparison | ||
| tag_to_numeric() { | ||
| echo "$1" | sed 's/\./_/g' | awk -F'_' '{ printf("%d%03d%03d", $1, $2, $3) }' | ||
| } | ||
|
|
||
| START_NUMERIC=$(tag_to_numeric $START_TAG) | ||
|
|
||
| # Read tags from files | ||
| PUBLIC_TAGS=$(cat public_tags.txt) | ||
| EXISTING_TAGS=$(cat existing_tags.txt) | ||
|
|
||
| for TAG in $PUBLIC_TAGS; do | ||
| # Convert the current tag to numeric format | ||
| TAG_NUMERIC=$(tag_to_numeric $TAG) | ||
|
|
||
| # Check if the tag is greater than the starting tag | ||
| if [ "$TAG_NUMERIC" -gt "$START_NUMERIC" ]; then | ||
| # Generate the new tag name with .0 suffix | ||
| NEW_TAG="${TAG}.0" | ||
|
|
||
| # Check if the tag already exists | ||
| if ! echo "$EXISTING_TAGS" | grep -q "^${NEW_TAG}$"; then | ||
| echo "Processing new tag: $NEW_TAG" | ||
|
|
||
| # Create a new branch for the tag | ||
| git checkout -b "tag-${TAG}" ${TAG} | ||
|
|
||
| # Attempt to merge the master branch into the new branch | ||
| git merge master --no-edit || { | ||
| # If there's a merge conflict, create a pull request | ||
| echo "Merge conflict detected for tag ${TAG}. Creating pull request." | ||
| git push origin "tag-${TAG}" | ||
| gh pr create --title "Resolve merge conflict for tag ${NEW_TAG}" --body "A merge conflict was detected while syncing tag ${NEW_TAG}. Please resolve the conflict in this PR." --head master --base "tag-${TAG}" | ||
| continue | ||
| } | ||
| # Tag the branch with .0 appended to the original tag name | ||
| git tag "${NEW_TAG}" | ||
|
|
||
| # Push the new branch and tag to your repository | ||
| git push origin "tag-${TAG}" | ||
| git push origin "${NEW_TAG}" | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Comment on lines
+11
to
+44
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| # Fetch all branches | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.EVCC_PAT }} | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
|
|
||
| - name: Add public repo as remote | ||
| run: | | ||
| git remote add public https://github.com/evcc-io/evcc.git | ||
|
|
||
| - name: Fetch master branch from public repo | ||
| run: | | ||
| git fetch public master | ||
|
|
||
| - name: Checkout evcc-master branch | ||
| run: | | ||
| git checkout evcc-master | ||
|
|
||
| - name: Merge master branch from public repo into evcc-master | ||
| run: | | ||
| git merge public/master --no-edit | ||
|
|
||
| - name: Push changes to evcc-master | ||
| run: | | ||
| git push origin evcc-master |
Keeps only the applyBatteryGridChargeLimit function restoration, not the other optimizer changes. Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/2a6e3659-01e7-4040-a943-26f63dee4e0c Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/52296335-9cce-4494-9502-8ab3fba7ee50 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/4f043d84-a6e0-4411-bea3-19ffaceeb773 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
…-forecast-battery Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
…slot-time Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Increase plan minimum slot duration from 3min to 4min
…tery Restore applyBatteryGridChargeLimit in optimizer
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.
A merge conflict was detected while syncing tag 0.306.2.0. Please resolve the conflict in this PR.