Commit Graph

19 Commits

Author SHA1 Message Date
Taddes
77254b4a6e
refactor: python imports (#1730)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
refactor: unified python imports for consistency in local, production, and test environments
2025-08-04 15:37:46 -04:00
Taddes
d716ac5d10
feat: spanner scripts parse gcp project (#1714)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
feat: spanner scripts parse gcp project
2025-07-22 20:18:30 -04:00
Ethan Donowitz
0ae5fd2059
refactor: add settings crates (#1306)
This is a breaking change. This commit separates syncstorage and tokenserver settings into separate structs that are contained by a parent `Settings` struct. This means that any env vars that hold settings specific to syncstorage (e.g. `SYNC_DATABASE_URL`) have been renamed to `SYNC_SYNCSTORAGE__DATABASE_URL`. Any settings that were moved from the top-level `Settings` struct to the lower level, syncstorage-specific struct will now have a `SYNC_SYNCSTORAGE__` prefix instead of a `SYNC_` prefix.

Closes #1276
2022-10-19 17:15:56 -04:00
JR Conlin
487ac11ed0
feat: Add "auto-split" arg to auto-gen UID prefixes (#1035)
Closes: #1034
2021-04-02 15:34:20 -07:00
JR Conlin
a79f8407de
feat: switch from regex_contains to starts_with (#805)
* added add'l command aliases
  * `--ids` == `--collection_ids`
  * `--prefix` == `--uid_prefixes`
* switched to parameterized DML

Issue #799

Co-authored-by: Donovan Preston <donovanpreston@gmail.com>
2020-09-01 11:11:38 -04:00
jrconlin
7263202c59
f r's 2020-08-25 19:44:52 +00:00
jrconlin
8cfbb8510c
f add conditions to batches 2020-08-24 16:00:47 +00:00
jrconlin
714168d107
bug: fix purge_ttl advanced features
* fix `fxa_uaid` typo
* fix `collection_ids` handler to deal with default empty ids.

Closes #799
2020-08-24 15:13:26 +00:00
Mark Drobnak
59aa28a4e5
feat: More purge_ttl features (#776)
* Support a mode option in purge_ttl

* Support an expiry mode option in purge_ttl

* Support serially deleting prefixes by regex

Also changes the collection IDs option from a JSON list to an args list
(i.e. [item1,item2,item3]).

Closes #735
Closes #743
2020-08-11 15:05:11 -04:00
jrconlin
695722a9b5
feat: option to limit purgettl to range of fxa_uids
Added `--uid_starts` option which will limit purge_ttl bso deletes to
fxa_uids that begin with specified characters.
(e.g.

`purge_ttl.py --uid_starts="AA" --collection_ids=[7,8]`

will limit to scanning bso tables to fxa_uid values that begin with "AA"
and only the 7 & 8 collections

Closes #713
2020-07-07 14:23:58 +00:00
JR Conlin
198eb816bc
feat: limit purge ttl to prior midnight (#708)
Closes #707

Co-authored-by: Donovan Preston <donovanpreston@gmail.com>
2020-07-02 07:54:59 -04:00
JR Conlin
2a14eb2973
feat: add conditions, args to purge_ttl script (#668)
* feat: add conditions, args to purge_ttl script

attempt to try and provide a way to allow the purge_ttl script to
complete.
* Adds arguments (ENV VARS):

  --instance_id (INSTANCE_ID)  Spanner instance id
  --database_id (DATABASE_ID)  Spanner database id
  --sync_database_url (SYNC_DATABASE_URL) Spanner DSN
        `spanner://instance/database`
  --collection_ids (COLLECTION_IDS)
        JSON formatted list of collections to limit deletions
        e.g. `--collection_ids=123` limits to just collection 123
             `--collection_ids=[123,456]` limits to both 123 & 456
             default is all collections

Issue #631

Co-authored-by: Philip Jenvey <pjenvey@underboss.org>
2020-06-12 15:35:39 -07:00
Erik Olson
c8134fda4a
purg_ttl.py pep8 2020-01-07 21:52:51 -05:00
Erik Olson
74b95544b0
purge_ttl.py updates for PR comments 2020-01-07 15:57:46 -05:00
Erik Olson
92a57e653d
feat: add basic logging to stdout and statsd metrics for purge_ttl.py 2020-01-07 15:51:45 -05:00
Philip Jenvey
beddaf600f
refactor: schema renames (again)
- always prefix primary key names with their table name (id -> bso_id,
  collection_id). a best practice in spanner, as when tables
  interleave, their shared id names must always match
- bso -> bsos (every other table name's plural)
- give batches an expiry index

Closes #313
2019-11-04 11:26:19 -08:00
jrconlin
c085ff8b2c
f read the spanner data from the spanner DSN 2019-10-18 14:39:30 -07:00
jrconlin
30a77a9d1b
f r's
* make purge_ttl a real script
* pull data from env
* add `batches` purge
* delete to expiry
2019-10-18 13:58:45 -07:00
jrconlin
21fbdb46ae
feat: add spanner tools
Add a set of python based tools for managing data in the spanner
database.

Issue: #119, #284
2019-10-18 08:31:04 -07:00