Skip to content

Commit ef76f91

Browse files
committed
chore(release): 🔖 version 0.13.1
2 parents 93dac8e + 23019d9 commit ef76f91

File tree

8 files changed

+171
-133
lines changed

8 files changed

+171
-133
lines changed

k8s/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version: 0.12.0
1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to
1414
# follow Semantic Versioning. They should reflect the version the application is using.
15-
appVersion: 0.13.0
15+
appVersion: 0.13.1
1616

1717
# Chart dependencies
1818
dependencies:

lifemonitor/api/models/repositories/github.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ def remote_url(self) -> str:
206206

207207
@property
208208
def owner(self) -> str:
209-
onwer = super().owner
210-
return onwer.login if onwer else None
209+
owner = super().owner
210+
return owner.login if owner else None
211+
212+
@property
213+
def owner_id(self) -> int:
214+
owner = super().owner
215+
return owner.id if owner else None
211216

212217
@property
213218
def license(self) -> Optional[str]:

lifemonitor/api/models/workflows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def get_registry_identifier(self, registry: WorkflowRegistry) -> str:
8989
return identifier
9090
return None
9191

92+
@hybrid_property
93+
def earliest_version(self) -> WorkflowVersion:
94+
return min(self.versions.values(), key=lambda v: v.created)
95+
9296
@hybrid_property
9397
def latest_version(self) -> WorkflowVersion:
9498
return max(self.versions.values(), key=lambda v: v.created)

lifemonitor/integrations/github/controllers.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
from lifemonitor.api.models.testsuites.testinstance import TestInstance
4242
from lifemonitor.api.models.wizards import QuestionStep, UpdateStep
4343
from lifemonitor.api.models.workflows import WorkflowVersion
44-
from lifemonitor.auth.models import User
45-
from lifemonitor.auth.oauth2.client.models import OAuthIdentity
46-
from lifemonitor.auth.services import authorized, current_user
44+
from lifemonitor.auth.services import User, authorized, current_user
4745
from lifemonitor.integrations.github import pull_requests
4846
from lifemonitor.integrations.github.app import LifeMonitorGithubApp
4947
from lifemonitor.integrations.github.events import (GithubEvent,
@@ -249,12 +247,17 @@ def __notify_workflow_version_event__(repo_reference: GithubRepositoryReference,
249247
logger.debug("Notifications enabled: %r", notification_enabled)
250248
if notification_enabled:
251249
logger.debug(f"Setting notification for action '{action}' on repo '{repo.full_name}' (ref: {repo.ref})")
252-
identity = OAuthIdentity.find_by_provider_user_id(str(repo.owner.id), "github")
253-
if identity:
250+
submitter = None
251+
if isinstance(workflow_version, WorkflowVersion):
252+
submitter = workflow_version.submitter
253+
else:
254+
sender = repo_reference.event.sender
255+
submitter = sender.user if sender else None
256+
if submitter:
254257
version = workflow_version if isinstance(workflow_version, dict) else serializers.WorkflowVersionSchema(exclude=('meta', 'links')).dump(workflow_version)
255258
repo_data = repo.raw_data
256259
repo_data['ref'] = repo.ref
257-
n = GithubWorkflowVersionNotification(workflow_version=version, repository=repo_data, action=action, users=[identity.user])
260+
n = GithubWorkflowVersionNotification(workflow_version=version, repository=repo_data, action=action, users=[submitter])
258261
n.save()
259262
logger.debug(f"Setting notification for action '{action}' on repo '{repo.full_name}' (ref: {repo.ref})")
260263
else:
@@ -834,7 +837,7 @@ def handle_event():
834837
logger.debug(str(e))
835838

836839
# check the author of the current pull_request
837-
if event.pusher == event.application.bot:
840+
if event.pusher_name == event.application.bot:
838841
logger.debug("Nothing to do: commit pushed by LifeMonitor[Bot]")
839842
return f"Push created by {event.application.bot}", 204
840843

lifemonitor/integrations/github/events.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@ def headers(self) -> dict:
9595
return self._headers
9696

9797
@property
98-
def pusher(self) -> str:
98+
def pusher_name(self) -> str:
9999
return self._raw_data['pusher']['name'] if 'pusher' in self._raw_data else None
100100

101+
@property
102+
def sender_name(self) -> str:
103+
return self._raw_data['sender']['login'] if 'sender' in self._raw_data else None
104+
101105
@property
102106
def sender(self) -> OAuthIdentity:
103107
if not self._sender:

lifemonitor/integrations/github/services.py

Lines changed: 141 additions & 119 deletions
Large diffs are not rendered by default.

lifemonitor/static/src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lifemonitor",
33
"description": "Workflow Testing Service",
4-
"version": "0.13.0",
4+
"version": "0.13.1",
55
"license": "MIT",
66
"author": "CRS4",
77
"main": "../dist/js/lifemonitor.min.js",

specs/api.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
openapi: "3.0.0"
44

55
info:
6-
version: "0.13.0"
6+
version: "0.13.1"
77
title: "Life Monitor API"
88
description: |
99
*Workflow sustainability service*
@@ -18,7 +18,7 @@ info:
1818
servers:
1919
- url: /
2020
description: >
21-
Version 0.13.0 of API.
21+
Version 0.13.1 of API.
2222
2323
tags:
2424
- name: GitHub Integration

0 commit comments

Comments
 (0)