Skip to content

Move Lab2MetricsReporter singleton to Lab2Registry#55376

Closed
sanchitmalhotra126 wants to merge 159 commits into
stagingfrom
sanchit/lab2-metrics-registry
Closed

Move Lab2MetricsReporter singleton to Lab2Registry#55376
sanchitmalhotra126 wants to merge 159 commits into
stagingfrom
sanchit/lab2-metrics-registry

Conversation

@sanchitmalhotra126

@sanchitmalhotra126 sanchitmalhotra126 commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

Follow-up to #55339. These changes are mostly just replacement/renames; no major functionality changes:

  • Adds LabMetricsReporter to Lab2Registry so lab2 code can access the reporter via the Lab2Registry instance
  • Replace usages of Lab2MetricsReporter with Lab2Registry.getInstance().getMetricsReporter() (note: in some class components, I wired this in through the constructor to make it easier to unit test)
    • Will follow-up (maybe in a separate PR?) with unit testing updates where applicable
  • Remove the default singleton export from Lab2MetricsReporter and make the class export the default.

The final follow-up to this will be to rename Lab2MetricsReporter -> LabMetricsReporter and likely move out of the lab2 directory. I wasn't sure yet where to move it so I held off on this step to avoid further inflating the PR.

Warning!!

We have entered Pixel Lock for Hour of Code!

Computer Science Education Week will be happening from Dec 4 - Dec 10. Alongside this event, we will
be launching our new Hour of Code activity. Please consider any risk introduced in this PR that
could affect Dance Lab, instructions, saving and logging student progress, caching, or anything
related to the Hour of Code activities, old or new. Even small changes, such as a different button
color, are considered significant during this time. If this change will affect the new Hour of Code
activity in any way, join the morning change review to get your changes approved prior to merging.
Reach out to the Student Labs team for more details!

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Mario Gil Correa and others added 30 commits November 15, 2023 15:51
Catch staging-next up to staging
#55181)

* refactor posters section

* add new poster links and thumbnail images

* update description copy

* refactor to use a loop and make links accessible

* empty commit message

@fisher-alice fisher-alice left a comment

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.

Easy-to-understand changes and cool to see how much we're already using MetricsReporter! Just left a question.

@@ -3,7 +3,7 @@ import {SongMetadata} from '../types';
import {commands as audioCommands} from '@cdo/apps/lib/util/audioApi';

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.

Similar to LabMetricsReporter being used for both legacy and lab2, since ProgramExecutor is used by legacy and wb used by lab2, do you plan to move this file as well?

@sanchitmalhotra126 sanchitmalhotra126 Dec 12, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! Yeah, it would probably make sense to move it out to apps/src/dance

try {
// Update properties for reporting as early as possible in case of errors.
Lab2MetricsReporter.updateProperties({
Lab2Registry.getInstance().getMetricsReporter().updateProperties({

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.

Although longer, I appreciate the clarity of this change as someone who is not as familiar with lab2.

@sanchitmalhotra126 sanchitmalhotra126 changed the base branch from staging-next to staging December 12, 2023 22:35
@sanchitmalhotra126 sanchitmalhotra126 requested review from a team as code owners December 12, 2023 22:35
@sanchitmalhotra126 sanchitmalhotra126 changed the base branch from staging to staging-next December 12, 2023 22:36
@sanchitmalhotra126 sanchitmalhotra126 removed request for a team December 12, 2023 22:36
@sanchitmalhotra126 sanchitmalhotra126 changed the base branch from staging-next to staging December 12, 2023 23:11
@sanchitmalhotra126 sanchitmalhotra126 changed the base branch from staging to staging-next December 12, 2023 23:14
@sanchitmalhotra126 sanchitmalhotra126 changed the base branch from staging-next to staging December 12, 2023 23:21
@sanchitmalhotra126

Copy link
Copy Markdown
Contributor Author

Closing in favor of #55410

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.