Skip to content

Commit 63ee905

Browse files
committed
Merge branch 'main' into feature/vote-decrypt
2 parents 5f250dd + 1869e9b commit 63ee905

39 files changed

+2452
-1311
lines changed

.github/workflows/autoupdate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Set up Go
99
uses: actions/setup-go@v5
1010
with:
11-
go-version: '1.21'
11+
go-version: '1.22'
1212

1313
- name: Check out code into the Go module directory
1414
uses: actions/checkout@v4

.github/workflows/readme.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Go
3030
uses: actions/setup-go@v5
3131
with:
32-
go-version: '1.21'
32+
go-version: '1.22'
3333
id: go
3434

3535
- name: Check out code

.github/workflows/update-generated-files.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.21'
20+
go-version: '1.22'
2121

2222
- name: Check out code
2323
uses: actions/checkout@v4

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "openslides-meta"]
2+
path = meta
3+
url = https://github.com/OpenSlides/openslides-meta.git

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.21.6-alpine as base
1+
FROM golang:1.22.0-alpine as base
22
WORKDIR /root/
33

44
RUN apk add git

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,5 +271,5 @@ The service is configurated with environment variables. See [all environment var
271271

272272
## Update models.yml
273273

274-
To use a new models.yml update the value in the file `models-version`.
274+
To use a new models.yml update the meta repository in `meta`.
275275
Afterwards call `go generate ./...` to update the generated files.

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module github.com/OpenSlides/openslides-autoupdate-service
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/alecthomas/kong v0.8.1
77
github.com/golang-jwt/jwt/v4 v4.5.0
88
github.com/gomodule/redigo v1.8.9
9-
github.com/jackc/pgx/v5 v5.5.2
10-
github.com/klauspost/compress v1.17.5
9+
github.com/jackc/pgx/v5 v5.5.3
10+
github.com/klauspost/compress v1.17.6
1111
github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1
1212
github.com/ory/dockertest/v3 v3.10.0
1313
github.com/ostcar/topic v0.4.1
1414
github.com/stretchr/testify v1.8.4
1515
golang.org/x/sync v0.6.0
16-
golang.org/x/sys v0.16.0
16+
golang.org/x/sys v0.17.0
1717
gopkg.in/yaml.v3 v3.0.1
1818
)
1919

@@ -48,7 +48,7 @@ require (
4848
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
4949
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
5050
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
51-
golang.org/x/crypto v0.18.0 // indirect
51+
golang.org/x/crypto v0.19.0 // indirect
5252
golang.org/x/mod v0.9.0 // indirect
5353
golang.org/x/text v0.14.0 // indirect
5454
golang.org/x/tools v0.7.0 // indirect

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
4747
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
4848
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
4949
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
50-
github.com/jackc/pgx/v5 v5.5.2 h1:iLlpgp4Cp/gC9Xuscl7lFL1PhhW+ZLtXZcrfCt4C3tA=
51-
github.com/jackc/pgx/v5 v5.5.2/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
50+
github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s=
51+
github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
5252
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
5353
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
5454
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
5555
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
56-
github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
57-
github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
56+
github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=
57+
github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
5858
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
5959
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
6060
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -103,8 +103,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
103103
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
104104
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
105105
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
106-
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
107-
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
106+
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
107+
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
108108
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
109109
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
110110
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
@@ -123,8 +123,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
123123
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
124124
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
125125
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
126-
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
127-
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
126+
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
127+
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
128128
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
129129
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
130130
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=

internal/models/models-version

-8
This file was deleted.

internal/models/models.go

+1-44
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,14 @@
11
package models
22

33
import (
4-
"bufio"
54
_ "embed" // needed for embeding
65
"fmt"
76
"io"
8-
"log"
97
"strings"
108

119
"gopkg.in/yaml.v3"
1210
)
1311

14-
//go:embed models-version
15-
var version string
16-
17-
func getVersion() string {
18-
scanner := bufio.NewScanner(strings.NewReader(version))
19-
for scanner.Scan() {
20-
line := strings.TrimSpace(scanner.Text())
21-
if strings.HasPrefix(line, "//") || line == "" {
22-
continue
23-
}
24-
return line
25-
}
26-
if err := scanner.Err(); err != nil {
27-
log.Printf("invalid version %s", err)
28-
return "invalid"
29-
}
30-
return "no-value"
31-
}
32-
33-
const (
34-
repo = "https://raw.githubusercontent.com/OpenSlides/openslides-backend/"
35-
modelsPath = "/global/meta/models.yml"
36-
exampleDataPath = "/global/data/example-data.json"
37-
permissionPath = "/global/meta/permission.yml"
38-
)
39-
40-
// URLModelsYML return the url to the models.yml.
41-
func URLModelsYML() string {
42-
return repo + getVersion() + modelsPath
43-
}
44-
45-
// URLExampleData returns the url to the example-data file.
46-
func URLExampleData() string {
47-
return repo + getVersion() + exampleDataPath
48-
}
49-
50-
// URLPermission returns the url to the example-data file.
51-
func URLPermission() string {
52-
return repo + getVersion() + permissionPath
53-
}
54-
5512
// Unmarshal parses the content of models.yml to a datastruct.q
5613
func Unmarshal(r io.Reader) (map[string]Model, error) {
5714
var m map[string]Model
@@ -61,7 +18,7 @@ func Unmarshal(r io.Reader) (map[string]Model, error) {
6118
return m, nil
6219
}
6320

64-
// Model replresents one model from models.yml.
21+
// Model represents one model from models.yml.
6522
type Model struct {
6623
Fields map[string]*Field
6724
}

0 commit comments

Comments
 (0)