Skip to content

Commit

Permalink
src: fix staging username and add production user
Browse files Browse the repository at this point in the history
Fix check to verify `staging` username for setting
submitter field. Also, add `production` username
for the same.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia authored and nuclearcat committed Sep 20, 2024
1 parent b2ec394 commit e44f391
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/send_kcidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ def _run(self, context):
self.log.info(f"Received an event for node: {node['id']}")

# Submit nodes with service origin only for staging pipeline
if self._current_user['username'] == 'staging':
if self._current_user['username'] in ('staging.kernelci.org',
'production'):
if node['submitter'] != 'service:pipeline':
self.log.debug(f"Not sending node to KCIDB: {node['id']}")
continue
Expand Down
3 changes: 2 additions & 1 deletion src/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def _run_trigger(self, build_config, force, timeout, trees):
'timeout': checkout_timeout.isoformat(),
'treeid': treeid,
}
if self._current_user['username'] == 'staging':
if self._current_user['username'] in ('staging.kernelci.org',
'production'):
node['submitter'] = 'service:pipeline'
else:
node['submitter'] = f"user:{self._current_user['email']}"
Expand Down

0 comments on commit e44f391

Please sign in to comment.