Skip to content

Ai research#7

Open
rodas-yg wants to merge 7 commits into
mainfrom
ai-research
Open

Ai research#7
rodas-yg wants to merge 7 commits into
mainfrom
ai-research

Conversation

@rodas-yg
Copy link
Copy Markdown
Member

No description provided.

I got the calendar file uncooked
Copilot AI review requested due to automatic review settings April 18, 2026 18:52
@rodas-yg
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

1 similar comment
@rodas-yg
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: rodas-yg <207317571+rodas-yg@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflict in frontend/src/router/index.js. The conflict was in the imports section — kept the Profile component import (needed for the /profile route) and removed the unused useAuthStore and getProfile imports that weren't present in main. Committed in bcb2233.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Google Calendar integration surface to the app (UI + backend OAuth callback persistence) and introduces an ML classifier artifact for “AI research” work.

Changes:

  • Frontend: adds an “Integrations” card in Profile and a /profile route, displaying whether Google Calendar is connected and providing a connect CTA.
  • Backend: secures calendar_callback behind authentication and persists the exchanged Google token dict onto the user profile; exposes has_calendar_connected in the profile serializer.
  • Repo ops: adds backend/.dockerignore and commits a serialized sklearn .joblib model artifact plus a standalone auth script.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/views/Profile.vue Adds calendar connection UI and binds to has_calendar_connected from profile data.
frontend/src/router/index.js Adds /profile route for the new Profile view.
backend/api/views.py Requires auth for OAuth callback and saves token dict to UserProfile.
backend/api/services/calendar_api.py Relaxes oauthlib scope matching during code exchange.
backend/api/serializers.py Adds has_calendar_connected computed field to profile serializer.
backend/test_auth.py Adds a script that generates/prints an authorization URL (currently named like a test).
backend/ml_models/item_classifier.joblib Adds a pickled sklearn pipeline artifact to the repo.
backend/.dockerignore Adds ignores for common Python virtualenv/cache artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to +45
# Google auto-adds openid/profile scopes. We must relax oauthlib strict matching.
os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = '1'
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

Setting OAUTHLIB_RELAX_TOKEN_SCOPE inside exchange_code() mutates global process environment on each call. Prefer setting this once at process startup (settings/env), or at least use os.environ.setdefault(...) so you don’t unexpectedly override an operator-provided value.

Copilot uses AI. Check for mistakes.
Comment thread backend/test_auth.py
Comment on lines +3 to +7
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bigredmacro.settings")
django.setup()
from api.services.calendar_api import get_authorization_url
url, state, verifier = get_authorization_url("http://localhost:5173/calendar-callback")
print(f"URL: {url}")
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

This file is named like a test (test_auth.py) but executes Django setup and prints a URL at import time. Test runners (e.g., pytest) will collect/import it, causing side effects and potentially failing CI; move this to a scripts/ module and/or wrap execution in if __name__ == "__main__": (and consider removing from the repo if it’s only for local debugging).

Suggested change
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bigredmacro.settings")
django.setup()
from api.services.calendar_api import get_authorization_url
url, state, verifier = get_authorization_url("http://localhost:5173/calendar-callback")
print(f"URL: {url}")
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bigredmacro.settings")
django.setup()
from api.services.calendar_api import get_authorization_url
url, state, verifier = get_authorization_url("http://localhost:5173/calendar-callback")
print(f"URL: {url}")
if __name__ == "__main__":
main()

Copilot uses AI. Check for mistakes.
Comment thread backend/api/views.py
Comment thread backend/api/views.py Outdated
Comment thread backend/api/views.py Outdated
Comment on lines +233 to +243
profile = UserProfile.objects(django_user_id=request.user.id).first()
if profile:
profile.google_auth_token = token_dict
profile.save()
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The PKCE verifier is read from cache but never removed after a successful token exchange. Consider deleting pkce_{state} from cache once used to reduce replay risk and avoid stale entries accumulating until timeout.

Copilot uses AI. Check for mistakes.
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.

4 participants