Skip to content

Commit

Permalink
Merge pull request #397 from kikkomep/fix/bug-fixes-0.14
Browse files Browse the repository at this point in the history
fix: minor bug fixes for version 0.14
  • Loading branch information
kikkomep authored Sep 2, 2024
2 parents 247c538 + 90932ef commit 47da14c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ worker:
- name: github
# image: *lifemonitorImage
# - name: heartbeat
# image: *lifemonitorImage
# image: *lifemonitorImage
- name: notifications
# image: *lifemonitorImage
- name: builds
# image: *lifemonitorImage
- name: workflows
# image: *lifemonitorImage
# - name: metrics
# image: *lifemonitorImage
# image: *lifemonitorImage
- name: ws
# image: *lifemonitorImage

Expand Down
4 changes: 3 additions & 1 deletion lifemonitor/api/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ def registry_user_workflows_get(user_id, status=False, versions=False):
workflows = lm.get_user_registry_workflows(identity.user, current_registry)
logger.debug("registry_user_workflows_get. Got %s workflows (user: %s)", len(workflows), current_user)
return serializers.ListOfWorkflows(workflow_status=status, workflow_versions=versions).dump(workflows)
except OAuthIdentityNotFoundException:
except OAuthIdentityNotFoundException as e:
if logger.isEnabledFor(logging.DEBUG):
logger.exception(e)
return lm_exceptions.report_problem(401, "Unauthorized",
detail=messages.no_user_oauth_identity_on_registry
.format(user_id, current_registry.name))
Expand Down
6 changes: 5 additions & 1 deletion lifemonitor/api/models/repositories/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ def registries(self) -> List[models.WorkflowRegistry]:
for rfs in self._get_refs_list():
for r in rfs.get("update_registries", []):
if not registries.get(r, None):
registries[r] = models.WorkflowRegistry.find_by_client_name(r)
r_model = models.WorkflowRegistry.find_by_client_name(r)
if r_model is None:
logger.warning("Unable to find registry: %r", r)
else:
registries[r] = r_model
return list(registries.values())

def get_ref_registries(self, ref_type: str, tag: str) -> List[models.WorkflowRegistry]:
Expand Down
3 changes: 2 additions & 1 deletion lifemonitor/api/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ def find_registry_user_identity(registry: models.WorkflowRegistry,
raise ValueError("external_id and internal_id cannot be both None")
if internal_id:
return OAuthIdentity.find_by_user_id(internal_id, registry.name)
return OAuthIdentity.find_by_provider_user_id(external_id, registry.name)
assert registry, "The registry should be defined"
return OAuthIdentity.find_by_provider_user_id(external_id, registry.client_name)

@staticmethod
def add_workflow_registry(type, name,
Expand Down

0 comments on commit 47da14c

Please sign in to comment.