Deprecating Firebase#56276
Conversation
…t block Co-authored-by: Cassi Brenci <cnbrenci@users.noreply.github.com>
Co-authored-by: Cassi Brenci <cnbrenci@users.noreply.github.com>
Co-authored-by: Cassi Brenci <cnbrenci@users.noreply.github.com>
…precision/smoothing
Extract DatablockStorageKvp.set_kvps
This commit causes the firebase and datablock storage APIs to diverge a little. Co-authored-by: Cassi Brenci <cnbrenci@users.noreply.github.com>
…rageBackend() which returns the right backend. Co-authored-by: Cassi Brenci <cnbrenci@users.noreply.github.com>
|
This PR is a continuation of #54643, which was mis-closed by the Git LFS migration (#55759). Previous Comments:
In applab.j... more
The only thing that looks like it might need subscription like functionality is
I'd personally like to see how widely used the
project = Project.where(project_type: 'applab', updated_at: 30.days.ago...).take!
Confirmed that this does work (I successfully downloaded the source)
The last step would be we need to run it against the prod dashboard DB with the "sources" s3_path_prefix instead of "sources_development" #!/usr/bin/env ruby
require_relative('../config/environment')
# Gets a sampling of applab source code from s3
# computes the percentage of those sources that use the onRecordEvent block
def percent_projects_actively_using_block(project_type, block_type, last_active_afte... [more](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1804922481)
- **snickell** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1805128299) - Nice!! Curious what percent we're gonna end up with 🤞 when we run on production.
- We should probably use random samples rather than whatever MySQL happens to give for a default ordering. I generally avoid using DB-specific SQL, but since we're just a one-off script.... `Project.where(...).order('RANDOM()').take(sample_size)` (https://www.geeksforgeeks.org/sql-select-random/). This does require the DB to internally walk the entire set of matching rows, join with a random number each, and then... [more](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1805128299)
- **snickell** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1809461422) - We sampled the prod DB to find instances of the `onRecordEvent` block being used in applab projects. Where we found instances, we read the code to see if they were broken or TOS violations.
TL;DR: **0.002% of applab projects (that aren't stubs or chat apps) created in the last 2 months use the `onRecordEvent` block, with a sample size of 100k.**
1. Sampling applab projects created in the last 2 months, 6 out of 100000 applab projects created in the last 2 months used `onRecordEvent`. We re... [more](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1809461422)
- **snickell** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1813699715) - Product noticed (TY @moneppo) we hadn't considered that students use different blocks throughout the year as they complete different curriculum.
So we went back to the sampling, and grabbed 105k samples covering all of 2022...
We scanned 2022 (samples from each month), and **we found 3 "valid" apps in 2022 out of 105k samples (=0.003%, about the same as the "last two months" sample)**. "Valid" meant apps that weren't either chat apps, or stub code (e.g. "drag some blocks out"). We found 1... [more](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1813699715)
- **snickell** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1815763762) - We couldn't figure out how people were writing gamelab based chat apps. I found the "secret" gamelab APIs thanks to Hannah Nees giving me a great sample of "banned chat apps", including samples from Gamelab. These use "setKeyValue" and "getKeyValue" functions.... which aren't exposed as blocks (?!?).
Relevant code is here: https://github.com/code-dot-org/code-dot-org/blob/e6905b0c899383ca2c7e43885f847cedf84478b2/apps/src/p5lab/gamelab/commands.js/#L25-L47
The PR that added them is here: ht... [more](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1815763762)
- **davidsbailey** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1815816682) - > @davidsbailey any chance you remember why we were adding these APIs without adding them as blocks?
no, sadly I do not think I was involved in this decision.
- **snickell** [commented](https://github.com/code-dot-org/code-dot-org/pull/54643#issuecomment-1899550847) - - Next we should start implementing more methods from the firebase interface we extracted, and get corresponding tests passing.
- We should also consider adding tests that actually create student source using the data blocks, and thereby test end to end, from JS api through the Rails controller. I think these tests, while a little more bulky, will actually catch much more and more helpful potential breakages in the future.
### Previous Reviews: |


Tracking issue for the firebase deprecation project: https://github.com/orgs/code-dot-org/projects/4
This PR will probably not be merged, but we're writing a fair bit of code to build a bulk importer etc that we'll probably throw away (see #55189 ). We could have opened a new repo, but it seemed reasonable just to keep it on this branch.