Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v5

- name: setup ruff
uses: astral-sh/ruff-action@v3

- name: check
run: ruff check --output-format=github .

- name: format
run: ruff format
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ipython_config.py
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock
uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
Expand Down
10 changes: 6 additions & 4 deletions eye/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import logging
from pathlib import Path

from textual.app import App
from textual.reactive import reactive

from eye.main import RUON
from pathlib import Path
import logging
from eye.views.user_screen import UserScreen
from eye.views.chatbot_screen import ChatBotScreen
from eye.views.object_screen import ObjectScreen
from eye.views.user_screen import UserScreen
from eye.widgets.status import ConnectionStatus
from eye.views.chatbot_screen import ChatBotScreen

# Create loggers

Expand Down
5 changes: 3 additions & 2 deletions eye/llm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import List, Dict
import logging
import os
from typing import Dict, List

import aiohttp
import logging

logger = logging.getLogger(__name__)

Expand Down
65 changes: 23 additions & 42 deletions eye/main.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
from dotenv import dotenv_values
import logging
import time

import pandas as pd
from cosmotech_api import ApiClient, Configuration
from cosmotech_api.api.organization_api import OrganizationApi
from cosmotech_api.api.run_api import RunApi
from cosmotech_api.api.runner_api import RunnerApi
from cosmotech_api.api.solution_api import SolutionApi
from cosmotech_api.api.workspace_api import WorkspaceApi
from cosmotech_api.api.runner_api import RunnerApi
from cosmotech_api.api.run_api import RunApi
from cosmotech_api import ApiClient, Configuration
from cosmotech_api.api.organization_api import OrganizationApi
from cosmotech_api.models.organization import Organization
from cosmotech_api.models.organization_security import OrganizationSecurity
from cosmotech_api.models.organization_access_control import OrganizationAccessControl
from cosmotech_api.models.organization_create_request import OrganizationCreateRequest
from dotenv import dotenv_values
from keycloak import KeycloakOpenID
from rich.tree import Tree
from rich.console import Console
from rich.logging import RichHandler
import pandas as pd
import time
import logging
from rich.tree import Tree

# feature flag
refactored = False
Expand All @@ -33,7 +29,7 @@

class RUON:
def __init__(self):
logger.info(f"[bold blue]Initializing RUON[/]")
logger.info("[bold blue]Initializing RUON[/]")
start_time = time.time()

try:
Expand Down Expand Up @@ -92,15 +88,10 @@ def load_token(self):

def update_organizations(self):
try:
if refactored:
self.organizations = self.organization_api_instance.list_organizations()
else:
self.organizations = (
self.organization_api_instance.find_all_organizations()
)
self.organizations = self.organization_api_instance.list_organizations()
except Exception as e:
raise RuntimeError(f"Error getting organizations {e}")
logger.error(f"error {e}")
raise RuntimeError(f"Error getting organizations {e}")
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is logged and then immediately re-raised as a RuntimeError. This creates duplicate error information and the original exception context is lost. Consider either logging or raising, not both, or use raise ... from e to preserve the exception chain.

Suggested change
raise RuntimeError(f"Error getting organizations {e}")
raise RuntimeError(f"Error getting organizations {e}") from e

Copilot uses AI. Check for mistakes.

def get_organization_list(self):
return [organization.id for organization in self.organizations]
Expand All @@ -122,16 +113,16 @@ def get_runner_list(self, organization_id, workspace_id):

def update_solutions(self, organization_id):
try:
self.solutions[organization_id] = (
self.solution_api_instance.find_all_solutions(organization_id)
self.solutions[organization_id] = self.solution_api_instance.list_solutions(
organization_id
)
except Exception as e:
print(f"error {e}")

def update_workspaces(self, organization_id):
try:
self.workspaces[organization_id] = (
self.workspace_api_instance.find_all_workspaces(organization_id)
self.workspace_api_instance.list_workspaces(organization_id)
)
except Exception as e:
print(f"error {e}")
Expand All @@ -146,18 +137,11 @@ def update_runners(self, organization_id, workspace_id):

def update_runs(self, organization_id, workspace_id, runner_id):
try:
if refactored:
self.runs[organization_id, workspace_id, runner_id] = (
self.run_api_instance.find_all_runs(
organization_id, workspace_id, runner_id
)
)
else:
self.runs[organization_id, workspace_id, runner_id] = (
self.run_api_instance.list_runs(
organization_id, workspace_id, runner_id
)
self.runs[organization_id, workspace_id, runner_id] = (
self.run_api_instance.list_runs(
organization_id, workspace_id, runner_id
)
)
except Exception as e:
print(f"error {e}")

Expand Down Expand Up @@ -209,13 +193,10 @@ def update_summary_data(self):
self.update_runners(organization.id, workspace.id)

def create_organization(self, organization):
if refactored:
logger.warning("Not implemented yet")
else:
try:
self.organization_api_instance.register_organization(organization)
except Exception as e:
logger.error(f"kati pige strava {e}")
try:
self.organization_api_instance.register_organization(organization)
except Exception as e:
logger.error(f"kati pige strava {e}")

def delete_organization(self, organization_id):
try:
Expand Down
13 changes: 7 additions & 6 deletions eye/views/chatbot_screen.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from textual.screen import Screen
from textual.widgets import Input, Markdown, Header, Footer
from textual.containers import Container, VerticalScroll
from textual import on, work
from textual import events
import logging
import os

from textual import events, on, work
from textual.containers import Container, VerticalScroll
from textual.screen import Screen
from textual.widgets import Footer, Header, Input, Markdown

from ..llm import ChatAPI

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -50,7 +51,7 @@ def handle_input(self, event: Input.Submitted) -> None:
async def get_bot_response(self, message: str) -> None:
"""Worker to get bot response asynchronously"""
try:
response = await self.chat_api.send_message(message)
await self.chat_api.send_message(message)
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response from send_message is being ignored but the method name suggests it should return a response. This could lead to incomplete functionality if the response is needed elsewhere.

Copilot uses AI. Check for mistakes.
self.update_chat_display()
except Exception as e:
logger.error(f"Error getting bot response: {e}")
Expand Down
3 changes: 2 additions & 1 deletion eye/views/object_explore_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from textual.containers import Horizontal
from textual import on
from textual.containers import Horizontal
from textual.widget import Widget

from eye.views.object_tree_widget import ObjectTreeWidget
from eye.views.object_viewer_widget import ObjectViewerWidget

Expand Down
6 changes: 4 additions & 2 deletions eye/views/object_screen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from textual.screen import Screen
from textual.widgets import Header, Footer
import logging

from textual.screen import Screen
from textual.widgets import Footer, Header

from eye.views.object_explore_widget import ObjectExplorerWidget

logger = logging.getLogger("back.front")
Expand Down
6 changes: 3 additions & 3 deletions eye/views/object_tree_widget.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from textual.widgets import Tree
from textual.notifications import Notify
import logging

from cosmotech_api.models.organization import Organization
from cosmotech_api.models.workspace import Workspace
import logging
from textual.widgets import Tree

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion eye/views/object_viewer_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from textual.widgets import Pretty
from textual.containers import ScrollableContainer
from textual.widget import Widget
from textual.widgets import Pretty


class ObjectViewerWidget(Widget):
Expand Down
4 changes: 2 additions & 2 deletions eye/views/organization_widget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from textual import on
from textual.message import Message
from textual.widgets import OptionList
from textual.widgets.option_list import Option
from textual.message import Message
from textual import on


class OrganizationWidget(OptionList):
Expand Down
10 changes: 6 additions & 4 deletions eye/views/user_screen.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from textual.screen import Screen
from textual.widgets import Header, Footer
from textual.containers import Horizontal, Vertical, Container
import logging

from textual.containers import Container, Horizontal, Vertical
from textual.screen import Screen
from textual.widgets import Footer, Header

from eye.views.users_widget import UsersWidget
from eye.widgets.status import ConnectionStatus
from eye.widgets.config_label import ConfigLabel
from eye.widgets.status import ConnectionStatus

logger = logging.getLogger("back.front")

Expand Down
2 changes: 1 addition & 1 deletion eye/views/users_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from textual import on
from textual.containers import Horizontal
from textual.widget import Widget
from textual import on

from eye.views.organization_widget import OrganizationWidget
from eye.views.security_widget import SecurityWidget
Expand Down
2 changes: 1 addition & 1 deletion eye/widgets/status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.widgets import Static
from textual.reactive import reactive
from textual.widgets import Static


class ConnectionStatus(Static):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "eye"
version = "0.6.0"
version = "0.7.0"
description = "A sample Python project"
authors = [{name = "Diamantis Sellis", email = "diamantis.sellis@cosmotech.com"}]
license = { text = "MIT" }
dependencies = [
"cosmotech-api @ git+https://github.com/Cosmo-Tech/cosmotech-api-python-client.git",
"cosmotech-api==5.0.0b5",
"pytest>=8.3.4",
"ruff>=0.8.4",
"python-keycloak~=5.1.1",
Expand Down