Skip to content
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

Add storing single charts to local R2 bucket to syncGraphersToR2 tool #3868

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Aug 13, 2024

The syncGraphersToR2 tool let's you sync all needed entries from the chart_configs table to an actual R2 bucket. This is useful for production and staging servers but in local dev the R2 bindings currently can't connect to an actual R2 bucket and instead simulate one using a local folder.

This PR adds a tool to store single chart configs by slug from the database into the local R2 bucket by invoking the wrangler cli tool for storing R2 objects.


For more details, open the Copilot Workspace session.

Copy link
Contributor Author

danyx23 commented Aug 13, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @danyx23 and the rest of your teammates on Graphite Graphite

@danyx23 danyx23 force-pushed the danyx23/add-subcommand-to-sync-graphers-to-r2 branch from a7ad2fb to 03be17a Compare August 13, 2024 16:36
@danyx23 danyx23 force-pushed the danyx23/push-chart-config-to-local-dev branch from 0777704 to 658bd0a Compare August 13, 2024 16:36
@owidbot
Copy link
Contributor

owidbot commented Aug 13, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-danyx23-push-chart-config-to-local-dev

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-08-13 16:49:34 UTC
Execution time: 1.23 seconds

@danyx23 danyx23 force-pushed the danyx23/add-subcommand-to-sync-graphers-to-r2 branch from 03be17a to 57be3d9 Compare August 13, 2024 16:55
@danyx23 danyx23 force-pushed the danyx23/push-chart-config-to-local-dev branch from 658bd0a to 3dbf32c Compare August 13, 2024 16:55
danyx23 and others added 8 commits August 13, 2024 20:20
… that it supports multiple commands

Add support for multiple commands in `syncGraphersToR2.ts` script.

* **Refactor existing implementation:**
  - Move the existing implementation to the "sync" subcommand.
  - Update the `main` function to handle the new subcommand structure.
  - Parse the command-line arguments to determine which subcommand to execute.

* **Add new subcommand:**
  - Add a new "store-dev-by-slug" subcommand with a dummy implementation.
  - Add a help message for the new subcommand.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/owid/owid-grapher?shareId=XXXX-XXXX-XXXX-XXXX).
The syncGraphersToR2 tool let's you sync all needed entries from the chart_configs table to an actual R2 bucket. This is useful for production and staging servers but in local dev the R2 bindings currently can't connect to an actual R2 bucket and instead simulate one using a local folder.

This PR adds a tool to store single chart configs by slug from the database into the local R2 bucket by invoking the `wrangler` cli tool for storing R2 objects.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/owid/owid-grapher?shareId=XXXX-XXXX-XXXX-XXXX).
@danyx23 danyx23 force-pushed the danyx23/add-subcommand-to-sync-graphers-to-r2 branch from 57be3d9 to cc54317 Compare August 13, 2024 20:21
@danyx23 danyx23 force-pushed the danyx23/push-chart-config-to-local-dev branch from 5bb7b6f to 13bceeb Compare August 13, 2024 20:21
@danyx23 danyx23 force-pushed the danyx23/add-subcommand-to-sync-graphers-to-r2 branch 2 times, most recently from 22eaef8 to 958e4fa Compare August 14, 2024 09:46
@danyx23 danyx23 force-pushed the danyx23/add-subcommand-to-sync-graphers-to-r2 branch from 958e4fa to e35e11e Compare August 15, 2024 15:00
@danyx23 danyx23 closed this Aug 15, 2024
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