Skip to content

LG-15538: Add warning when returning local data#11784

Merged
zachmargolis merged 3 commits intomainfrom
margolis-data-pull-warn
Jan 22, 2025
Merged

LG-15538: Add warning when returning local data#11784
zachmargolis merged 3 commits intomainfrom
margolis-data-pull-warn

Conversation

@zachmargolis
Copy link
Copy Markdown
Contributor

🎫 Ticket

Link to the relevant ticket:
LG-15538

🛠 Summary of changes

Adds a warning line with emoji when this script is running locally (it is expected to be run remotely via SSM in the devops repo instead of directly)

Example locally:

> ./bin/data-pull uuid-convert abc def
⚠️ WARNING: returning local data for data-pull
*Task*: `uuid-convert`
*UUIDs*: 
+--------------+-------------+---------------+---------+
| partner_uuid | source      | internal_uuid | deleted |
+--------------+-------------+---------------+---------+
| abc          | [NOT FOUND] | [NOT FOUND]   |         |
| def          | [NOT FOUND] | [NOT FOUND]   |         |
+--------------+-------------+---------------+---------+

changelog: Internal, Scripts, Warn when data-pull is used locally
@zachmargolis zachmargolis requested a review from a team January 22, 2025 19:35
Copy link
Copy Markdown
Contributor

@n1zyy n1zyy left a comment

Choose a reason for hiding this comment

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

Awesome! I think this will prevent a headache for someone else down the road. 😄

option_parser.parse!(argv)

if rails_env.local?
stderr.puts "⚠️ WARNING: returning local data for #{File.basename($PROGRAM_NAME)}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👏

@zachmargolis zachmargolis merged commit c1cda40 into main Jan 22, 2025
@zachmargolis zachmargolis deleted the margolis-data-pull-warn branch January 22, 2025 22:04
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.

2 participants