-
Notifications
You must be signed in to change notification settings - Fork 10
GitHub User Experience Enahncement #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmsunseri
wants to merge
31
commits into
coredevices:main
Choose a base branch
from
jmsunseri:github-performance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c5c84f2
P0: Move wipe-and-replace into atomic transaction for github pull
jmsunseri c968a01
Re-enable test_import_archive and add wipe_existing tests
jmsunseri 02f8583
P1: Parallelize zip download and refactor github_pull into testable h…
jmsunseri 6c46500
P2: Incremental delta sync with force fallback
jmsunseri 10e559c
P2: Show last sync time in GitHub pane and pull result alerts
jmsunseri 3491eea
Add libpng-dev to qemu builder stage for sdl2-decoration.c
jmsunseri e7a45e3
SSE: Real-time GitHub pull and build notifications, auto-pull mode se…
jmsunseri f9cf057
Restore GITHUB_ID/GITHUB_SECRET env vars in docker-compose
jmsunseri 13c7b9a
Merge remote-tracking branch 'coredevices/main' into github-performance
jmsunseri e4a9e96
Add .env.local to .gitignore
jmsunseri ac3ffdd
Add spin animation to refresh icon
jmsunseri 7ab01ef
Extract SSE event handlers and add tests
jmsunseri cdee40e
Remove sse-events.js and update tests to use sse.js
jmsunseri 067a35d
Overhaul GitHub pull UX and add ngrok webhook support
jmsunseri c9dd4e9
Refresh sidebar on GitHub pull instead of page reload
jmsunseri 5c7c022
Fix resource validation for package.json and subdirs
jmsunseri 7d0383d
Strip root directory from delta change paths
jmsunseri 4ea04d3
Fix existing resources dict keying
jmsunseri aaf70bc
Fix project.save() indentation
jmsunseri 916aa53
Use media map to set resource kind on sync
jmsunseri fbae7af
Skip auto-build when GitHub pull has no changes
jmsunseri b66e2e8
Remove unused ThreadPoolExecutor import
jmsunseri 2252cb9
Clear pending timer on ShowPending
jmsunseri 6499608
Remove force wrapper disabled class toggling
jmsunseri a5ace9f
Use github_last_sync in pull complete event
jmsunseri a2c69e1
Remove unused manifest_content variable
jmsunseri 40a8dbd
Handle Redis errors in publish_event
jmsunseri c7500a6
Add _parse_bool helper for POST bool parsing
jmsunseri e2c25d6
Fix GetUnsavedFiles restore in Sidebar.Refresh
jmsunseri 264ebb3
Reload active editor after sidebar refresh
jmsunseri d62d08f
Make github SHA update atomic with file changes
jmsunseri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .env | ||
| .env.local | ||
| .playwright-mcp/ | ||
| CLAUDE.md | ||
| SECURITYPLAN.md | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ src/ | |
| .env/ | ||
| .idea/ | ||
| bower_components | ||
| node_modules/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import json | ||
| import logging | ||
|
|
||
| from django.contrib.auth.decorators import login_required | ||
| from django.http import StreamingHttpResponse | ||
| from django.views.decorators.http import require_GET | ||
|
|
||
| from utils.redis_helper import redis_client | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class SSEEventStream: | ||
| def __init__(self, project_id): | ||
| self.channel = 'project_events:{}'.format(project_id) | ||
| self.pubsub = redis_client.pubsub() | ||
| self.pubsub.subscribe(self.channel) | ||
|
|
||
| def __iter__(self): | ||
| try: | ||
| for message in self.pubsub.listen(): | ||
| if message['type'] == 'message': | ||
| data = message['data'] | ||
| if isinstance(data, bytes): | ||
| data = data.decode('utf-8') | ||
| parsed = json.loads(data) | ||
| event_type = parsed.pop('type', 'message') | ||
| yield 'event: {}\ndata: {}\n\n'.format(event_type, json.dumps(parsed)) | ||
| except GeneratorExit: | ||
| pass | ||
| finally: | ||
| try: | ||
| self.pubsub.unsubscribe(self.channel) | ||
| self.pubsub.close() | ||
| except Exception: | ||
| pass | ||
|
|
||
|
|
||
| @login_required | ||
| @require_GET | ||
| def project_events(request, project_id): | ||
| from ide.models.project import Project | ||
| project = Project.objects.filter(pk=project_id, owner=request.user) | ||
| if not project.exists(): | ||
| from django.http import HttpResponseNotFound | ||
| return HttpResponseNotFound() | ||
|
|
||
| response = StreamingHttpResponse( | ||
| SSEEventStream(project_id), | ||
| content_type='text/event-stream', | ||
| ) | ||
| response['Cache-Control'] = 'no-cache' | ||
| response['X-Accel-Buffering'] = 'no' | ||
| return response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('ide', '0012_env_vars'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='project', | ||
| name='github_hook_force', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fixed now