Skip to content

Commit

Permalink
trigger.py: Check latest commit nodes owned by token owner
Browse files Browse the repository at this point in the history
We might have several different instances, and owners should not interfere
with each other.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Dec 20, 2023
1 parent da52a66 commit 3ff83ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ class Trigger(Service):
def __init__(self, configs, args):
super().__init__(configs, args, 'trigger')
self._build_configs = configs['build_configs']
self._current_user = self._api.whoami()

def _log_revision(self, message, build_config, head_commit):
self.log.info(f"{message:32s} {build_config.name:32s} {head_commit}")

def _run_trigger(self, build_config, force, timeout):
head_commit = kernelci.build.get_branch_head(build_config)

node_count = self._api.count_nodes({
"revision.commit": head_commit,
"owner": self._current_user['username'],
})

if node_count > 0:
Expand Down

0 comments on commit 3ff83ae

Please sign in to comment.