Skip to content

Commit 01211b3

Browse files
committed
Revert "try to fix conflicts"
This reverts commit f05eb40.
1 parent f05eb40 commit 01211b3

File tree

9 files changed

+13
-342
lines changed

9 files changed

+13
-342
lines changed

models/fixtures/action_run.yml

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
ref: "refs/heads/master"
1010
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
1111
event: "push"
12-
trigger_event: "push"
1312
is_fork_pull_request: 0
1413
status: 1
1514
started: 1683636528
@@ -29,7 +28,6 @@
2928
ref: "refs/heads/master"
3029
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
3130
event: "push"
32-
trigger_event: "push"
3331
is_fork_pull_request: 0
3432
status: 1
3533
started: 1683636528
@@ -40,107 +38,6 @@
4038
approved_by: 0
4139
-
4240
id: 793
43-
title: "job output"
44-
repo_id: 4
45-
owner_id: 1
46-
workflow_id: "test.yaml"
47-
index: 189
48-
trigger_user_id: 1
49-
ref: "refs/heads/master"
50-
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
51-
event: "push"
52-
trigger_event: "push"
53-
is_fork_pull_request: 0
54-
status: 6 # running
55-
started: 1683636528
56-
stopped: 1683636626
57-
created: 1683636108
58-
updated: 1683636626
59-
need_approval: 0
60-
approved_by: 0
61-
-
62-
id: 794
63-
title: "job output"
64-
repo_id: 4
65-
owner_id: 1
66-
workflow_id: "test.yaml"
67-
index: 190
68-
trigger_user_id: 1
69-
ref: "refs/heads/test"
70-
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
71-
event: "push"
72-
trigger_event: "push"
73-
is_fork_pull_request: 0
74-
status: 1
75-
started: 1683636528
76-
stopped: 1683636626
77-
created: 1683636108
78-
updated: 1683636626
79-
need_approval: 0
80-
approved_by: 0
81-
-
82-
id: 802
83-
title: "workflow run list"
84-
repo_id: 5
85-
owner_id: 3
86-
workflow_id: "test.yaml"
87-
index: 191
88-
trigger_user_id: 1
89-
ref: "refs/heads/test"
90-
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
91-
event: "push"
92-
trigger_event: "push"
93-
is_fork_pull_request: 0
94-
status: 1
95-
started: 1683636528
96-
stopped: 1683636626
97-
created: 1683636108
98-
updated: 1683636626
99-
need_approval: 0
100-
approved_by: 0
101-
-
102-
id: 803
103-
title: "workflow run list for user"
104-
repo_id: 2
105-
owner_id: 0
106-
workflow_id: "test.yaml"
107-
index: 192
108-
trigger_user_id: 1
109-
ref: "refs/heads/test"
110-
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
111-
event: "push"
112-
trigger_event: "push"
113-
is_fork_pull_request: 0
114-
status: 1
115-
started: 1683636528
116-
stopped: 1683636626
117-
created: 1683636108
118-
updated: 1683636626
119-
need_approval: 0
120-
approved_by: 0
121-
122-
-
123-
id: 795
124-
title: "to be deleted (test)"
125-
repo_id: 2
126-
owner_id: 2
127-
workflow_id: "test.yaml"
128-
index: 191
129-
trigger_user_id: 1
130-
ref: "refs/heads/test"
131-
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
132-
event: "push"
133-
trigger_event: "push"
134-
is_fork_pull_request: 0
135-
status: 2
136-
started: 1683636528
137-
stopped: 1683636626
138-
created: 1683636108
139-
updated: 1683636626
140-
need_approval: 0
141-
approved_by: 0
142-
-
143-
id: 796
14441
title: "use a private action"
14542
repo_id: 6
14643
owner_id: 10

models/fixtures/action_run_job.yml

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -29,109 +29,6 @@
2929
-
3030
id: 194
3131
run_id: 793
32-
repo_id: 4
33-
owner_id: 1
34-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
35-
is_fork_pull_request: 0
36-
name: job1 (1)
37-
attempt: 1
38-
job_id: job1
39-
task_id: 49
40-
status: 1
41-
started: 1683636528
42-
stopped: 1683636626
43-
-
44-
id: 195
45-
run_id: 793
46-
repo_id: 4
47-
owner_id: 1
48-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
49-
is_fork_pull_request: 0
50-
name: job1 (2)
51-
attempt: 1
52-
job_id: job1
53-
task_id: 50
54-
status: 1
55-
started: 1683636528
56-
stopped: 1683636626
57-
-
58-
id: 196
59-
run_id: 793
60-
repo_id: 4
61-
owner_id: 1
62-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
63-
is_fork_pull_request: 0
64-
name: job2
65-
attempt: 1
66-
job_id: job2
67-
needs: '["job1"]'
68-
task_id: 51
69-
status: 5
70-
started: 1683636528
71-
stopped: 1683636626
72-
73-
-
74-
id: 198
75-
run_id: 795
76-
repo_id: 2
77-
owner_id: 2
78-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
79-
is_fork_pull_request: 0
80-
name: job_1
81-
attempt: 1
82-
job_id: job_1
83-
task_id: 53
84-
status: 1
85-
started: 1683636528
86-
stopped: 1683636626
87-
88-
-
89-
id: 199
90-
run_id: 795
91-
repo_id: 2
92-
owner_id: 2
93-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
94-
is_fork_pull_request: 0
95-
name: job_2
96-
attempt: 1
97-
job_id: job_2
98-
task_id: 54
99-
status: 2
100-
started: 1683636528
101-
stopped: 1683636626
102-
-
103-
id: 203
104-
run_id: 802
105-
repo_id: 5
106-
owner_id: 0
107-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
108-
is_fork_pull_request: 0
109-
name: job2
110-
attempt: 1
111-
job_id: job2
112-
needs: '["job1"]'
113-
task_id: 51
114-
status: 5
115-
started: 1683636528
116-
stopped: 1683636626
117-
-
118-
id: 204
119-
run_id: 803
120-
repo_id: 2
121-
owner_id: 0
122-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
123-
is_fork_pull_request: 0
124-
name: job2
125-
attempt: 1
126-
job_id: job2
127-
needs: '["job1"]'
128-
task_id: 51
129-
status: 5
130-
started: 1683636528
131-
stopped: 1683636626
132-
-
133-
id: 205
134-
run_id: 796
13532
repo_id: 6
13633
owner_id: 10
13734
commit_sha: 6e64b26de7ba966d01d90ecfaf5c7f14ef203e86

models/fixtures/action_task.yml

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -62,126 +62,6 @@
6262
job_id: 194
6363
attempt: 1
6464
runner_id: 1
65-
status: 1 # success
66-
started: 1683636528
67-
stopped: 1683636626
68-
repo_id: 4
69-
owner_id: 1
70-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
71-
is_fork_pull_request: 0
72-
token_hash: b8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784220
73-
token_salt: ffffffffff
74-
token_last_eight: ffffffff
75-
log_filename: artifact-test2/2f/47.log
76-
log_in_storage: 1
77-
log_length: 707
78-
log_size: 90179
79-
log_expired: 0
80-
-
81-
id: 50
82-
job_id: 195
83-
attempt: 1
84-
runner_id: 1
85-
status: 1 # success
86-
started: 1683636528
87-
stopped: 1683636626
88-
repo_id: 4
89-
owner_id: 1
90-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
91-
is_fork_pull_request: 0
92-
token_hash: b8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784221
93-
token_salt: ffffffffff
94-
token_last_eight: ffffffff
95-
log_filename: artifact-test2/2f/47.log
96-
log_in_storage: 1
97-
log_length: 707
98-
log_size: 90179
99-
log_expired: 0
100-
-
101-
id: 51
102-
job_id: 196
103-
attempt: 1
104-
runner_id: 1
105-
status: 6 # running
106-
started: 1683636528
107-
stopped: 1683636626
108-
repo_id: 4
109-
owner_id: 1
110-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
111-
is_fork_pull_request: 0
112-
token_hash: b8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784222
113-
token_salt: ffffffffff
114-
token_last_eight: ffffffff
115-
log_filename: artifact-test2/2f/47.log
116-
log_in_storage: 1
117-
log_length: 707
118-
log_size: 90179
119-
log_expired: 0
120-
-
121-
id: 52
122-
job_id: 196
123-
attempt: 1
124-
runner_id: 34350
125-
status: 6 # running
126-
started: 1683636528
127-
stopped: 1683636626
128-
repo_id: 4
129-
owner_id: 1
130-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
131-
is_fork_pull_request: 0
132-
token_hash: f8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784222
133-
token_salt: ffffffffff
134-
token_last_eight: ffffffff
135-
log_filename: artifact-test2/2f/47.log
136-
log_in_storage: 1
137-
log_length: 707
138-
log_size: 90179
139-
log_expired: 0
140-
-
141-
id: 53
142-
job_id: 198
143-
attempt: 1
144-
runner_id: 1
145-
status: 1
146-
started: 1683636528
147-
stopped: 1683636626
148-
repo_id: 2
149-
owner_id: 2
150-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
151-
is_fork_pull_request: 0
152-
token_hash: b8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784223
153-
token_salt: ffffffffff
154-
token_last_eight: ffffffff
155-
log_filename: artifact-test2/2f/47.log
156-
log_in_storage: 1
157-
log_length: 0
158-
log_size: 0
159-
log_expired: 0
160-
-
161-
id: 54
162-
job_id: 199
163-
attempt: 1
164-
runner_id: 1
165-
status: 2
166-
started: 1683636528
167-
stopped: 1683636626
168-
repo_id: 2
169-
owner_id: 2
170-
commit_sha: c2d72f548424103f01ee1dc02889c1e2bff816b0
171-
is_fork_pull_request: 0
172-
token_hash: b8d3962425466b6709b9ac51446f93260c54afe8e7b6d3686e34f991fb8a8953822b0deed86fe41a103f34bc48dbc4784224
173-
token_salt: ffffffffff
174-
token_last_eight: ffffffff
175-
log_filename: artifact-test2/2f/47.log
176-
log_in_storage: 1
177-
log_length: 0
178-
log_size: 0
179-
log_expired: 0
180-
-
181-
id: 55
182-
job_id: 205
183-
attempt: 1
184-
runner_id: 1
18565
status: 6 # 6 is the status code for "running"
18666
started: 1683636528
18767
stopped: 1683636626

models/user/search.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ type SearchUserOptions struct {
4646

4747
func (opts *SearchUserOptions) toSearchQueryBase(ctx context.Context) *xorm.Session {
4848
var cond builder.Cond
49-
cond = builder.Eq{"type": opts.Types}
49+
cond = builder.In("type", opts.Types)
5050
if opts.IncludeReserved {
51-
switch {
52-
case slices.Contains(opts.Types, UserTypeIndividual):
51+
if slices.Contains(opts.Types, UserTypeIndividual) {
5352
cond = cond.Or(builder.Eq{"type": UserTypeUserReserved}).Or(
5453
builder.Eq{"type": UserTypeBot},
5554
).Or(
5655
builder.Eq{"type": UserTypeRemoteUser},
5756
)
58-
case slices.Contains(opts.Types, UserTypeOrganization):
57+
}
58+
if slices.Contains(opts.Types, UserTypeOrganization) {
5959
cond = cond.Or(builder.Eq{"type": UserTypeOrganizationReserved})
6060
}
6161
}

models/user/user_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestSearchUsers(t *testing.T) {
7575
}
7676

7777
// test orgs
78-
testOrgSuccess := func(opts user_model.SearchUserOptions, expectedOrgIDs []int64) {
78+
testOrgSuccess := func(opts *user_model.SearchUserOptions, expectedOrgIDs []int64) {
7979
opts.Types = []user_model.UserType{user_model.UserTypeOrganization}
8080
testSuccess(opts, expectedOrgIDs)
8181
}
@@ -99,7 +99,7 @@ func TestSearchUsers(t *testing.T) {
9999
[]int64{})
100100

101101
// test users
102-
testUserSuccess := func(opts user_model.SearchUserOptions, expectedUserIDs []int64) {
102+
testUserSuccess := func(opts *user_model.SearchUserOptions, expectedUserIDs []int64) {
103103
opts.Types = []user_model.UserType{user_model.UserTypeIndividual}
104104
testSuccess(opts, expectedUserIDs)
105105
}

0 commit comments

Comments
 (0)