Skip to content

Commit

Permalink
chore(release): 🔖 version 0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkomep committed Mar 7, 2024
2 parents 93dac8e + 23019d9 commit ef76f91
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 133 deletions.
2 changes: 1 addition & 1 deletion k8s/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version: 0.12.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.13.0
appVersion: 0.13.1

# Chart dependencies
dependencies:
Expand Down
9 changes: 7 additions & 2 deletions lifemonitor/api/models/repositories/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,13 @@ def remote_url(self) -> str:

@property
def owner(self) -> str:
onwer = super().owner
return onwer.login if onwer else None
owner = super().owner
return owner.login if owner else None

@property
def owner_id(self) -> int:
owner = super().owner
return owner.id if owner else None

@property
def license(self) -> Optional[str]:
Expand Down
4 changes: 4 additions & 0 deletions lifemonitor/api/models/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def get_registry_identifier(self, registry: WorkflowRegistry) -> str:
return identifier
return None

@hybrid_property
def earliest_version(self) -> WorkflowVersion:
return min(self.versions.values(), key=lambda v: v.created)

@hybrid_property
def latest_version(self) -> WorkflowVersion:
return max(self.versions.values(), key=lambda v: v.created)
Expand Down
17 changes: 10 additions & 7 deletions lifemonitor/integrations/github/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
from lifemonitor.api.models.testsuites.testinstance import TestInstance
from lifemonitor.api.models.wizards import QuestionStep, UpdateStep
from lifemonitor.api.models.workflows import WorkflowVersion
from lifemonitor.auth.models import User
from lifemonitor.auth.oauth2.client.models import OAuthIdentity
from lifemonitor.auth.services import authorized, current_user
from lifemonitor.auth.services import User, authorized, current_user
from lifemonitor.integrations.github import pull_requests
from lifemonitor.integrations.github.app import LifeMonitorGithubApp
from lifemonitor.integrations.github.events import (GithubEvent,
Expand Down Expand Up @@ -249,12 +247,17 @@ def __notify_workflow_version_event__(repo_reference: GithubRepositoryReference,
logger.debug("Notifications enabled: %r", notification_enabled)
if notification_enabled:
logger.debug(f"Setting notification for action '{action}' on repo '{repo.full_name}' (ref: {repo.ref})")
identity = OAuthIdentity.find_by_provider_user_id(str(repo.owner.id), "github")
if identity:
submitter = None
if isinstance(workflow_version, WorkflowVersion):
submitter = workflow_version.submitter
else:
sender = repo_reference.event.sender
submitter = sender.user if sender else None
if submitter:
version = workflow_version if isinstance(workflow_version, dict) else serializers.WorkflowVersionSchema(exclude=('meta', 'links')).dump(workflow_version)
repo_data = repo.raw_data
repo_data['ref'] = repo.ref
n = GithubWorkflowVersionNotification(workflow_version=version, repository=repo_data, action=action, users=[identity.user])
n = GithubWorkflowVersionNotification(workflow_version=version, repository=repo_data, action=action, users=[submitter])
n.save()
logger.debug(f"Setting notification for action '{action}' on repo '{repo.full_name}' (ref: {repo.ref})")
else:
Expand Down Expand Up @@ -834,7 +837,7 @@ def handle_event():
logger.debug(str(e))

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

Expand Down
6 changes: 5 additions & 1 deletion lifemonitor/integrations/github/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ def headers(self) -> dict:
return self._headers

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

@property
def sender_name(self) -> str:
return self._raw_data['sender']['login'] if 'sender' in self._raw_data else None

@property
def sender(self) -> OAuthIdentity:
if not self._sender:
Expand Down
260 changes: 141 additions & 119 deletions lifemonitor/integrations/github/services.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lifemonitor/static/src/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lifemonitor",
"description": "Workflow Testing Service",
"version": "0.13.0",
"version": "0.13.1",
"license": "MIT",
"author": "CRS4",
"main": "../dist/js/lifemonitor.min.js",
Expand Down
4 changes: 2 additions & 2 deletions specs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
openapi: "3.0.0"

info:
version: "0.13.0"
version: "0.13.1"
title: "Life Monitor API"
description: |
*Workflow sustainability service*
Expand All @@ -18,7 +18,7 @@ info:
servers:
- url: /
description: >
Version 0.13.0 of API.
Version 0.13.1 of API.
tags:
- name: GitHub Integration
Expand Down

0 comments on commit ef76f91

Please sign in to comment.