repo_name
stringlengths
1
62
dataset
stringclasses
1 value
lang
stringclasses
11 values
pr_id
int64
1
20.1k
owner
stringlengths
2
34
reviewer
stringlengths
2
39
diff_hunk
stringlengths
15
262k
code_review_comment
stringlengths
1
99.6k
riven
github_2023
python
224
rivenmedia
Gaisberg
@@ -1,46 +1,4 @@ -import threading -import time -from utils.logger import logger -from utils.service_manager import ServiceManager from .mdblist import Mdblist
these imports seem redundant
riven
github_2023
python
224
rivenmedia
Gaisberg
@@ -168,13 +159,14 @@ def set(self, key, value): class Movie(MediaItem): """Movie class""" - def __init__(self, item): + def __init__(self, item, parent_item_id: Optional[ItemId] = None):
a movie will never have a parent_item, is this just to avoid logic elsewhere?
riven
github_2023
python
224
rivenmedia
Gaisberg
@@ -24,47 +46,209 @@ def __init__(self, args): self.running = False self.startup_args = args logger.configure_logger( - debug=settings_manager.settings.debug, log=settings_manager.settings.log + debug=settings_manager.settings.debug, + log=settings_manag...
What about LibraryPartial?
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -10,6 +10,7 @@ class SymlinkConfig(BaseModel): host_path: Path container_path: Path + symlink_path: Path = None
why a 3rd path? The `container_path` is the path that plex sees. Here's an example, ![image](https://github.com/dreulavelle/iceberg/assets/5782630/f07cd5ed-de75-4f2b-870c-dc5d958c37f1) my paths are `/mnt/zurg` for host_path and `/mnt/zurg` for container_path since I set plex volume mount to `/mnt:/mnt` as we...
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -27,44 +28,38 @@ class Symlinker(): host_path (str): The absolute path of the host mount. symlink_path (str): The path where the symlinks will be created. """ - def __init__(self, _): + def __init__(self, *_): self.key = "symlink" self.settings = SymlinkConfig(**s...
returning back to parent so that Program handles. If we throw exception from symlink module, does Program throw exception? Hm, needs discussion
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -27,44 +28,38 @@ class Symlinker(): host_path (str): The absolute path of the host mount. symlink_path (str): The path where the symlinks will be created. """ - def __init__(self, _): + def __init__(self, *_): self.key = "symlink" self.settings = SymlinkConfig(**s...
I felt the same way as well, but Mini was having issues. Need to gather more info from @AyushSehrawat on what kind of issues exactly and **how** it was working for him before, if it even was? Was it playing on plex from the symlink path Mini? Does `/mount` exist? It's also possible that I need to understand how `os...
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -80,7 +75,8 @@ def validate(self): def create_initial_folders(self): """Create the initial library folders.""" try: - self.library_path = self.settings.host_path.parent / "library" + path = self.settings.symlink_path or self.settings.host_path.parent
Why 2 path variations?
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -27,44 +28,38 @@ class Symlinker(): host_path (str): The absolute path of the host mount. symlink_path (str): The path where the symlinks will be created. """ - def __init__(self, _): + def __init__(self, *_):
Hm, may not understand the need for the *args? Can you explain?
riven
github_2023
python
201
rivenmedia
dreulavelle
@@ -27,44 +28,38 @@ class Symlinker(): host_path (str): The absolute path of the host mount. symlink_path (str): The path where the symlinks will be created. """ - def __init__(self, _): + def __init__(self, *_): self.key = "symlink" self.settings = SymlinkConfig(**s...
I like the simplified approach. I may have went overboard on covering edge cases, to the point it just got messy lol.
riven
github_2023
others
201
rivenmedia
dreulavelle
@@ -0,0 +1,3 @@ +pytest +httpx +black
feel free to add these to the main reqs file. My goal is to get CI to run tests before images get built but have been waiting for more tests to get written. Backend code needs to get to a point where it isn't changed as often for certain modules. (core modules)
riven
github_2023
python
204
rivenmedia
dreulavelle
@@ -1,27 +1,23 @@ """ Orionoid scraper module """ from typing import Optional -from pydantic import BaseModel + from requests import ConnectTimeout from requests.exceptions import RequestException + from utils.logger import logger from utils.request import RateLimitExceeded, RateLimiter, get -from utils....
the `KEY_APP` ? Yes. This is specific to Iceberg in regards with Orionoid. Users still need an api key for Orionoid to authenticate.
riven
github_2023
python
204
rivenmedia
dreulavelle
@@ -1,26 +1,21 @@ """ Torrentio scraper module """ from typing import Optional -from pydantic import BaseModel + from requests import ConnectTimeout, ReadTimeout from requests.exceptions import RequestException + from utils.logger import logger from utils.request import RateLimitExceeded, get, RateLimiter...
I believe they were being used in fetching settings? So you could update one name instead of going through the module and replacing all the cases.. Also, it may be used elsewhere for logging purposes if I'm not mistaken
riven
github_2023
python
204
rivenmedia
dreulavelle
@@ -80,7 +70,7 @@ def validate(self): def create_initial_folders(self): """Create the initial library folders.""" try: - self.library_path = self.settings.host_path.parent / "library" + self.library_path = self.settings.container_path / "library"
renamed in #211
riven
github_2023
python
198
rivenmedia
dreulavelle
@@ -125,14 +125,14 @@ def chunks(lst, n): wanted_files = container if item.type == "episode" and any(item.number in parser.episodes_in_season(item.parent.number, episode["filename"]) for episode in container.values()): wanted_files = con...
keep these hidden for now
riven
github_2023
python
190
rivenmedia
Gaisberg
@@ -118,13 +116,7 @@ def chunks(lst, n): continue for containers in provider_list.values(): for container in containers: - wanted_files = {} - if item.type == "movie" and all(file["filesize"] > 200000 for file in co...
Remove the additional check
riven
github_2023
python
190
rivenmedia
dreulavelle
@@ -146,27 +138,39 @@ def _set_file_paths(self, item): self._handle_episode_paths(item) def _handle_movie_paths(self, item): - item.set("folder", item.active_stream.get("name")) - item.set("alternative_folder", item.active_stream.get("alternative_name")) - item.set("file", next(...
should do by size instead.. theres too many keywords we'd need to match.. better off cutting off anything under X filesize, which can be set by user. 100mb default.
riven
github_2023
python
139
rivenmedia
Gaisberg
@@ -67,29 +67,30 @@ def _scrape_item(self, item): logger.debug("Could not find streams for %s", item.log_string) def api_scrape(self, item): - """Wrapper for torrentio scrape method""" - query = "" - if item.type == "movie": - query = f"&t=movie&imdbid={item.imd...
This could be moved to parser __init__ to avoid duplication in parsers
riven
github_2023
python
139
rivenmedia
Gaisberg
@@ -3,14 +3,15 @@ from typing import List from pydantic import BaseModel from utils.settings import settings_manager +from thefuzz import fuzz class ParserConfig(BaseModel): language: List[str] include_4k: bool highest_quality: bool repack_proper: bool - dual_audio: bool # This sometime...
Remove these audio settings aswell
riven
github_2023
python
128
rivenmedia
Gaisberg
@@ -55,3 +56,13 @@ def _needs_new_scrape(self, item) -> bool: > scrape_time or item.scraped_times == 0 ) + def _check_for_title_match(self, item, string) -> bool:
whats this, its not being used?
riven
github_2023
python
128
rivenmedia
Gaisberg
@@ -35,7 +35,7 @@ def validate_settings(self) -> bool: try: url = f"{self.settings.url}/api/v2.0/server/config" response = get(url=url, retry_if_failed=False, timeout=60) - if response.is_ok: + if response.is_ok and response.data.api_key i...
None check first
riven
github_2023
others
109
rivenmedia
dreulavelle
@@ -15,6 +17,10 @@ "api_key": "", "update_interval": 80 }, + "jackett": { + "url": "",
thats weird.. this shouldnt be empty on the url.
riven
github_2023
others
109
rivenmedia
dreulavelle
@@ -2,8 +2,10 @@ "version": "0.3.0",
We need to be raising the version number on updates. Also, should have version number displayed in log during initialization
riven
github_2023
python
101
rivenmedia
Gaisberg
@@ -0,0 +1,99 @@ +""" Jackett scraper module """ +from datetime import datetime +from typing import Optional +from pydantic import BaseModel +from utils.logger import logger +from utils.request import get +from utils.settings import settings_manager +from utils.utils import parser +from requests.exceptions impo...
Needs improvement
riven
github_2023
python
101
rivenmedia
Gaisberg
@@ -0,0 +1,99 @@ +""" Jackett scraper module """ +from datetime import datetime +from typing import Optional +from pydantic import BaseModel +from utils.logger import logger +from utils.request import get +from utils.settings import settings_manager +from utils.utils import parser +from requests.exceptions impo...
Check imports
riven
github_2023
python
101
rivenmedia
Gaisberg
@@ -54,7 +54,7 @@ def run(self): def _get_items_from_plex_watchlist(self) -> list: """Fetch media from Plex watchlist""" - response_obj = get(self.watchlist_url, timeout=30) + response_obj = get(self.watchlist_url, timeout=60)
60 seconds to wait for an endpoint is quite long dont you think?
riven
github_2023
python
101
rivenmedia
Gaisberg
@@ -0,0 +1,53 @@ +from datetime import datetime
I Like this, however the the file name should correspond the class name.
riven
github_2023
others
86
rivenmedia
dreulavelle
@@ -0,0 +1,8 @@ +<script lang="ts"> + import type { PageData } from './$types'; + + export let data: PageData; +</script> + +<p>WIP</p> +<img src="https://c.tenor.com/x8v1oNUOmg4AAAAd/tenor.gif" alt="WIP" class="w-1/2 mx-auto">
Lets remove this before pushing to main. lol
riven
github_2023
python
78
rivenmedia
dreulavelle
@@ -20,9 +21,7 @@ def __init__(self, media_items: MediaItemContainer): self.class_settings = settings_manager.get(self.settings) self.last_scrape = 0 self.filters = self.class_settings["filter"] - self.minute_limiter = RateLimiter( - max_calls=60, period=60, raise_on_lim...
Looks like your fixing black's formatting
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -42,6 +42,8 @@ def run(self): new_items = [item for item in items if item not in self.media_items] container = self.updater.create_items(new_items) + for item in container: + item.set_requested_by("Mdblist")
item.set("requested_by", "mdblist") instead and remove the set_requested_by function
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -276,7 +281,7 @@ def __iadd__(self, other): return self def sort(self, by, reverse): - self.items.sort(key=lambda item: item.get(by), reverse=reverse) + self.items.sort(key=lambda item: item.get(by) if item is not None else None)
This will break stuff, we cant have None items anyway so you are doing something wrong
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -63,18 +63,22 @@ def _scrape_show(self, item: MediaItem): def _scrape_items(self, items: list): amount_scraped = 0 for item in items: - data = self.api_scrape(item) - log_string = item.title - if item.type == "season": - log_string = f"{ite...
Dont put this whole thing under try block, handle exceptions elsewhere
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -80,6 +80,7 @@ def _map_item_from_data(data, item_type): "aired_at": formatted_aired_at, "genres": getattr(data, "genres", None), "requested_at": datetime.now(), + "requested_by": getattr(data, 'requested_by', None),
Shouldnt be here...
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -39,25 +40,28 @@ def run(self): items = self._get_items_from_plex_watchlist() new_items = [item for item in items if item not in self.media_items] container = self.updater.create_items(new_items) + for item in container: + item.set_requested_by("Plex Watchlist") + ...
the guid attribute already includes tmdb and tvdb ids but this will do for now.
riven
github_2023
python
76
rivenmedia
Gaisberg
@@ -97,7 +99,10 @@ def to_extended_dict(self): if self.type == "season": dict["episodes"] = [episode.to_extended_dict() for episode in self.episodes] return dict - + + def set_requested_by(self, requested_by):
remove this
riven
github_2023
python
73
rivenmedia
Gaisberg
@@ -20,7 +20,10 @@ def __init__(self): "api_key": re.compile(r"(\'api_key\'\s*:\s*\')[^\']*\'", re.IGNORECASE), "token": re.compile(r"(\'token\'\s*:\s*\')[^\']*\'", re.IGNORECASE), "user": re.compile(r"(\'user\'\s*:\s*\')[^\']*\'", re.IGNORECASE), + "watchlist": re.c...
What are these two new lines?
riven
github_2023
others
44
rivenmedia
JustHereToBreakThings
@@ -4,13 +4,14 @@ LABEL org.label-schema.name="Iceberg" \ org.label-schema.description="Iceberg Debrid Downloader" \ org.label-schema.url="https://github.com/dreulavelle/iceberg" -RUN apk --update add python3 py3-pip nodejs npm bash && \ +RUN apk --update add python3 py3-pip nodejs npm bash shadow vim n...
Looks like we also add rclone, vim, and nano to the image as well.
riven
github_2023
others
28
rivenmedia
AyushSehrawat
@@ -44,11 +44,6 @@ services: - "4173:4173" volumes: - ./data:/iceberg/data - # healthcheck: - # test: ["CMD", "curl", "-f", "http://localhost:8080/"]
We can make healthcheck in api 😄
riven
github_2023
python
27
rivenmedia
AyushSehrawat
@@ -32,14 +32,12 @@ def _validate_settings(self): return response.ok except ConnectTimeout: return False - # response = json.loads(response.content) - # return response['response'] def update_items(self, media_items: MediaItemContainer): """Fetch media fr...
Probably make it from 1 second to 5 seconds (5000) ?
riven
github_2023
others
19
rivenmedia
Gaisberg
@@ -2,33 +2,69 @@ The idea behind this was to make a simple and functional rewrite of plex debrid that seemed to get a bit clustered. -Rewrite of plex_debrid project, limited functionality: -- Services include: plex, mdblist, torrentio and realdebrid +Rewrite of [plex_debrid](https://github.com/itsToggle/plex_debr...
Arent settings copied from default settings.json?
riven
github_2023
python
19
rivenmedia
Gaisberg
@@ -36,7 +36,7 @@ def lifespan(app: FastAPI): if __name__ == "__main__": try: - uvicorn.run("main:app", host="localhost", port=8080, reload=False) + uvicorn.run("main:app", host="0.0.0.0", port=8080, reload=False)
Will 0.0.0.0 resolve as localhost vai chrome?
riven
github_2023
python
19
rivenmedia
Gaisberg
@@ -88,6 +88,10 @@ def _validate_modules(self): return False def __import_modules(self, folder_path: str) -> list[object]: + if os.path.exists('/iceberg'):
Why is this needed?
riven
github_2023
python
13
rivenmedia
Gaisberg
@@ -11,3 +14,15 @@ async def root(request: Request): "success": True, "message": "Iceburg is running!", } + + +@router.get("/user") +async def get_rd_user(): + api_key = settings_manager.get("realdebrid")["api_key"]
this should be in realdebrid.py
riven
github_2023
python
13
rivenmedia
Gaisberg
@@ -40,7 +40,7 @@ def __init__(self, item): self.imdb_link = f"https://www.imdb.com/title/{self.imdb_id}/" self.aired_at = item.get("aired_at", None) self.genres = item.get("genres", []) - self.state = MediaItemState.UNKNOWN + # self.state = MediaItemState.UNKNOWN
remove this if your going to comment it out
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -0,0 +1,34 @@ +from copy import copy +from fastapi import APIRouter, HTTPException, Request +from program.media import MediaItemState + + +items_router = APIRouter(
Just name it router and import as items_router, it's conventional way i guess.
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -0,0 +1,34 @@ +from copy import copy +from fastapi import APIRouter, HTTPException, Request +from program.media import MediaItemState + + +items_router = APIRouter( + tags=["items"], + responses={404: {"description": "Not found"}}, +) + +@items_router.get("/items") +async def get_items(request: Request, state:...
Optional but maybe use `.remove` method here
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -0,0 +1,38 @@ +from copy import copy +from fastapi import APIRouter +from utils.settings import settings_manager +from pydantic import BaseModel + + +class SetSettings(BaseModel): + key: str + value: str + + +settings_router = APIRouter( + tags=["settings"], + responses={404: {"description": "Not found"}...
return some kind of json response from api to show success!
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -5,12 +5,14 @@ from fastapi.middleware.cors import CORSMiddleware from program.program import Program from utils.thread import ThreadRunner -from controllers.controller import router as program_router, PlexController, ContentController, SettingsController +from controllers.controller import PlexController, Conten...
remove since it's not implemented
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -19,23 +21,21 @@ allow_headers=["*"], ) -# Include the main router -app.include_router(program_router) - -# Create an instance of your Program class program = Program() - -# Attach the program instance to the FastAPI app -app.state.program = program - -# Include the routers for PlexController, ContentContro...
Remove these since not implemented
riven
github_2023
python
8
rivenmedia
AyushSehrawat
@@ -19,23 +21,21 @@ allow_headers=["*"], ) -# Include the main router -app.include_router(program_router) - -# Create an instance of your Program class program = Program() - -# Attach the program instance to the FastAPI app -app.state.program = program - -# Include the routers for PlexController, ContentContro...
Use lifespan events so runner closes and starts only once with app and works nicely with reload
riven
github_2023
python
5
rivenmedia
dreulavelle
@@ -15,9 +17,25 @@ class Debrid: # TODO CHECK TORRENTS LIST BEFORE DOWNLOAD, IF DOWNLOADED AND NOT """Real-Debrid API Wrapper""" def __init__(self): - self.settings = settings_manager.get("debrid_realdebrid") - self.auth_headers = {"Authorization": f'Bearer {self.settings["api_key"]}'} - ...
Don't agree with the continuous validation of RD. Since the app is meant for RD, would it be better to just exit the app if the first validation fails for this?
compile-mode.nvim
github_2023
others
60
ej-shafran
ej-shafran
@@ -82,6 +82,9 @@ command("CompilePrevError", compile_mode.move_to_prev_error, { count = 1 }) command("CompilePrevFile", compile_mode.move_to_prev_file, { count = 1 }) set("n", "q", "<cmd>bdelete<cr>") +if not config.hidden_buffer then + set("n", "c", require("compile-mode.utils").close_compilation) +end
I prefer to have a buffer-specific command that we use here Also - shouldn't this be `if config.hidden_buffer`? Doesn't this do the opposite of what we want to check?
compile-mode.nvim
github_2023
others
60
ej-shafran
ej-shafran
@@ -191,6 +207,9 @@ local function jump_to_file(filename, error, smods) if vim.api.nvim_get_current_buf() ~= compilation_buffer then vim.cmd.e(filename) + elseif vim.api.nvim_get_current_buf() == compilation_buffer and + #vim.api.nvim_list_wins() == 1 then + vim.cmd.e(filename)
I think you've changed the behavior here in an undesired way. The behavior should be: - If looking at a non-compilation buffer, edit the error in this window - If there are any non-compilation buffers and we're looking at a compilation buffer, switch to another window and edit there - Otherwise, split a new window...
compile-mode.nvim
github_2023
others
60
ej-shafran
ej-shafran
@@ -157,6 +157,20 @@ function M.split_unless_open(opts, smods, count) return bufnr end +function M.close_compilation() + local config = require("compile-mode.config.internal") + local winnrs = vim.fn.win_findbuf(vim.fn.bufnr(config.buffer_name)) + print(#winnrs)
If we want to print debug logs let's use the existing logging functionality. Also - maybe this function should be moved out of `utils` and into `init`.
compile-mode.nvim
github_2023
others
60
ej-shafran
ej-shafran
@@ -363,6 +363,16 @@ input_word_completion *compile-mode.input_word_completion* autocompletion solution and find issues with the completion, you may want to try setting this to `true`. +hidden_buffer *compile-mode.hidden_buffer* + By default, `hidde...
Could we list the keybinding in the "Additional keymaps within the compilation buffer" section (and the buffer-specific command in the commands section)?
compile-mode.nvim
github_2023
others
60
ej-shafran
ej-shafran
@@ -49,6 +49,9 @@ local default_config = { ---@type boolean debug = false, + + --- @type boolean + hidden_buffer = true
Isn't the default supposed to be `false`?
Seraphine
github_2023
python
262
Zzaphkiel
Zzaphkiel
@@ -170,22 +176,27 @@ async def __runListener(self): @self.listener.subscribe(event='OnJsonApiEvent_lol-summoner_v1_current-summoner', uri='/lol-summoner/v1/current-summoner', - type=('Update')) + type=('Update'...
这个会像原来一样因为接收了非常大的数据包导致 cpu 占用突然飙升嘛 😨?
supaglue
github_2023
typescript
2,051
supaglue-labs
lucasmarshall
@@ -42,46 +40,35 @@ export default function init(app: Router): void { if (req.query?.read_from_cache?.toString() !== 'true') { const { pagination, records } = await crmCommonObjectService.list('account', req.customerConnection, { modifiedAfter: req.query?.modified_after, + expand: re...
We should be able to not have to do this if we set up the query string parser correctly in express: ```typescript import qs from `qs`; app.set('query parser', function (str) { return qs.parse(str, { comma: true }); }); ```
supaglue
github_2023
typescript
2,041
supaglue-labs
asdfryan
@@ -646,10 +650,101 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B ...data, }); if (!response.success) { - throw new Error(`Failed to update Salesforce ${objectName}: ${JSON.stringify(response)}`); + throw response.errors[0]; } } + public overri...
Use updateFieldPermissions?
supaglue
github_2023
others
2,041
supaglue-labs
asdfryan
@@ -8,6 +8,7 @@ enum: - date - datetime - boolean + - url
Should we add some documentation that this is only used for Salesforce?
supaglue
github_2023
typescript
2,042
supaglue-labs
lucasmarshall
@@ -21,32 +24,120 @@ type HubspotChangedAssociationWebhookPayload = { sourceId?: string; }; -const { providerService } = getDependencyContainer(); +const { providerService, connectionService } = getDependencyContainer(); export default function init(app: Router): void { const webhookRouter = Router(); - ...
Do we want to hard fail here, or just skip the payload and log?
supaglue
github_2023
typescript
2,042
supaglue-labs
lucasmarshall
@@ -21,32 +24,120 @@ type HubspotChangedAssociationWebhookPayload = { sourceId?: string; }; -const { providerService } = getDependencyContainer(); +const { providerService, connectionService } = getDependencyContainer(); export default function init(app: Router): void { const webhookRouter = Router(); - ...
Wouldn't we also want to use `crypto.timingSafeEqual` here to prevent timing attacks?
supaglue
github_2023
typescript
2,042
supaglue-labs
lucasmarshall
@@ -4,6 +4,7 @@ import { Client as HubspotClient } from '@hubspot/api-client'; import { BadRequestError, InternalServerError } from '@supaglue/core/errors'; import { logger } from '@supaglue/core/lib/logger'; import { getConnectorAuthConfig } from '@supaglue/core/remotes'; +import { HUBSPOT_INSTANCE_URL_PREFIX } fro...
```suggestion import { HUBSPOT_INSTANCE_URL_PREFIX } from '@supaglue/core/remotes/impl/hubspot'; ```
supaglue
github_2023
typescript
2,042
supaglue-labs
lucasmarshall
@@ -21,32 +24,122 @@ type HubspotChangedAssociationWebhookPayload = { sourceId?: string; }; -const { providerService } = getDependencyContainer(); +const { providerService, connectionService } = getDependencyContainer(); export default function init(app: Router): void { const webhookRouter = Router(); - ...
```suggestion req.log.warn({ err: e }, `Ignoring webhook error`); ```
supaglue
github_2023
typescript
2,040
supaglue-labs
lucasmarshall
@@ -0,0 +1,82 @@ +import { Client as HubspotClient } from '@hubspot/api-client'; +import type { SubscriptionCreateRequestEventTypeEnum } from '@hubspot/api-client/lib/codegen/webhooks'; +import { BadRequestError } from '../errors'; + +const HUBSPOT_WEBHOOK_TARGET_URL = + process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${pr...
When would you use `HUBSPOT_WEBHOOK_TARGET_URL` instead of relying on the fallback?
supaglue
github_2023
typescript
2,040
supaglue-labs
lucasmarshall
@@ -0,0 +1,82 @@ +import { Client as HubspotClient } from '@hubspot/api-client'; +import type { SubscriptionCreateRequestEventTypeEnum } from '@hubspot/api-client/lib/codegen/webhooks'; +import { BadRequestError } from '../errors'; + +const HUBSPOT_WEBHOOK_TARGET_URL = + process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${pr...
Maybe move this out of the `try` so we aren't needlessly catching and re-throwing it?
supaglue
github_2023
typescript
2,040
supaglue-labs
lucasmarshall
@@ -0,0 +1,82 @@ +import { Client as HubspotClient } from '@hubspot/api-client'; +import type { SubscriptionCreateRequestEventTypeEnum } from '@hubspot/api-client/lib/codegen/webhooks'; +import { BadRequestError } from '../errors'; + +const HUBSPOT_WEBHOOK_TARGET_URL = + process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${pr...
```suggestion `Your Hubspot Developer App already has an existing Webhook target URL. Please delete it first or use a different app.` ```
supaglue
github_2023
typescript
2,040
supaglue-labs
lucasmarshall
@@ -0,0 +1,82 @@ +import { Client as HubspotClient } from '@hubspot/api-client'; +import type { SubscriptionCreateRequestEventTypeEnum } from '@hubspot/api-client/lib/codegen/webhooks'; +import { BadRequestError } from '../errors'; + +const HUBSPOT_WEBHOOK_TARGET_URL = + process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${pr...
```suggestion `Your Hubspot Developer App already has an existing Webhook target URL. Please delete it first or use a different Developer App.` ```
supaglue
github_2023
typescript
2,036
supaglue-labs
asdfryan
@@ -72,21 +70,75 @@ export default function SyncsTable(props: SyncsTableProps) { filterOperators: equalOperatorOnly, }, { - field: 'entityId', - headerName: 'EntityId', - valueGetter: (params) => - params.row.entityId - ? entities.find((entity) => entity.id === params.row...
This is not a property of the Sync and rather the SyncConfig so should be omitted. What I mean is, it only affects future Syncs that have not been created and has no bearing on the individual Sync.
supaglue
github_2023
typescript
2,036
supaglue-labs
asdfryan
@@ -72,21 +70,75 @@ export default function SyncsTable(props: SyncsTableProps) { filterOperators: equalOperatorOnly, }, { - field: 'entityId', - headerName: 'EntityId', - valueGetter: (params) => - params.row.entityId - ? entities.find((entity) => entity.id === params.row...
I thought you were also going to display associations to fetch?
supaglue
github_2023
typescript
2,036
supaglue-labs
asdfryan
@@ -72,21 +70,75 @@ export default function SyncsTable(props: SyncsTableProps) { filterOperators: equalOperatorOnly, }, { - field: 'entityId', - headerName: 'EntityId', - valueGetter: (params) => - params.row.entityId - ? entities.find((entity) => entity.id === params.row...
We should convert this to the human readable version instead of the machine one. `full then incremental` -> `incremental` and `full only` -> `full`
supaglue
github_2023
typescript
2,036
supaglue-labs
asdfryan
@@ -76,6 +76,7 @@ export default function init(app: Router) { customer_id: result.customerId, sync_config_id: result.syncConfigId, paused: result.paused, + sync_config: result.syncConfig,
Doesn't this affect the openAPI spec? I feel like instead of changing the API we should just fetch the sync configs in the frontend (there's <5 of them per application, probably), and then do the mapping there.
supaglue
github_2023
others
2,024
supaglue-labs
tomkit
@@ -2,7 +2,7 @@ post: operationId: createSequenceState summary: Create sequence state description: | - In other words, adding a sequencestate to sequence. + In other words, adding a contact to sequence. If the contact is already in the sequence, it will return the id of the existing sequence state.
```Add a contact to a sequence. If the contact is already in the sequence, it will return the id of the existing sequence state.```
supaglue
github_2023
typescript
2,005
supaglue-labs
tonyxiao
@@ -48,7 +48,7 @@ export type Cursor = { }; export const encodeCursor = (cursorParams: Cursor): string => { - return encodeURIComponent(Buffer.from(JSON.stringify(cursorParams), 'binary').toString('base64')); + return Buffer.from(JSON.stringify(cursorParams), 'binary').toString('base64');
So base64 encoding is always URL safe?
supaglue
github_2023
typescript
1,673
supaglue-labs
tomkit
@@ -2170,6 +2170,9 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati const error = err as any; switch (error.code) { case 400: + if (error.body?.message.contains('INVALID_EMAIL')) {
Is there a more deterministic way to do this and/or can you point to the response signature from their API?
supaglue
github_2023
typescript
1,985
supaglue-labs
tonyxiao
@@ -1178,4 +1178,1272 @@ export const PROVIDERS_THAT_SUPPORT_SCHEMAS = ['salesforce', 'hubspot', 'pipedri export const LINEAR_STANDARD_OBJECTS = ['issues', 'comments', 'users', 'projects', 'teams'] as const; +export const MS_DYNAMICS_365_SALES_STANDARD_OBJECTS = [
What's the source of this? And how do we keep it up to date when MSDynamic updates?
supaglue
github_2023
typescript
1,986
supaglue-labs
tomkit
@@ -186,26 +186,30 @@ class SalesloftClient extends AbstractEngagementRemoteClient { heartbeat?: () => void ): (next?: string) => Promise<SalesloftPaginatedRecords> { return async (next?: string) => { - return await retryWhenAxiosRateLimited(async () => { - if (heartbeat) { - heartbeat...
is this only for this endpoint or all salesloft endpoints? if for all, we should create a rate_limit.ts just for salesloft
supaglue
github_2023
typescript
1,938
supaglue-labs
asdfryan
@@ -15,6 +15,10 @@ app.set('trust proxy', true); const metricsApp = express(); const port = process.env.SUPAGLUE_API_PORT ? parseInt(process.env.SUPAGLUE_API_PORT) : 8080; +if (process.env.GLOBAL_AGENT_HTTP_PROXY) {
Do we need to add this to the docker-compose?
supaglue
github_2023
typescript
1,973
supaglue-labs
lucasmarshall
@@ -278,29 +281,86 @@ function InnerApp(props: { signedIn: boolean; children: ReactNode } & SupagluePr }; return ( - <Box sx={{ display: 'flex', minHeight: '100vh' }}> - <CssBaseline /> - {/* Don't show navigator if not signed in */} - {signedIn && ( - <Box component="nav" sx={{ width: ...
We should change the copy and/or color of the banner if daysRemaining == 0 to indicate that access to the product may be revoked.
supaglue
github_2023
typescript
1,973
supaglue-labs
lucasmarshall
@@ -278,29 +281,86 @@ function InnerApp(props: { signedIn: boolean; children: ReactNode } & SupagluePr }; return ( - <Box sx={{ display: 'flex', minHeight: '100vh' }}> - <CssBaseline /> - {/* Don't show navigator if not signed in */} - {signedIn && ( - <Box component="nav" sx={{ width: ...
```suggestion <strong className="font-semibold">Free 30 day trial</strong> ```
supaglue
github_2023
others
1,948
supaglue-labs
lucasmarshall
@@ -0,0 +1,40 @@ +--- +description: '' +--- + +# Redshift + +## Overview + +| Feature | Available | +| --------------------------------- | --------- | +| Data normalization | No | +| Data invalidation for Unified API | No | + +## Setup + +1. Go to Connectors -> Des...
```suggestion Here are a few high-level best practices when working with tables that Supaglue lands: ```
supaglue
github_2023
others
1,948
supaglue-labs
lucasmarshall
@@ -0,0 +1,40 @@ +--- +description: '' +--- + +# Snowflake + +## Overview + +| Feature | Available | +| --------------------------------- | --------- | +| Data normalization | No | +| Data invalidation for Unified API | No | + +## Setup + +1. Go to Connectors -> De...
```suggestion Here are a few high-level best practices when working with tables that Supaglue lands: ```
supaglue
github_2023
typescript
1,946
supaglue-labs
asdfryan
@@ -13,6 +21,27 @@ export const fromDestinationModelToUnsafe = async (model: DestinationModel): Pro const decryptedConfig = JSON.parse(await decrypt(model.encryptedConfig)); switch (model.type) { + case 'bigquery': + return { + ...baseParams, + type: 'bigquery', + config: { + ...
do we not need to do this for the other 2?
supaglue
github_2023
typescript
1,946
supaglue-labs
asdfryan
@@ -273,6 +278,33 @@ function mergeDestinationConfig( ...params.config, password: params.config.password ?? existingDestination.config.password, }; + case 'bigquery':
Can we just check `if (params.type !== existingDestination.type)` at the beginning
supaglue
github_2023
typescript
1,946
supaglue-labs
asdfryan
@@ -0,0 +1,404 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ +import { createDestination, testDestination, updateDestination } from '@/client'; +import Spinner from '@/components/Spinner'; +import { useNotification } from '@/context/notification'; +import { useActiveApplicationId } from '@/hooks/useA...
we should `type="password"` for this IMO
supaglue
github_2023
typescript
1,946
supaglue-labs
asdfryan
@@ -0,0 +1,353 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ +import { createDestination, testDestination, updateDestination } from '@/client'; +import Spinner from '@/components/Spinner'; +import { useNotification } from '@/context/notification'; +import { useActiveApplicationId } from '@/hooks/useA...
we should `type="password"` for this IMO
supaglue
github_2023
typescript
1,946
supaglue-labs
asdfryan
@@ -185,7 +185,15 @@ function SyncConfigDetailsPanelImpl({ syncConfigId }: SyncConfigDetailsPanelImpl const supportsStandardObjects = ['hubspot', 'salesforce', 'ms_dynamics_365_sales', 'gong', 'intercom', 'linear']; const supportsCustomObjects = ['hubspot', 'salesforce', 'ms_dynamics_365_sales']; - const commo...
This is confusingly named
supaglue
github_2023
typescript
1,939
supaglue-labs
tomkit
@@ -1858,7 +2026,21 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati return id; } - public async listLeads(fieldMappingConfig: FieldMappingConfig, updatedAfter?: Date): Promise<Readable> { + public async listLeads( + params: CrmListParams, + fieldMappingConfig: Field...
I think we should return an error for this instead of an empty response since this is a developer-facing API. `streamLeads` is not directly developer-facing as an interface b/c it just writes to postgres
supaglue
github_2023
typescript
1,944
supaglue-labs
asdfryan
@@ -0,0 +1,34 @@ +import { UnauthorizedError } from '@supaglue/core/errors'; +import { addLogContext } from '@supaglue/core/lib/logger'; +import type { NextFunction, Request, Response } from 'express'; +import { verify } from 'jsonwebtoken'; +import jwksClient from 'jwks-rsa'; + +export async function bearerMiddleware(...
Nit: instead of bearerMiddleware (we also use bearer tokens for our API Key I think), maybe name it something clerk specific?
supaglue
github_2023
typescript
1,943
supaglue-labs
tomkit
@@ -234,16 +234,21 @@ class MsDynamics365Sales extends AbstractCrmRemoteClient { ): Promise<string> { await this.maybeRefreshAccessToken(); let objectName = plural(object.name); + // need our own odata client here as we need to set the `Prefer` header
Can you add color on the significance of this header
supaglue
github_2023
typescript
1,093
supaglue-labs
asdfryan
@@ -71,7 +76,7 @@ class MsDynamics365Sales extends AbstractCrmRemoteClient { 'OData-MaxVersion': '4.0', 'OData-Version': '4.0', 'Content-Type': 'application/json', - Prefer: `odata.maxpagesize=${MAX_PAGE_SIZE}`, + Prefer: `odata.maxpagesize=${MAX_PAGE_SIZE},return=representation`,
I think this breaks existing common objects
supaglue
github_2023
others
1,930
supaglue-labs
tomkit
@@ -23,6 +23,7 @@ put: required: false schema: type: boolean + description: If true, any syncs for any deleted objects will be cascadingly deleted for all customers with this sync config
Can we make this a :::danger admonition
supaglue
github_2023
typescript
1,928
supaglue-labs
tomkit
@@ -36,7 +36,7 @@ export function DeleteSyncConfig({ syncConfigId, onDelete }: DeleteSyncConfigPro <Typography fontWeight="bold" display="inline"> {`Sync Config ${syncConfigId}`} </Typography> - ? This will delete all existing syncs that use this Sync Config. + ...
"This will delete syncs [for] ..."
supaglue
github_2023
others
1,917
supaglue-labs
lucasmarshall
@@ -5,22 +5,31 @@ set -euo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" if [ -z "${1-}" ]; then - echo "usage: $0 <version>" + echo "usage: $0 <version> [--skip_tests]" exit 1 fi OLD_VERSION=$(jq -r .version ./package.json) VERSION=$1 -# fail if not clean working dire...
```suggestion # fail if not clean working directory ```
supaglue
github_2023
typescript
1,907
supaglue-labs
tomkit
@@ -483,21 +488,21 @@ class MsDynamics365Sales extends AbstractCrmRemoteClient { ]); } - public override handleErr(err: unknown): unknown { + public override async handleErr(err: unknown): Promise<unknown> {
nit: Could we await the json outside of this handler and keep it sync?
supaglue
github_2023
typescript
1,907
supaglue-labs
tomkit
@@ -349,22 +350,26 @@ class MsDynamics365Sales extends AbstractCrmRemoteClient { ): (nextUrl?: string) => Promise<any> { return async (nextUrl?: string) => { await this.maybeRefreshAccessToken(); - // NOTE: we don't use the odata client here as it doesn't handle pagination - const response = aw...
Would this work? ``` const responseJson = await response.json(); throw this.handleErr(responseJson); ```
supaglue
github_2023
typescript
1,894
supaglue-labs
tomkit
@@ -177,7 +177,7 @@ describe('contact', () => { `/engagement/v2/contacts/_search`, { filter: { - email: testContact.email_addresses?.[0].email_address, + emails: [testContact.email_addresses?.[0].email_address],
nit: should we try testing more than 1 email?
supaglue
github_2023
others
1,893
supaglue-labs
tomkit
@@ -1229,6 +1229,95 @@ } ] }, + "/sequence_states/_search": {
If we think we'll be doing cached vs uncached, let's use the same flag we have for list endpoints
supaglue
github_2023
others
1,893
supaglue-labs
tomkit
@@ -0,0 +1,59 @@ +post: + operationId: searchSequenceStates + summary: Search sequence states + description: | + Search sequence states by contact_id and/or sequence_id. Note: This will perform a search directly in the 3rd-party provider, and not in the managed destination. + Support: + + | Provider | Sear...
We should use `remote_provider_page_size` for remote and `page_size` for cached
supaglue
github_2023
typescript
1,891
supaglue-labs
tomkit
@@ -265,5 +266,48 @@ describe('contact', () => { // TODO this fails. For salesforce and pipedrive, no addresses are returned, for hubspot, the returned address is missing street_2 // expect(dbContact2.rows[0].addresses).toEqual(testContact.addresses); }, 120_000); + + // Search only supported for ...
Tony's client changes should be in: let's use that client going forward?
supaglue
github_2023
typescript
1,886
supaglue-labs
tomkit
@@ -50,6 +50,7 @@ export const retryWhenAxiosApolloRateLimited = async <Args extends any[], Return factor: 2, // create some jitter so concurrent apollo syncs can make progress randomize: true, - minTimeout: 2000, + minTimeout: 2_000, + maxTimeout: 60_000,
why do we need to add a max here?