Skip to content

Commit

Permalink
src/send_kcidb: use kcidb postgresql password from TOML
Browse files Browse the repository at this point in the history
In order to avoid using environment variables,
use TOML file for KCIDB postgresql DB user password.
Also, declare other existing args with `help` options
in `cmd_run`.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Nov 11, 2024
1 parent 6894a3f commit cc9aff6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/kernelci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ database_name = "playground_kcidb"
postgresql_host = "kernelci-pipeline-postgres-proxy"
postgresql_port = 5432
postgresql_user = "kernelci.org"
# postgresql_password = "KCIDB-POSTGRESQL-USER-PASSWORD"
origin = "maestro"

[test_report]
Expand Down
22 changes: 21 additions & 1 deletion src/send_kcidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _setup(self, args):
db_conn = (
f"postgresql:dbname={args.database_name} "
f"user={args.postgresql_user} host={args.postgresql_host} "
f"password={os.getenv('KCIDB_POSTGRESQL_PASSWORD')} "
f"password={args.postgresql_password} "
f"port={args.postgresql_port}"
)
db_client = kcidb.db.Client(db_conn)
Expand Down Expand Up @@ -594,6 +594,26 @@ class cmd_run(Command):
'name': '--origin',
'help': "CI system identifier",
},
{
'name': '--database-name',
'help': "KCIDB postgresql database instance name",
},
{
'name': '--postgresql-host',
'help': "KCIDB postgresql DB host",
},
{
'name': '--postgresql-port',
'help': "KCIDB postgresql DB port",
},
{
'name': '--postgresql-user',
'help': "Username for connecting to KCIDB postgresql DB",
},
{
'name': '--postgresql-password',
'help': "Password for connecting to KCIDB postgresql DB",
},
]

def __call__(self, configs, args):
Expand Down

0 comments on commit cc9aff6

Please sign in to comment.