Skip to content

Commit 1d059cf

Browse files
author
gitopia1c2zfrmhra3spfrc2m5ft64hef30guf60lvtcm3
committed
Merge pull request #24 from git-remote-gitopia/release-v1.10.0
2 parents a388811 + 4c465d4 commit 1d059cf

File tree

9 files changed

+32
-21
lines changed

9 files changed

+32
-21
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes will be documented here.
44

5+
## [v1.10.0] - 2024-12-02
6+
7+
- upgrade gitopia version to v5.1.0
8+
- upgrade gitopia-go version to v0.6.2
9+
- update the push permissions logic for dao repositories
10+
511
## [v1.9.1] - 2024-08-31
612

713
- fix offchain proto warning

cmd/git-gitopia/lfs/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/gitopia/git-remote-gitopia/config"
1515
"github.com/gitopia/git-remote-gitopia/core"
1616
"github.com/gitopia/git-remote-gitopia/core/api"
17-
gitopiatypes "github.com/gitopia/gitopia/v4/x/gitopia/types"
17+
gitopiatypes "github.com/gitopia/gitopia/v5/x/gitopia/types"
1818
"github.com/pkg/errors"
1919
"github.com/spf13/cobra"
2020
"google.golang.org/grpc"

cmd/git-remote-gitopia/gitopia.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
core "github.com/gitopia/git-remote-gitopia/core"
2121
"github.com/gitopia/git-remote-gitopia/core/api"
2222
"github.com/gitopia/git-remote-gitopia/core/wallet"
23-
gitopiatypes "github.com/gitopia/gitopia/v4/x/gitopia/types"
24-
"github.com/gitopia/gitopia/v4/x/gitopia/utils"
23+
gitopiatypes "github.com/gitopia/gitopia/v5/x/gitopia/types"
24+
"github.com/gitopia/gitopia/v5/x/gitopia/utils"
2525
"github.com/go-git/go-git/v5/plumbing"
2626
"github.com/pkg/errors"
2727
"google.golang.org/grpc"
@@ -360,15 +360,18 @@ func (h *GitopiaHandler) havePushPermission(walletAddress string) (havePermissio
360360
havePermission = true
361361
}
362362
} else if h.remoteRepository.Owner.Type == gitopiatypes.OwnerType_DAO {
363-
member, err := h.queryClient.DaoMember(context.Background(), &gitopiatypes.QueryGetDaoMemberRequest{
364-
DaoId: h.remoteRepository.Owner.Id,
365-
UserId: h.wallet.Address(),
363+
resp, err := h.queryClient.DaoMemberAll(context.Background(), &gitopiatypes.QueryAllDaoMemberRequest{
364+
DaoId: h.remoteRepository.Owner.Id,
366365
})
367366
if err != nil {
368367
return havePermission, err
369368
}
370-
if member.Member.Role == gitopiatypes.MemberRole_OWNER {
371-
havePermission = true
369+
370+
for _, member := range resp.Members {
371+
if member.Member.Address == walletAddress {
372+
havePermission = true
373+
break
374+
}
372375
}
373376
}
374377

core/wallet/gitopia_wallet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2525
"github.com/cosmos/cosmos-sdk/x/feegrant"
2626
"github.com/gitopia/git-remote-gitopia/config"
27-
gitopia "github.com/gitopia/gitopia/v4/app"
28-
offchaintypes "github.com/gitopia/gitopia/v4/x/offchain/types"
27+
gitopia "github.com/gitopia/gitopia/v5/app"
28+
offchaintypes "github.com/gitopia/gitopia/v5/x/offchain/types"
2929
"github.com/pkg/errors"
3030
"google.golang.org/grpc"
3131
)

core/wallet/ledger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2525
"github.com/cosmos/cosmos-sdk/x/feegrant"
2626
"github.com/gitopia/git-remote-gitopia/config"
27-
gitopia "github.com/gitopia/gitopia/v4/app"
28-
offchaintypes "github.com/gitopia/gitopia/v4/x/offchain/types"
27+
gitopia "github.com/gitopia/gitopia/v5/app"
28+
offchaintypes "github.com/gitopia/gitopia/v5/x/offchain/types"
2929
"github.com/pkg/errors"
3030
"google.golang.org/grpc"
3131
)

core/wallet/os_keyring.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"github.com/gitopia/git-remote-gitopia/config"
1919
glib "github.com/gitopia/gitopia-go"
2020
"github.com/gitopia/gitopia-go/logger"
21-
gitopia "github.com/gitopia/gitopia/v4/app"
22-
offchaintypes "github.com/gitopia/gitopia/v4/x/offchain/types"
21+
gitopia "github.com/gitopia/gitopia/v5/app"
22+
offchaintypes "github.com/gitopia/gitopia/v5/x/offchain/types"
2323
goGitConfig "github.com/go-git/go-git/v5/config"
2424
"github.com/pkg/errors"
2525
"github.com/sirupsen/logrus"

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ go 1.21
55
require (
66
github.com/cometbft/cometbft v0.37.6
77
github.com/cosmos/cosmos-sdk v0.47.13
8-
github.com/gitopia/gitopia-go v0.6.1
9-
github.com/gitopia/gitopia/v4 v4.0.1
8+
github.com/gitopia/gitopia-go v0.6.2
9+
github.com/gitopia/gitopia/v5 v5.1.0
1010
github.com/go-git/go-git/v5 v5.11.0
1111
github.com/pkg/errors v0.9.1
1212
github.com/sirupsen/logrus v1.9.3
@@ -218,3 +218,5 @@ require (
218218

219219
// https://github.com/cosmos/cosmos-sdk/issues/20159
220220
replace golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb
221+
222+
replace github.com/gitopia/gitopia/v4 => ../gitopia

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm
448448
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
449449
github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
450450
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
451-
github.com/gitopia/gitopia-go v0.6.1 h1:AINALBdUcn1VYzw+so7nrKgIW5+0juhIP2hG5sHfwLY=
452-
github.com/gitopia/gitopia-go v0.6.1/go.mod h1:1gNKxYitlxt5gVknvgzqHO/3cCkNI0VlCQKfF8vYEUs=
453-
github.com/gitopia/gitopia/v4 v4.0.1 h1:PPLYC6X9+dMYVaa/hTJaQyv/X0Tz3DqL1/cwTujm5TI=
454-
github.com/gitopia/gitopia/v4 v4.0.1/go.mod h1:Z0PIKA/0xwsR3VDoLTILrMnhzqsXKaHfMyGT2ajjqPE=
451+
github.com/gitopia/gitopia-go v0.6.2 h1:3Xu090ObJ8TP5FqmRj/blRSX0721ootXojwuOJLHb6Y=
452+
github.com/gitopia/gitopia-go v0.6.2/go.mod h1:UueURx6CKcAl95Y+ldqX1k41TlfjM8fRuBCUNanW6TY=
453+
github.com/gitopia/gitopia/v5 v5.1.0 h1:a/RySnjfpRYJwbkqW76QFmkBW/FihLDJHEpCtbF85Zg=
454+
github.com/gitopia/gitopia/v5 v5.1.0/go.mod h1:t1FjB6j0LlGB2Ka1+Hu+XiARQ4NHhoVx9uKiR8+yhwc=
455455
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
456456
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
457457
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export GITOPIA_WALLET=/path/to/wallet.json
5555
```
5656
git config --global gitopia.chainId "gitopia"
5757
git config --global gitopia.grpcHost "localhost:9090"
58-
git config --global gitopia.gitServerhHst "http://localhost:5001"
58+
git config --global gitopia.gitServerHost "http://localhost:5001"
5959
git config --global gitopia.tmAddr "http://localhost:26657"
6060
git config --global gitopia.gasPrices "0.001ulore"
6161
git config --global gitopia.feeGranter ""

0 commit comments

Comments
 (0)