Compare commits

..

11 Commits

Author SHA1 Message Date
8e3c56f4ed update ci (#277)
All checks were successful
sync / sync (push) Successful in 10s
2025-05-05 19:19:33 +03:00
fcbae6f94a added commit hash check to avoid unnecessary repository cloning (#275)
All checks were successful
sync / sync (push) Successful in 10s
2025-05-05 13:44:43 +03:00
2f818d389b Merge branch 'v4' of https://git.unistack.org/unistack-org/micro-server-grpc into v4
All checks were successful
sync / sync (push) Successful in 14s
2025-05-04 15:02:46 +03:00
d55cb59531 fixup sync
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2025-05-04 15:02:02 +03:00
8c416b10ef Обновить .github/workflows/job_sync.yml
Some checks failed
sync / sync (push) Has been cancelled
2025-05-02 18:55:11 +03:00
d3c2ae5f54 convert headers to HTTP/2 format before SendHeader() (#273)
All checks were successful
coverage / build (push) Has been skipped
test / test (push) Successful in 2m19s
2025-05-02 18:51:30 +03:00
3bb8ec0753 Обновить .github/workflows/job_sync.yml
All checks were successful
sync / sync (push) Has been skipped
2025-05-01 22:07:43 +03:00
27bca35eb6 Обновить .github/workflows/job_sync.yml
All checks were successful
sync / sync (push) Has been skipped
2025-05-01 22:01:33 +03:00
498218912c Обновить .github/workflows/job_sync.yml
All checks were successful
sync / sync (push) Successful in 23s
2025-05-01 21:59:18 +03:00
bd04f5b9cb Обновить .github/workflows/job_sync.yml 2025-05-01 21:58:56 +03:00
dc976006ad Обновить .github/workflows/job_sync.yml
All checks were successful
sync / sync (push) Has been skipped
2025-05-01 21:05:02 +03:00
3 changed files with 48 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ on:
jobs:
build:
if: github.server_url == 'zhttps://github.com'
if: github.server_url != 'https://github.com'
runs-on: ubuntu-latest
steps:
- name: checkout code

View File

@@ -18,34 +18,76 @@ jobs:
echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" >> /root/.netrc
echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" >> /root/.netrc
- name: check master
id: check_master
run: |
src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/master | cut -f1)
dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/master | cut -f1)
echo "src_hash=$src_hash"
echo "dst_hash=$dst_hash"
if [ "$src_hash" != "$dst_hash" ]; then
echo "sync_needed=true" >> $GITHUB_OUTPUT
else
echo "sync_needed=false" >> $GITHUB_OUTPUT
fi
- name: sync master
if: steps.check_master.outputs.sync_needed == 'true'
run: |
git clone --filter=blob:none --filter=tree:0 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo
cd repo
git remote add --no-tags --fetch --track master upstream https://github.com/${GITHUB_REPOSITORY}
git merge upstream/master
git pull --rebase upstream master
git push upstream master --progress
git push origin master --progress
cd ../
rm -rf repo
- name: check v3
id: check_v3
run: |
src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/v3 | cut -f1)
dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/v3 | cut -f1)
echo "src_hash=$src_hash"
echo "dst_hash=$dst_hash"
if [ "$src_hash" != "$dst_hash" ]; then
echo "sync_needed=true" >> $GITHUB_OUTPUT
else
echo "sync_needed=false" >> $GITHUB_OUTPUT
fi
- name: sync v3
if: steps.check_v3.outputs.sync_needed == 'true'
run: |
git clone --filter=blob:none --filter=tree:0 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo
cd repo
git remote add --no-tags --fetch --track v3 upstream https://github.com/${GITHUB_REPOSITORY}
git merge upstream/v3
git pull --rebase upstream v3
git push upstream v3 --progress
git push origin v3 --progress
cd ../
rm -rf repo
- name: check v4
id: check_v4
run: |
src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/v4 | cut -f1)
dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/v4 | cut -f1)
echo "src_hash=$src_hash"
echo "dst_hash=$dst_hash"
if [ "$src_hash" != "$dst_hash" ]; then
echo "sync_needed=true" >> $GITHUB_OUTPUT
else
echo "sync_needed=false" >> $GITHUB_OUTPUT
fi
- name: sync v4
if: steps.check_v4.outputs.sync_needed == 'true'
run: |
git clone --filter=blob:none --filter=tree:0 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo
cd repo
git remote add --no-tags --fetch --track v4 upstream https://github.com/${GITHUB_REPOSITORY}
git merge upstream/v4
git pull --rebase upstream v4
git push upstream v4 --progress
git push origin v4 --progress
cd ../

View File

@@ -399,7 +399,7 @@ func (g *Server) processRequest(ctx context.Context, stream grpc.ServerStream, s
// execute the handler
appErr := fn(ctx, r, replyv.Interface())
if md := getResponseMetadata(ctx); len(md) > 0 {
if err = stream.SendHeader(gmetadata.MD(md)); err != nil {
if err = stream.SendHeader(md.AsHTTP2()); err != nil {
return err
}
}
@@ -483,7 +483,7 @@ func (g *Server) processStream(ctx context.Context, stream grpc.ServerStream, se
appErr := fn(ctx, r, ss)
if md := getResponseMetadata(ctx); len(md) > 0 {
if err := stream.SendHeader(gmetadata.MD(md)); err != nil {
if err := stream.SendHeader(md.AsHTTP2()); err != nil {
return err
}
}