-
-
Notifications
You must be signed in to change notification settings - Fork 186
feat(share): add sharing using magic-wormhole #223
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
Merged
Mustaballer
merged 81 commits into
OpenAdaptAI:main
from
Mustaballer:share-magic-wormhole
Dec 12, 2023
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
8c0a78d
Copy from closed PR magic wormhole working code and test cases
Mustaballer b4b7879
Merge branch 'main' into share-magic-wormhole
Mustaballer 395fa00
Merge branch 'main' into share-magic-wormhole
Mustaballer 5fbdc1a
Merge remote-tracking branch 'upstream/main' into share-magic-wormhole
Mustaballer 0a0208e
Merge branch 'share-magic-wormhole' of https://github.com/Mustaballer…
Mustaballer 9dc1850
modify export_sql to use paramerterized queries to prevent sql injection
Mustaballer 53f11f5
try resolve merge conflict with poetry.lock
Mustaballer 0977859
Merge branch 'main' into share-magic-wormhole
Mustaballer cbee5e8
fix merge conflict and use better approach for overwriting env
Mustaballer 9819330
Remove unnecessary function and pass test cases
Mustaballer afd9810
reformat file and group constants together in config.py
Mustaballer 2211f78
ran black
Mustaballer f58fd5f
ran black
Mustaballer dafca05
moved functions in crud.py to db.py
Mustaballer 3434a00
use tempfile in test_share.py and address minor changes
Mustaballer b801caf
restore original db name instead of literal
Mustaballer 4c59c10
ran black -l 60, and it used call chain
Mustaballer 088f370
Merge branch 'main' into share-magic-wormhole
0dm 1096a15
Merge branch 'main' into share-magic-wormhole
Mustaballer 01eef24
Add exception handling when ctrl+c during sharing that deletes db and…
Mustaballer 5e52b5c
ran black and update poetry.lock
Mustaballer 8317634
Add missing docstring in db.py
Mustaballer e675227
delete temp .env if ctrl+c during sharing
Mustaballer 04c69b8
merge with latest main
Mustaballer 2d54e83
Add .env.example and generate env in config.py
Mustaballer 3992d1c
use .env.example for creating .env and removed unnecessary exceptions
Mustaballer d4d3f1c
Merge branch 'main' into share-magic-wormhole
Mustaballer 2f2c0dd
use new approach for copying db
Mustaballer 7a67386
Merge branch 'share-magic-wormhole' of https://github.com/Mustaballer…
Mustaballer 6196876
modify copy deb function to return recording data and remov comments …
Mustaballer 5893b3e
modify env names and add asserts to share.py
Mustaballer 2149adc
copy alembic migrations
Mustaballer 2f1548d
Copy all data relating to recording_timestamp in all tables
Mustaballer 625c192
extract db file upon receiving recording
Mustaballer 18a4918
add command to visualize recording
Mustaballer 9b7f7af
remove unnecessary function and todo comment
Mustaballer 786e063
refactor copy_recording_data
Mustaballer 644c83a
remove unittest class and fix failing test case for receiving recordi…
Mustaballer 653e785
modify conftest.py and fixtures.sql to insert data to every table for…
Mustaballer 76f14b0
update unit tests
Mustaballer ada2aad
Merge branch 'main' into share-magic-wormhole
Mustaballer 2f66b8a
resolve merge conflicts
Mustaballer f29f199
address flake8 errors
Mustaballer 1a10f8a
Merge branch 'main' into share-magic-wormhole
Mustaballer c3173f8
resolve merge issues
Mustaballer ea25b53
Update openadapt/share.py
Mustaballer 0123aae
resolve https://github.com/OpenAdaptAI/OpenAdapt/issues/441
Mustaballer 7d0d343
add type annotation
Mustaballer b6cce11
Merge branch 'share-magic-wormhole' of https://github.com/Mustaballer…
Mustaballer d9eefa0
run black --preview and modify main.yml to check black --preview
Mustaballer 961130b
remove unused import
Mustaballer 5fd9868
Add timestamp to exported recording db files and update unit tests
Mustaballer 453d2c2
Merge branch 'main' into share-magic-wormhole
Mustaballer 4d66584
update poetry.lock
Mustaballer 75b324d
Merge branch 'main' into share-magic-wormhole
Mustaballer dc5f2b6
fix: enhance publish action and authors in pyproject.toml
Mustaballer ebea2cb
modify release-and-publish.yml
Mustaballer c77f339
change author name to OpenAdapt.AI Team
Mustaballer 8b1299d
Merge remote-tracking branch 'upstream/enhance-publishing' into share…
Mustaballer 09dd4d6
test publish to test pypi
Mustaballer 8ea0ee4
fix poetry conflicts and conflicting files
Mustaballer 1b2eef3
Merge branch 'main' into share-magic-wormhole
Mustaballer 0e8d620
resolve merge conflicts and linting errors from recent merge
Mustaballer 5b9bbe0
Merge branch 'main' into share-magic-wormhole
Mustaballer 24a3e79
Merge branch 'main' into share-magic-wormhole
Mustaballer a03bd59
update poetry.lock file and some formatting
Mustaballer a94c303
fix wormhole sharing
Mustaballer ca04296
Merge remote-tracking branch 'upstream/main' into share-magic-wormhole
Mustaballer 61553f0
poetry lock
abrichr 22b5f0c
fix failing tests
abrichr 00c79cf
Merge branch 'main' into share-magic-wormhole
abrichr 21340b2
poetry lock
abrichr 0edcd88
add spacy-curated-transformers
abrichr 1367cb9
remove custom visualize function
Mustaballer 54a954f
change logging.py name to resolve naming conflict with logger library
Mustaballer 9682209
Merge branch 'main' into share-magic-wormhole
Mustaballer 6651f2c
Restore `export_recording` import with lint ignore comment
Mustaballer 117694b
Merge branch 'share-magic-wormhole' of https://github.com/Mustaballer…
Mustaballer bf9e8bf
Merge branch 'main' into share-magic-wormhole
Mustaballer 39b334e
Update openadapt/config.py
Mustaballer b79f3b5
Update openadapt/config.py
Mustaballer 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OPENAI_API_KEY=<set your api key> | ||
DB_FNAME=openadapt.db |
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,43 @@ | ||
"""Module for log message filtering, excluding strings & limiting warnings.""" | ||
|
||
from collections import defaultdict | ||
import time | ||
|
||
from openadapt import config | ||
|
||
MESSAGE_TIMESTAMPS = defaultdict(list) | ||
|
||
# TODO: move utils.configure_logging to here | ||
|
||
|
||
def filter_log_messages(data: dict) -> bool: | ||
"""Filter log messages based on the defined criteria. | ||
|
||
Args: | ||
data: The log message data from a loguru logger. | ||
|
||
Returns: | ||
bool: True if the log message should not be ignored, False otherwise. | ||
""" | ||
# TODO: ultimately, we want to fix the underlying issues, but for now, | ||
# we can ignore these messages | ||
for msg in config.MESSAGES_TO_FILTER: | ||
if msg in data["message"]: | ||
if config.MAX_NUM_WARNINGS_PER_SECOND > 0: | ||
current_timestamp = time.time() | ||
MESSAGE_TIMESTAMPS[msg].append(current_timestamp) | ||
timestamps = MESSAGE_TIMESTAMPS[msg] | ||
|
||
# Remove timestamps older than 1 second | ||
timestamps = [ | ||
ts | ||
for ts in timestamps | ||
if current_timestamp - ts <= config.WARNING_SUPPRESSION_PERIOD | ||
] | ||
|
||
if len(timestamps) > config.MAX_NUM_WARNINGS_PER_SECOND: | ||
return False | ||
|
||
MESSAGE_TIMESTAMPS[msg] = timestamps | ||
|
||
return True |
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 +1,3 @@ | ||
"""Package for interacting with the OpenAdapt database.""" | ||
|
||
from .db import export_recording # noqa: F401 |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.