Skip to content

Commit

Permalink
Do not store inactive repos (#1658)
Browse files Browse the repository at this point in the history
Do not sync repos with forge if the repo is not necessary in DB.

In the DB, only repos that were active once or repos that are currently
active are stored. When trying to enable new repos, the repos list is
fetched from the forge instead and displayed directly. In addition to
this, the forge func `Perm` was removed and is now merged with `Repo`.

Solves a TODO on RepoBatch.

---------

Co-authored-by: Anbraten <anton@ju60.de>
  • Loading branch information
qwerty287 and anbraten authored Mar 21, 2023
1 parent a95a5b4 commit 0970f35
Show file tree
Hide file tree
Showing 49 changed files with 329 additions and 730 deletions.
10 changes: 0 additions & 10 deletions cmd/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,6 @@ var flags = []cli.Flag{
Hidden: true,
},
//
// misc
//
&cli.BoolFlag{
EnvVars: []string{"WOODPECKER_FLAT_PERMISSIONS"},
Name: "flat-permissions",
Usage: "no forge call for permissions should be made",
Hidden: true,
// TODO(485) temporary workaround to not hit api rate limits
},
//
// secrets encryption in DB
//
&cli.StringFlag{
Expand Down
3 changes: 0 additions & 3 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,4 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) {

// prometheus
server.Config.Prometheus.AuthToken = c.String("prometheus-auth-token")

// TODO(485) temporary workaround to not hit api rate limits
server.Config.FlatPermissions = c.Bool("flat-permissions")
}
83 changes: 58 additions & 25 deletions pipeline/rpc/proto/woodpecker_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0970f35

Please sign in to comment.