2017-06-17 00:49:45 -04:00
# NOTE: all users should have a password of "password"
2017-01-01 13:15:09 -05:00
- # NOTE: this user (id=1) is the admin
id : 1
lower_name : user1
name : user1
2022-04-29 14:24:38 +02:00
login_name : user1
2017-01-08 22:08:36 -05:00
full_name : User One
2017-01-01 13:15:09 -05:00
email : user1@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-01 13:15:09 -05:00
type : 0 # individual
2017-05-20 04:48:22 -04:00
salt : ZogKvWdyEx
2017-01-01 13:15:09 -05:00
is_admin : true
avatar : avatar1
2017-02-02 20:33:36 +08:00
avatar_email : user1@example.com
2017-01-01 13:15:09 -05:00
num_repos : 0
2017-10-25 01:36:19 +08:00
is_active : true
2017-01-01 13:15:09 -05:00
-
id : 2
lower_name : user2
name : user2
2022-04-29 14:24:38 +02:00
login_name : user2
2019-01-24 14:12:17 +00:00
full_name : " < U<se>r Tw<o > >< "
2017-01-01 13:15:09 -05:00
email : user2@example.com
2019-02-19 15:11:50 +01:00
keep_email_private : true
2019-08-29 14:05:42 +00:00
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-01 13:15:09 -05:00
type : 0 # individual
2017-05-02 03:49:55 +03:00
salt : ZogKvWdyEx
2017-01-01 13:15:09 -05:00
is_admin : false
avatar : avatar2
avatar_email : user2@example.com
2019-09-11 14:26:28 -03:00
num_repos : 9
2017-02-04 10:58:43 -05:00
num_stars : 2
2017-05-20 04:48:22 -04:00
num_followers : 2
num_following : 1
2017-05-02 03:49:55 +03:00
is_active : true
2017-01-07 22:10:53 -05:00
-
id : 3
lower_name : user3
name : user3
2022-04-29 14:24:38 +02:00
login_name : user3
2019-01-24 14:12:17 +00:00
full_name : " <<<< >> >> > >> > >>> >> "
2017-01-07 22:10:53 -05:00
email : user3@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : onmention
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-07 22:10:53 -05:00
type : 1 # organization
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-01-07 22:10:53 -05:00
is_admin : false
avatar : avatar3
avatar_email : user3@example.com
2018-06-21 18:00:13 +02:00
num_repos : 3
2019-11-20 12:27:49 +01:00
num_members : 3
num_teams : 4
2017-01-07 22:10:53 -05:00
-
id : 4
lower_name : user4
name : user4
2022-04-29 14:24:38 +02:00
login_name : user4
2019-01-24 14:12:17 +00:00
full_name : " "
2017-01-07 22:10:53 -05:00
email : user4@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : onmention
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-24 11:16:36 -05:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-01-07 22:10:53 -05:00
is_admin : false
avatar : avatar4
avatar_email : user4@example.com
num_repos : 0
2017-03-11 03:46:53 -05:00
num_following : 1
2017-10-25 01:36:19 +08:00
is_active : true
2017-01-07 22:10:53 -05:00
-
id : 5
lower_name : user5
name : user5
2022-04-29 14:24:38 +02:00
login_name : user5
2017-01-08 22:08:36 -05:00
full_name : User Five
2017-01-07 22:10:53 -05:00
email : user5@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-24 11:16:36 -05:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-01-07 22:10:53 -05:00
is_admin : false
avatar : avatar5
avatar_email : user5@example.com
num_repos : 1
2017-01-24 11:16:36 -05:00
allow_create_organization : false
2017-02-02 20:33:36 +08:00
is_active : true
2017-03-11 03:46:53 -05:00
num_following : 0
2017-01-24 11:16:36 -05:00
-
id : 6
lower_name : user6
name : user6
2022-04-29 14:24:38 +02:00
login_name : user6
2017-01-24 11:16:36 -05:00
full_name : User Six
email : user6@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-24 11:16:36 -05:00
type : 1 # organization
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-01-24 11:16:36 -05:00
is_admin : false
avatar : avatar6
avatar_email : user6@example.com
num_repos : 0
2019-11-20 12:27:49 +01:00
num_members : 2
num_teams : 2
2017-01-24 11:16:36 -05:00
-
id : 7
lower_name : user7
name : user7
2022-04-29 14:24:38 +02:00
login_name : user7
2017-01-24 11:16:36 -05:00
full_name : User Seven
email : user7@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : disabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-01-24 11:16:36 -05:00
type : 1 # organization
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-01-24 11:16:36 -05:00
is_admin : false
avatar : avatar7
avatar_email : user7@example.com
num_repos : 0
num_members : 1
2017-02-04 10:58:43 -05:00
num_teams : 1
2017-02-02 20:33:36 +08:00
-
id : 8
lower_name : user8
name : user8
2022-04-29 14:24:38 +02:00
login_name : user8
2017-02-02 20:33:36 +08:00
full_name : User Eight
email : user8@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-07 09:49:37 -05:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-02 20:33:36 +08:00
is_admin : false
avatar : avatar8
avatar_email : user8@example.com
num_repos : 0
is_active : true
2017-05-20 04:48:22 -04:00
num_followers : 1
num_following : 1
2017-02-02 20:33:36 +08:00
-
id : 9
lower_name : user9
name : user9
2022-04-29 14:24:38 +02:00
login_name : user9
2017-02-02 20:33:36 +08:00
full_name : User Nine
email : user9@example.com
2019-08-29 14:05:42 +00:00
email_notifications_preference : onmention
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-07 09:49:37 -05:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-02 20:33:36 +08:00
is_admin : false
avatar : avatar9
avatar_email : user9@example.com
num_repos : 0
is_active : false
2017-02-04 09:20:56 +08:00
-
id : 10
lower_name : user10
name : user10
2022-04-29 14:24:38 +02:00
login_name : user10
2017-02-04 09:20:56 +08:00
full_name : User Ten
email : user10@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-07 09:49:37 -05:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-04 09:20:56 +08:00
is_admin : false
avatar : avatar10
avatar_email : user10@example.com
2017-02-07 09:49:37 -05:00
num_repos : 3
2017-02-04 09:20:56 +08:00
is_active : true
2017-02-11 11:57:57 +01:00
-
id : 11
lower_name : user11
name : user11
2022-04-29 14:24:38 +02:00
login_name : user11
2017-02-11 11:57:57 +01:00
full_name : User Eleven
email : user11@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-11 11:57:57 +01:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-11 11:57:57 +01:00
is_admin : false
avatar : avatar11
avatar_email : user11@example.com
num_repos : 1
is_active : true
2017-02-15 23:24:23 +08:00
-
id : 12
lower_name : user12
name : user12
2022-04-29 14:24:38 +02:00
login_name : user12
2017-02-15 23:24:23 +08:00
full_name : User 12
email : user12@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-15 23:24:23 +08:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-15 23:24:23 +08:00
is_admin : false
avatar : avatar12
avatar_email : user12@example.com
num_repos : 1
is_active : true
-
id : 13
lower_name : user13
name : user13
2022-04-29 14:24:38 +02:00
login_name : user13
2017-02-15 23:24:23 +08:00
full_name : User 13
email : user13@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-15 23:24:23 +08:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-15 23:24:23 +08:00
is_admin : false
avatar : avatar13
avatar_email : user13@example.com
num_repos : 1
is_active : true
2017-02-22 21:15:14 +08:00
-
id : 14
lower_name : user14
name : user14
2022-04-29 14:24:38 +02:00
login_name : user14
2017-02-22 21:15:14 +08:00
full_name : User 14
email : user14@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-02-22 21:15:14 +08:00
type : 0 # individual
2017-05-26 09:15:45 -04:00
salt : ZogKvWdyEx
2017-02-22 21:15:14 +08:00
is_admin : false
avatar : avatar14
avatar_email : user13@example.com
num_repos : 3
is_active : true
2017-09-22 12:51:16 +02:00
-
id : 15
lower_name : user15
name : user15
2022-04-29 14:24:38 +02:00
login_name : user15
2017-09-22 12:51:16 +02:00
full_name : User 15
email : user15@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-09-22 12:51:16 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar15
avatar_email : user15@example.com
num_repos : 4
is_active : true
-
id : 16
lower_name : user16
name : user16
2022-04-29 14:24:38 +02:00
login_name : user16
2017-09-22 12:51:16 +02:00
full_name : User 16
email : user16@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-09-22 12:51:16 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar16
avatar_email : user16@example.com
num_repos : 2
is_active : true
-
id : 17
lower_name : user17
name : user17
2022-04-29 14:24:38 +02:00
login_name : user17
2017-09-22 12:51:16 +02:00
full_name : User 17
email : user17@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-09-22 12:51:16 +02:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar17
avatar_email : user17@example.com
num_repos : 2
is_active : true
2020-01-13 19:33:46 +02:00
num_members : 3
2018-11-28 19:26:14 +08:00
num_teams : 3
2017-10-17 17:20:22 +02:00
-
id : 18
lower_name : user18
name : user18
2022-04-29 14:24:38 +02:00
login_name : user18
2017-10-17 17:20:22 +02:00
full_name : User 18
email : user18@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-10-17 17:20:22 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar18
avatar_email : user18@example.com
num_repos : 0
2017-10-26 23:16:13 +02:00
is_active : true
-
id : 19
lower_name : user19
name : user19
2022-04-29 14:24:38 +02:00
login_name : user19
2017-10-26 23:16:13 +02:00
full_name : User 19
email : user19@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-10-26 23:16:13 +02:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar19
avatar_email : user19@example.com
num_repos : 2
is_active : true
num_members : 1
num_teams : 1
-
id : 20
lower_name : user20
name : user20
2022-04-29 14:24:38 +02:00
login_name : user20
2017-10-26 23:16:13 +02:00
full_name : User 20
email : user20@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2017-10-26 23:16:13 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar20
avatar_email : user20@example.com
num_repos : 4
2018-05-01 17:04:36 +10:00
is_active : true
2018-09-13 10:33:48 +08:00
-
id : 21
lower_name : user21
name : user21
2022-04-29 14:24:38 +02:00
login_name : user21
2018-09-13 10:33:48 +08:00
full_name : User 21
email : user21@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2018-09-13 10:33:48 +08:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar21
avatar_email : user21@example.com
num_repos : 2
is_active : true
2019-04-26 02:59:10 +08:00
-
id : 22
lower_name : limited_org
name : limited_org
2022-04-29 14:24:38 +02:00
login_name : limited_org
2019-04-26 02:59:10 +08:00
full_name : Limited Org
email : limited_org@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-04-26 02:59:10 +08:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar22
avatar_email : limited_org@example.com
num_repos : 2
is_active : true
num_members : 0
num_teams : 0
visibility : 1
-
id : 23
lower_name : privated_org
name : privated_org
2022-04-29 14:24:38 +02:00
login_name : privated_org
2019-04-26 02:59:10 +08:00
full_name : Privated Org
email : privated_org@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-04-26 02:59:10 +08:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar23
avatar_email : privated_org@example.com
num_repos : 2
is_active : true
num_members : 0
num_teams : 0
2019-08-02 18:06:28 +02:00
visibility : 2
-
id : 24
lower_name : user24
name : user24
2022-04-29 14:24:38 +02:00
login_name : user24
2019-08-02 18:06:28 +02:00
full_name : "user24"
email : user24@example.com
keep_email_private : true
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-08-02 18:06:28 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar24
avatar_email : user24@example.com
num_repos : 0
num_stars : 0
num_followers : 0
num_following : 0
is_active : true
-
id : 25
lower_name : org25
name : org25
2022-04-29 14:24:38 +02:00
login_name : org25
2019-08-02 18:06:28 +02:00
full_name : "org25"
email : org25@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-08-02 18:06:28 +02:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar25
avatar_email : org25@example.com
num_repos : 0
num_members : 1
num_teams : 1
2019-09-23 22:08:03 +02:00
-
id : 26
lower_name : org26
name : org26
2022-04-29 14:24:38 +02:00
login_name : org26
2019-09-23 22:08:03 +02:00
full_name : "Org26"
email : org26@example.com
email_notifications_preference : onmention
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-09-23 22:08:03 +02:00
type : 1 # organization
salt : ZogKvWdyEx
is_admin : false
avatar : avatar26
avatar_email : org26@example.com
2019-12-07 05:21:18 +01:00
num_repos : 4
2019-09-23 22:08:03 +02:00
num_members : 0
num_teams : 1
2019-11-11 09:15:29 -06:00
repo_admin_change_team_access : true
-
id : 27
lower_name : user27
name : user27
2022-04-29 14:24:38 +02:00
login_name : user27
2019-11-11 09:15:29 -06:00
full_name : User Twenty-Seven
email : user27@example.com
email_notifications_preference : enabled
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-11-11 09:15:29 -06:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar27
avatar_email : user27@example.com
[RFC] Make archival asynchronous (#11296)
* Make archival asynchronous
The prime benefit being sought here is for large archives to not
clog up the rendering process and cause unsightly proxy timeouts.
As a secondary benefit, archive-in-progress is moved out of the
way into a /tmp file so that new archival requests for the same
commit will not get fulfilled based on an archive that isn't yet
finished.
This asynchronous system is fairly primitive; request comes in, we'll
spawn off a new goroutine to handle it, then we'll mark it as done.
Status requests will see if the file exists in the final location,
and report the archival as done when it exists.
Fixes #11265
* Archive links: drop initial delay to three-quarters of a second
Some, or perhaps even most, archives will not take all that long to archive.
The archive process starts as soon as the download button is initially
clicked, so in theory they could be done quite quickly. Drop the initial
delay down to three-quarters of a second to make it more responsive in the
common case of the archive being quickly created.
* archiver: restructure a little bit to facilitate testing
This introduces two sync.Cond pointers to the archiver package. If they're
non-nil when we go to process a request, we'll wait until signalled (at all)
to proceed. The tests will then create the sync.Cond so that it can signal
at-will and sanity-check the state of the queue at different phases.
The author believes that nil-checking these two sync.Cond pointers on every
archive processing will introduce minimal overhead with no impact on
maintainability.
* gofmt nit: no space around binary + operator
* services: archiver: appease golangci-lint, lock queueMutex
Locking/unlocking the queueMutex is allowed, but not required, for
Cond.Signal() and Cond.Broadcast(). The magic at play here is just a little
too much for golangci-lint, as we take the address of queueMutex and this is
mostly used in archiver.go; the variable still gets flagged as unused.
* archiver: tests: fix several timing nits
Once we've signaled a cond var, it may take some small amount of time for
the goroutines released to hit the spot we're wanting them to be at. Give
them an appropriate amount of time.
* archiver: tests: no underscore in var name, ungh
* archiver: tests: Test* is run in a separate context than TestMain
We must setup the mutex/cond variables at the beginning of any test that's
going to use it, or else these will be nil when the test is actually ran.
* archiver: tests: hopefully final tweak
Things got shuffled around such that we carefully build up and release
requests from the queue, so we can validate the state of the queue at each
step. Fix some assertions that no longer hold true as fallout.
* repo: Download: restore some semblance of previous behavior
When archival was made async, the GET endpoint was only useful if a previous
POST had initiated the download. This commit restores the previous behavior,
to an extent; we'll now submit the archive request there and return a
"202 Accepted" to indicate that it's processing if we didn't manage to
complete the request within ~2 seconds of submission.
This lets a client directly GET the archive, and gives them some indication
that they may attempt to GET it again at a later time.
* archiver: tests: simplify a bit further
We don't need to risk failure and use time.ParseDuration to get 2 *
time.Second.
else if isn't really necessary if the conditions are simple enough and lead
to the same result.
* archiver: tests: resolve potential source of flakiness
Increase all timeouts to 10 seconds; these aren't hard-coded sleeps, so
there's no guarantee we'll actually take that long. If we need longer to
not have a false-positive, then so be it.
While here, various assert.{Not,}Equal arguments are flipped around so that
the wording in error output reflects reality, where the expected argument is
second and actual third.
* archiver: setup infrastructure for notifying consumers of completion
This API will *not* allow consumers to subscribe to specific requests being
completed, just *any* request being completed. The caller is responsible for
determining if their request is satisfied and waiting again if needed.
* repo: archive: make GET endpoint synchronous again
If the request isn't complete, this endpoint will now submit the request and
wait for completion using the new API. This may still be susceptible to
timeouts for larger repos, but other endpoints now exist that the web
interface will use to negotiate its way through larger archive processes.
* archiver: tests: amend test to include WaitForCompletion()
This is a trivial one, so go ahead and include it.
* archiver: tests: fix test by calling NewContext()
The mutex is otherwise uninitialized, so we need to ensure that we're
actually initializing it if we plan to test it.
* archiver: tests: integrate new WaitForCompletion a little better
We can use this to wait for archives to come in, rather than spinning and
hoping with a timeout.
* archiver: tests: combine numQueued declaration with next-instruction assignment
* routers: repo: reap unused archiving flag from DownloadStatus()
This had some planned usage before, indicating whether this request
initiated the archival process or not. After several rounds of refactoring,
this use was deemed not necessary for much of anything and got boiled down
to !complete in all cases.
* services: archiver: restructure to use a channel
We now offer two forms of waiting for a request:
- WaitForCompletion: wait for completion with no timeout
- TimedWaitForCompletion: wait for completion with timeout
In both cases, we wait for the given request's cchan to close; in the latter
case, we do so with the caller-provided timeout. This completely removes the
need for busy-wait loops in Download/InitiateDownload, as it's fairly clean
to wait on a channel with timeout.
* services: archiver: use defer to unlock now that we can
This previously carried the lock into the goroutine, but an intermediate
step just added the request to archiveInProgress outside of the new
goroutine and removed the need for the goroutine to start out with it.
* Revert "archiver: tests: combine numQueued declaration with next-instruction assignment"
This reverts commit bcc52140238e16680f2e05e448e9be51372afdf5.
Revert "archiver: tests: integrate new WaitForCompletion a little better"
This reverts commit 9fc8bedb5667d24d3a3c7843dc28a229efffb1e6.
Revert "archiver: tests: fix test by calling NewContext()"
This reverts commit 709c35685eaaf261ebbb7d3420e3376a4ee8e7f2.
Revert "archiver: tests: amend test to include WaitForCompletion()"
This reverts commit 75261f56bc05d1fa8ff7e81dcbc0ccd93fdc9d50.
* archiver: tests: first attempt at WaitForCompletion() tests
* archiver: tests: slight improvement, less busy-loop
Just wait for the requests to complete in order, instead of busy-waiting
with a timeout. This is slightly less fragile.
While here, reverse the arguments of a nearby assert.Equal() so that
expected/actual are correct in any test output.
* archiver: address lint nits
* services: archiver: only close the channel once
* services: archiver: use a struct{} for the wait channel
This makes it obvious that the channel is only being used as a signal,
rather than anything useful being piped through it.
* archiver: tests: fix expectations
Move the close of the channel into doArchive() itself; notably, before these
goroutines move on to waiting on the Release cond.
The tests are adjusted to reflect that we can't WaitForCompletion() after
they've already completed, as WaitForCompletion() doesn't indicate that
they've been released from the queue yet.
* archiver: tests: set cchan to nil for comparison
* archiver: move ctx.Error's back into the route handlers
We shouldn't be setting this in a service, we should just be validating the
request that we were handed.
* services: archiver: use regex to match a hash
This makes sure we don't try and use refName as a hash when it's clearly not
one, e.g. heads/pull/foo.
* routers: repo: remove the weird /archive/status endpoint
We don't need to do this anymore, we can just continue POSTing to the
archive/* endpoint until we're told the download's complete. This avoids a
potential naming conflict, where a ref could start with "status/"
* archiver: tests: bump reasonable timeout to 15s
* archiver: tests: actually release timedReq
* archiver: tests: run through inFlight instead of manually checking
While we're here, add a test for manually re-processing an archive that's
already been complete. Re-open the channel and mark it incomplete, so that
doArchive can just mark it complete again.
* initArchiveLinks: prevent default behavior from clicking
* archiver: alias gitea's context, golang context import pending
* archiver: simplify logic, just reconstruct slices
While the previous logic was perhaps slightly more efficient, the
new variant's readability is much improved.
* archiver: don't block shutdown on waiting for archive
The technique established launches a goroutine to do the wait,
which will close a wait channel upon termination. For the timeout
case, we also send back a value indicating whether the timeout was
hit or not.
The timeouts are expected to be relatively small, but still a multi-
second delay to shutdown due to this could be unfortunate.
* archiver: simplify shutdown logic
We can just grab the shutdown channel from the graceful manager instead of
constructing a channel to halt the caller and/or pass a result back.
* Style issues
* Fix mis-merge
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-11-07 14:27:28 -06:00
num_repos : 3
2019-11-20 12:27:49 +01:00
-
id : 28
lower_name : user28
name : user28
2022-04-29 14:24:38 +02:00
login_name : user28
2019-11-20 12:27:49 +01:00
full_name : "user27"
email : user28@example.com
keep_email_private : true
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2019-11-20 12:27:49 +01:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
avatar : avatar28
avatar_email : user28@example.com
num_repos : 0
num_stars : 0
num_followers : 0
num_following : 0
is_active : true
2020-01-13 19:33:46 +02:00
-
id : 29
lower_name : user29
name : user29
2022-04-29 14:24:38 +02:00
login_name : user29
2020-01-13 19:33:46 +02:00
full_name : User 29
email : user29@example.com
2020-09-03 19:58:31 +01:00
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
2020-01-13 19:33:46 +02:00
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
is_restricted : true
avatar : avatar29
avatar_email : user29@example.com
num_repos : 0
is_active : true
2021-01-13 05:19:17 +01:00
-
id : 30
lower_name : user30
name : user30
2022-04-29 14:24:38 +02:00
login_name : user30
2021-01-13 05:19:17 +01:00
full_name : User Thirty
email : user30@example.com
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
is_restricted : true
avatar : avatar29
avatar_email : user30@example.com
2022-02-26 07:15:25 +01:00
num_repos : 3
2021-01-13 05:19:17 +01:00
is_active : true
2021-10-13 02:11:35 +08:00
prohibit_login : true
2021-06-26 22:53:14 +03:00
-
id : 31
lower_name : user31
name : user31
2022-04-29 14:24:38 +02:00
login_name : user31
2021-06-26 22:53:14 +03:00
full_name : "user31"
email : user31@example.com
passwd_hash_algo : argon2
passwd : a3d5fcd92bae586c2e3dbe72daea7a0d27833a8d0227aa1704f4bbd775c1f3b03535b76dd93b0d4d8d22a519dca47df1547b # password
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
visibility : 2
avatar : avatar31
avatar_email : user31@example.com
num_repos : 0
is_active : true
2021-11-08 23:47:19 +01:00
-
id : 32
lower_name : user32
name : user32
2022-04-29 14:24:38 +02:00
login_name : user32
2021-11-08 23:47:19 +01:00
full_name : User 32 (U2F test)
email : user32@example.com
passwd : 7d93daa0d1e6f2305cc8fa496847d61dc7320bb16262f9c55dd753480207234cdd96a93194e408341971742f4701772a025a # password
type : 0 # individual
salt : ZogKvWdyEx
is_admin : false
is_restricted : false
avatar : avatar32
avatar_email : user30@example.com
num_repos : 0
is_active : true