Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 0 1 * * *
COPY_SCHEDULE 10 1 * * *
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/leaderboards_commits.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 5 1 * * *
COPY_SCHEDULE 20 1 * * *
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/leaderboards_forks.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 5 1 * * *
COPY_SCHEDULE 30 1 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 10 1 * * *
COPY_SCHEDULE 40 1 * * *
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/leaderboards_members.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 10 1 * * *
COPY_SCHEDULE 50 1 * * *
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/leaderboards_merge_time.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 15 1 * * *
COPY_SCHEDULE 0 2 * * *
Copy link

Choose a reason for hiding this comment

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

New schedule collision with existing daily copy pipe

Medium Severity

leaderboards_merge_time.pipe was moved to COPY_SCHEDULE 0 2 * * *, which is the exact same schedule as the existing project_insights_copy.pipe (also 0 2 * * *). This introduces a new concurrent execution that didn't exist before (it was previously at 15 1 * * *), working against the PR's goal of reducing queue pressure. Several hourly copy pipes also fire at :00, compounding the overlap at the 2:00 AM slot.

Fix in Cursor Fix in Web

Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 15 1 * * *
COPY_SCHEDULE 10 2 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 20 1 * * *
COPY_SCHEDULE 20 2 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 20 1 * * *
COPY_SCHEDULE 30 2 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 25 1 * * *
COPY_SCHEDULE 40 2 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 25 1 * * *
COPY_SCHEDULE 50 2 * * *
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 30 1 * * *
COPY_SCHEDULE 0 3 * * *
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/leaderboards_stars.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ SQL >
TYPE COPY
TARGET_DATASOURCE leaderboards_copy_ds
COPY_MODE append
COPY_SCHEDULE 30 1 * * *
COPY_SCHEDULE 10 3 * * *
64 changes: 64 additions & 0 deletions services/libs/tinybird/scripts/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

PIPES_FOLDER="pipes"

cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." || exit 1

show_help() {
cat << EOF
Usage: push.sh [OPTIONS]

Push Tinybird pipe files using "tb push".

OPTIONS:
--help Show this help message and exit
--match PATTERN Match files containing PATTERN in their name (wildcard match)

EXAMPLES:
push.sh
Push all pipe files

push.sh --match leaderboards_
Push only files containing "leaderboards_" in their name

EOF
exit 0
Copy link

Choose a reason for hiding this comment

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

Error paths exit with success status code

Low Severity

show_help unconditionally calls exit 0, but it's also invoked from the error paths for unknown options and missing --match argument. This causes the script to report success even when it fails to parse arguments and performs no work. If used in automation or chained with &&, the silent success on error could mask a failure to push any pipes.

Additional Locations (2)

Fix in Cursor Fix in Web

}

# Parse command line arguments
MATCH_PATTERN=""

while [[ $# -gt 0 ]]; do
case $1 in
--help|-h)
show_help
;;
--match)
if [ -z "$2" ] || [[ "$2" == --* ]]; then
echo "Error: --match requires a pattern argument"
echo ""
show_help
fi
MATCH_PATTERN="$2"
shift 2
;;
*)
echo "Error: Unknown option: $1"
echo ""
show_help
;;
esac
done

for file in "$PIPES_FOLDER"/*; do
if [ -f "$file" ]; then
local_basename=$(basename "$file")

# Skip file if pattern is set and doesn't match
if [ -n "$MATCH_PATTERN" ] && [[ ! "$local_basename" == *$MATCH_PATTERN* ]]; then
continue
fi

tb push "$PIPES_FOLDER/$local_basename" --force --yes
fi
done