Commit graph

19 commits

Author SHA1 Message Date
Kevin Morris
eb56305091 gendummydata: lower record counts
This commit halves MAX_USERS and MAX_PKGS, in addition
to setting OPEN_PROPOSALS to 15 and CLOSE_PROPOSALS to 50.

A few counts are now configurable via environment variable:

- MAX_USERS, default: 38000
- MAX_PKGS, default: 32000
- OPEN_PROPOSALS, default: 15
- CLOSE_PROPOSALS, default: 15

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-25 18:26:40 -07:00
Kevin Morris
201a04ffb9 gendummydata: employ a salted hash for users
As of Python updates, we are no longer considering rows with
empty salts to be legacy hashes. Update gendummydata.py to
generate salts for the legacy passwords it uses with
salt rounds = 4.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-25 17:09:59 -07:00
Kevin Morris
4f09e939ae bugfix: gendummydata.py was producing invalid usernames
As per our regex and policies, usernames should consist of
ascii alphanumeric characters and possibly (-, _ or .).

gendummydata.py was creating unicode versions of some
usernames and adding them into the DB. With our newfound
collations, this becomes a problem as it treats them as
the same.

This should have never been the case here, and so,
gendummydata.py has been patched to normalize all of its
usernames and package names.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-06 21:46:16 -07:00
Jakub Klinkovský
3062a78a92 gendummydata.py: optimize iteration for big numbers of pkgs
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Jakub Klinkovský
51a3535820 gendummydata.py: set MAX_USERS and MAX_PKGS to more realistic values
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Jakub Klinkovský
879c0622d6 gendummydata.py: set exit code to 1 when there is an error
Of course the default exit code is 0...

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Jakub Klinkovský
92e315465b gendummydata.py: remove unused database connection variables
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:25:21 -05:00
Filipe Laíns
8d1be7ea8a Refactor code to comply with flake8 and isort
Signed-off-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:24:30 -05:00
Lukas Fleischer
cb307bf01a Do not hardcode path to the Python interpreter
Use `/usr/bin/env python3` instead of `/usr/bin/python3` in the shebang
of Python scripts. This adds support for non-standard Python interpreter
paths such as the paths used in virtualenv environments.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-08-25 07:01:12 +02:00
Mark Weiman
0c6a415cb3 gendummydata.py: Fix NOT NULL constraint problems
PackageBases.FlaggerComment and PackageComments.RenderedComment cannot
be NULL and would cause problems in the output file for sqlite users.
This patch adds empty strings ("") as values for these fields.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-05-02 16:29:40 +02:00
Mark Weiman
c19284c783 gendummydata.py: Fix to make it less db specific
Sqlite3 does not support the MD5 function like MySQL does, instead of the
database program hash the passwords, have Python's hashlib module do it
instead.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-03-01 20:29:07 +01:00
Marcel Korpel
86ee7b1c6b gendummydata.py: Remove CategoryID from dummy data
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-16 23:12:22 +02:00
Leonidas Spyropoulos
e1d92e05f2 Adding PackagerUID to the generated dummy data
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 21:54:53 +02:00
Shinya Yamaoka
d3caf42301 Fixes incorrect SQLs on generating dummy data.
The number of columns in the SQLs doesn't match the number of rows,
so an error like below occurs:

ERROR 1136 (21S01) at line 50929: Column count doesn't match value count
at row 1

Signed-off-by: Shinya Yamaoka <contact@mail.libmacro.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-13 16:29:15 +01:00
Lukas Fleischer
92812050a0 Store conflicts, provides and replaces in the DB
Package conflicts, provides and replaces are now stored in the new
PackageRelations table. The gendummydata script generates test entries
for these relations.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 13:20:56 +02:00
Lukas Fleischer
73936002f7 Store {make,check,opt}depends in the database
In addition to parsing and storing dependencies of packages, store
makedepends, checkdepends and optdepends. Every dependency (of any type)
is displayed on the package details page.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-17 21:09:16 +02:00
Lukas Fleischer
d35cf67f7b Store comments on a per-package base basis
Move comments from the Packages table to PackageBases. Sharing comments
makes sense since they almost always refer to a source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
b7941073ac Add provisional support for package bases
This adds a PackageBases table to the database schema and moves the
following fields from the Packages table to PackageBases:

* CategoryID
* NumVotes
* OutOfDateTS
* SubmittedTS
* ModifiedTS
* SubmitterUID
* MaintainerUID

It also fixes all database accesses to comply with the new layout.

Having a separate PackageBases table is the first step to split package
support. By now, we create one PackageBases entry per package (where the
package base has the same name as the corresponding package). When
adding full support for split packages later, the package base name will
be derived from the pkgbase variable and a single package base will be
shared amongst all packages built from one source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
b7b586a8c4 Move support/schema/ to schema/
There aren't any other subdirectories in support/. Reduce the nesting
depth by moving schema/ to the top-level source directory.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-06 19:11:25 +01:00
Renamed from support/schema/gendummydata.py (Browse further)