Skip to content

Build initial Argus webhook service with dashboard#3

Open
iefiru wants to merge 1 commit intomainfrom
initial-argus-pr
Open

Build initial Argus webhook service with dashboard#3
iefiru wants to merge 1 commit intomainfrom
initial-argus-pr

Conversation

@iefiru
Copy link
Copy Markdown
Collaborator

@iefiru iefiru commented Apr 30, 2026

Build initial Argus webhook service with dashboard

@iefiru iefiru requested a review from chestercheng April 30, 2026 15:23
@iefiru iefiru self-assigned this Apr 30, 2026
Copy link
Copy Markdown

@chestercheng chestercheng left a comment

Choose a reason for hiding this comment

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

I have a couple of concerns:

  • Can we add a docker-compose.yml for easier setup and testing? It would make it much easier to run and try this service.
  • There are quite a lot of tests, but many look very simple or repetitive. It makes review harder, maybe we can focus on more meaningful test cases.
  • Personally I prefer not to use type hints, since they add extra typing effort and don’t provide runtime checks.

Comment thread src/argus/kktix/report.py
)

return {
"content": f"📊 **Argus Daily Registration Summary** {now_str} (Asia/Taipei)",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we don't need to include now_str in the message content, Since Discord already shows a timestamp for each message.

Suggested change
"content": f"📊 **Argus Daily Registration Summary** {now_str} (Asia/Taipei)",
"content": f"📊 **Argus Daily Registration Summary**",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I'll remove it.

Comment on lines +25 to +28
# JSON-LD startDate field
_JSONLD_START_RE = re.compile(r'"startDate"\s*:\s*"([^"]+)"')
# fa-male icon followed by "current / total"
_CAPACITY_RE = re.compile(r'fa-male"></i>\s*\d+\s*/\s*(\d+)')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggest using TextFSM instead of regex here. It is easier to read and maintain.

Comment thread src/argus/__about__.py
@@ -0,0 +1 @@
__version__ = "0.1.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need a separate __about__.py?
Can we just put this in __init__.py to keep things simpler?

Comment thread src/argus/auth.py
def is_email_allowed(email: str) -> bool:
if not email:
return False
return email.lower() in {e.lower() for e in config.settings.allowed_emails}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure if we should keep the allowlist inside the app.
If we update it, we need to restart the service.

Comment thread src/argus/config.py
return cls(
webhook_secret=os.getenv("WEBHOOK_SECRET", ""),
google_oauth_client_id=os.getenv("GOOGLE_OAUTH_CLIENT_ID", ""),
google_oauth_client_secret=os.getenv("GOOGLE_OAUTH_CLIENT_SECRET", ""),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we really want to require OAuth for all environments?
This makes local development hard. Can we make it optional?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Provide 2 env example, 1 for development (disable oauth), one for production (MUST enable oauth).

Comment thread Dockerfile

RUN pip install --no-cache-dir .

CMD ["argus"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using uvicorn argus.main:app in Docker might give us more flexibility (e.g. configuring workers, reload, etc).

Comment thread pyproject.toml
"httpx",
]

[build-system]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we really need to package this as a Python project?
This is a service not a library. Maybe we can keep pyproject.toml simpler.

Comment thread railway.json
@@ -0,0 +1,9 @@
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I’m not familiar with railway.json. What is this used for in this project?

Comment thread requirements.txt
@@ -0,0 +1,8 @@
fastapi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since we already use pyproject.toml, I think we can remove requirements.txt to avoid duplication.

Comment thread LICENSE.txt
@@ -0,0 +1 @@

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is empty, do you plan to add a license, or should we remove it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants